Create and Configure File Systems Flashcards
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
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
check info on a filesystem
tune2fs -l /dev/sdb1
check a filesystem
fsck /dev/sdb1 do not run on a mounted filesystem
to create an xfs filesystem
mkfs.xfs /dev/sdb2
to create a vfat filesystem
mkfs.vfat /dev/sdb3
To get details about a file system type
dumpe2fs /dev/sdb2
to repair an unmounted filesystem consistency (xfs filesystem)
xfs_repair /dev/sdb2
to get details about a mount xfs filesystem
xfs_info /dev/sdb2
to repair an unmounted vfat filesystem
fsck.vfat /dev/sdb3
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)
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
show which nfs filesystem is available on a system
showmount -e [ip or hostname]
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
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)
for CIFS network file system (common Internet File System)
Install the samba client packages #yum install -y cifs-utils # yum install -y samba-client