Create and Configure File Systems Flashcards Preview

Rhcsa > Create and Configure File Systems > Flashcards

Flashcards in Create and Configure File Systems Deck (42)
Loading flashcards...
1

to create a file system

use mkfs(may ways to use it depending on the file system type, ie)
# mkfs -t ext4 /dev/sdb1
# mkfs.ext4 /dev/sdb1

2

tune2fs

helps us control how many times a filesystem can be mounted before a filesystem check needs to run on it.

Command to run after you've formatted a partition
#tune2fs -m0 /dev/sdb1

3

check info on a filesystem

#tune2fs -l /dev/sdb1

4

check a filesystem

#fsck /dev/sdb1 do not run on a mounted filesystem

5

to create an xfs filesystem

#mkfs.xfs /dev/sdb2

6

to create a vfat filesystem

#mkfs.vfat /dev/sdb3

7

To get details about a file system type

#dumpe2fs /dev/sdb2

8

to repair an unmounted filesystem consistency (xfs filesystem)

#xfs_repair /dev/sdb2

9

to get details about a mount xfs filesystem

#xfs_info /dev/sdb2

10

to repair an unmounted vfat filesystem

fsck.vfat /dev/sdb3

11

steps to mount a filesystem

1 - create a directory
#mkdir /mnt/data
2. mount the filesystem
# mount -t ext4 /dev/sdb1 /mnt/data
3. check that it's mounted
# mount | grep data
4. add entry to /etc/fstab to mount after reboot(permanent)

12

What's needed to mount an NFS(network file system) filesystem

First you need to install
# yum -y install nfs-utils nfs-utils-lib
Then you need to start the right services
# service nfs start
# service rpcbind start
Afterward add them to start at boot
# chkconfig nfs on
#chkconfig --level 35 rpcbind on

13

show which nfs filesystem is available on a system

#showmount -e [ip or hostname]

14

mount nfs to a local directory

# mkdir /mnt/nfs
# mount -t nfs ip:/srv/nfs /mnt/nfs you could also put hostname instead of ip
For permanent entry add to /etc/fstab
name:/srv/nfs /mnt/nfs nfs _netdev 0 0

15

for nfs use _netdev instead of defaults

It tells the mount command to wait for the network services to come up prior to mounting the share(to prevent hanging)

16

for CIFS network file system (common Internet File System)

Install the samba client packages
#yum install -y cifs-utils
# yum install -y samba-client

17

Cifs permanent mounting

//smbserver/shared /mnt cifs rw,user,credentials=/root/secret.txt 0 0

in /root/secret.txt add
username=visitor
password=Welcome123$

18

to see which shares are available on a cifs server

#smbclient -U username -L [hostname/IP]

19

To login to the remote cifs share

#smbclient -U username //ip/shared

20

You can run windows command when you've logged into a cifs shared

smb:\> get filename.txt download a file
smb: \> put file1.txt upload a file

21

To mount a cifs share(temporarily)

# mount -t cifs -o user-[username] //IP-or-host/shared /mnt/shared
review man mount.cifs
You can also do it from the desktop
Go to Places -> connect to server
Change the service type to window share, enter info, then click connect

22

To increase the size of a logical volue

use the lvextend command. When you extend the logical volume, yo ucan indicate how much to extend the volume, or how large you want it to be after you extend it.

23

The following command extends the logical volume /dev/myvg/homevol to 12GB

#lvextend -L 12G /dev/myvg/homevol

24

The following command adds another gigabyte to the logical volume

#lvextend -L +1G /dev/myvg/homevol

25

The following command extends the logical volume called testlv to fill all of the unallocated space in the volume group myvg

#lvextend -l +100% Free /dev/myvg/testlv

26

adding a filesystem on a logical volume

#mkfs.ext4 /dev/vg_new/lv_new
#mkdir /extra directory to mount logical volume
add entry to /etc/fstab
/dev/vg_new/lv_new /extra ext4 defaults 0 0
# mount -a

27

To grow the logival volume lvresize can also be used

#lvresize -L 900M /dev/vg_new/lv_new
Then resize the filesystem
# resize2fs /dev/vg_new/lv_new

28

To shrink the logical volume(make sure to have a backup)

#unmount extra
#fsck -f /dev/vg_new/lv_new
#resize2fs /dev/vg_new/lv_new 800MB
#lvresize -L 800MB /dev/vg_new/lv_new

29

Set-GID

set-gid directories are used for group collaboration. Everything that is created in a directory with that special permission bit, is automatically owned by the group

30

how to apply the set-git permission

applying the set-git permission on a directory by add a 2 before the standard permission set
# chmod 2755 share
-Then you'll see the directory has a permission set that contains a 's' now in place of the x for group
-the character based way to setup a set-gid directory
#chmod g+s share