Learn about the XFS filesystem in Linux. An article explaining what is xfs, features, and commands of XFS. Also, how to migrate from EXT to the XFS file system.
What is xfs?
XFS is a high-performance file system designed by Silicon Graphics Inc in 1993. It is the default file system in RHEL7. XFS supports parallel IO operations because of its allocation group structure which makes it high performance operating file system. Journaling features helps it in faster data recovery in case of a crash. Lets quickly walk through a few aspects of XFS for your understanding.
Features of XFS
- Its 64-bit file system with a max file system size of 8EB.
- Supports metadata journaling which helps in faster data recovery in case of a system crash.
- It can be extended while mounted and active.
- It is internally partitioned into allocation groups. 4 different allocation groups available.
- Directory quotas help to limit quota over the directory tree.
- Quota journaling avoids quota consistency checks after the crash and hence quicker recovery
- Extended attributes associated with each file. Those are additional name/value pairs.
- Online de-fragmentation is supported.
- It has native backup (
xfsdump
) & restore (xfsrestore
) utilities.
How to upgrade EXT to XFS
The obvious question is how to upgrade from ext4 to xfs? or upgrade from ext3 to xfs etc. We have different ways to upgrade ext file systems but there is no full-proof way to upgrade ext to xfs. You can have below approach to migrate from ext to xfs filesystem –
- Create a new xfs file system
- Copy over data from old ext file system to xfs using copy or rsync
- Remove old ext file system
Commands for XFS file system management
- Create xfs file system :
mkfs.xfs
command. - Mount xfs file system : No extra switch for
mount
command - Quota management :
xfs_quota
command - Extending file system :
xfs_growfs
command - Repair file system :
xfs_repair
command - Suspend write on file system :
xfs_freeze
command (-f
for suspend,-u
for resume) - Bakcup :
xfsdump
command - Restore :
xfsrestore
command - Print file system information :
xfs_info
command - De-fragmentation :
xfs_fsr
command with no argument - Debug mode :
xfs_db
command
We covered few of these commands in detail in our next article.
Conclusion
XFS is a high-performance filesystem available in most Linux distro and as a default in some. We will see the difference between ext3, ext4, and xfs in upcoming articles along with the XFS command in detail.