I have the partition created:
# cat /proc/partitions
Type mkfs and press tab twice.
There are many mkfs utilities. The default is mkfs.xfs.
# mkfs.xfs –help (check the options)
blocksize is for large file syse and need big blocks to alocate.
inode is useful for SELinux in order to store metadata.
label – is a name for fileSystem.
# mkfs.xfs -L myfs /dev/sdb1
in order to use it, use mount command:
simple option for moment:
#mount /dev/sdb1 /mnt
mounting is connecting something to a directory.
Check by listing all mounted devices:
Check only my device:
# mount | grep ^/dev
If want to disconnect device:
# umount /dev/sdb1
# umount /mnt
If I don’t want after next boot to be changed the anme of device from /dev/sdb1 to /dev/sdc1, use UUID
# blkid (block ID)
UUID is generated and is unique and Label is generated manually by administrator and is fixed.
# mount LABEL=myfs /mnt
The clasical way to automount:
Every file system have UUID.
Mount options. Can be used for ACL the acl mount option on /etc/fstab
Column 5 is the backup support. 1 is the backup support which is used in older environments.
Column 6 is for fsck (fs check) is checking the fs. On boot is checked. Option 0 is for no, 1 is for checking /root filesystem first and 2 is for checking and is not root file system.
Create partition > make file system > mount it.
# vi /etc/fstab
All file systems are added there.
Device name mount point fileSystems default backup checkOnBooting
/dev/sdb1 /data xfs defaults 1 2
# mount -a
create the directory /data
# mount -a
# mount | grep ^/dev/
There are some problems. If the server change the name, the file system will not be mounted. Need the label or the UUID.
# blkid (show labels and UUID for all file systems)
LABEL=myfs /data xfs defaults 1 2
Change the label of file system:
# xfs_admin help
# xfs_admin -L bootdevice /dev/sda1