Creating XFS Filesystems

The eXtended File System (XFS) is a high-performance journaling file system developed by Silicon Graphics Incorporated originally for its IRIX family of systems. It features characteristics similar to JFS from IBM by also supporting very large file and partition sizes. Therefore, usage scenarios are very similar to JFS. XFS is one of the best for large storage clusters and backup servers. Before creating the XFS file partition make sure that you have installed the following rpms which will upload the xfs module in the kernel memory(insmod) if you are getting ” -bash: mkfs.xfs: command not found ” make sure that the following rpms are installed properly.

  • # yum install kmod-xfs xfsdump xfsprogs dmapi

Creating Linux partition

You need to create the partition first using fdisk or parted (i have explained creating partion using fdisk here). For example if your hard drive is /dev/sda

  • # /sbin/fdisk /dev/sda

Make sure you have followed the steps in the following table.

Fdisk Menu

Once you have created the partition successfully, format it with the mkfs.xfs (/dev/sda7 is the new partion created in my case)

  • # mkfs.xfs /dev/sda7

mkfs.xfs

Assigning a Label for XFS filesystem using xfs_admin

  • /usr/sbin/xfs_admin -L xfs /dev/sda7

Edit the /etc/fstab using your favorite text editor and add the following lines.

LABEL=/xfs   /xfs   xfs defaults   1 2

Finally mount the new partition on the directory with (/xfs is the mount director in my case)

  • # mount /xfs

Once mounted execute the mount command and make sure that the new partition mounted filesystem is xfs ” /dev/sda7 on /xfs type xfs (rw) “

Useful Links : Xfs HomePage