Adding a XFS filesystem to CentOS 5

Howto use enterprise Linux ‘extras’ to mount a XFS filesystem on a CentOS v5.2 VM

Install RPM’s
Note: Due to this bug (3205), install binutils to overcome the error “xargs: nm: No such file or directory” while installing kmod-xfs-xen.

# yum install binutils
# yum install xfsprogs yum-kmod kmod-xfs-xen

# mkfs.xfs -f /dev/sda1

Check

A chunk of disk (2TB) has been allocated to a LVM partition for the VM, which is formatted with XFS. The device is mapped into the VM as /dev/xvdc1 (i.e. a whole device, c.f. partitioned device).

Before using the filesystem, perform a check:

# xfs_check /dev/xvdc1

Note: xfs_check requires a significant chunk of memory to run. With 2Gbyte of swap and 1Gbyte of RAM a check was unsuccessful.

Mount
Mount the disk by using it’s volume label. The label can be verified with the xfs_admin program:

# xfs_admin -l /dev/xvdc1
label = “purple-files”

Add the mount entry to ‘/etc/fstab’ so that the filesystem is automatically mounted at the next restart.

LABEL=purple-files /files xfs defaults 0 0
Mount the filesystem

# mount /files

NOTE: CENTOS 6.X

Centos 6.X (64bit) already supports XFS in kernel. You only need to
install xfsprogs package to mount xfs filesystems.

just yum install xfsprogs (it is included in centos 6.2 base)

Appendices

# yum install xfsprogs yum-kmod kmod-xfs-xen

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kmod-xfs-xen x86_64 0.4-2 extras 256 k
xfsprogs x86_64 2.9.4-1.el5.centos extras 1.3 M
yum-kmod noarch 1.1.10-9.el5.centos base 15 k

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 1.6 M

Leave a Reply

Your email address will not be published. Required fields are marked *