Creating an XFS File System With the Reflink Feature
In Oracle Linux 8, you can create XFS file systems by using the Reflink feature. This feature reduces disk space consumption and copies files faster. For example, if you use a reflink-aware tool to copy a directory tree, the files in the copy share disk space with the original. It takes much less time make a reflink copy of the directory tree than to create a regular copy of a file system. In addition, no added storage is used.
Note that the reflink feature is enabled by default in Oracle Linux 8 when formatting by using the mkfs.xfs command.
To begin working with XFS's reflink support, do the following steps:
-
Format a file system:
sudo mkfs.xfs /dev/sda1
meta-data=/dev/sda1 isize=512 agcount=4, agsize=6553600 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 data = bsize=4096 blocks=26214400, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=12800, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
Note:
If you don't see the exact phrase
reflink=1
in the mkfs command output, then the system is too old and the feature wouldn't work on XFS. -
Mount the file system:
sudo mount /dev/sda1 /storage
The files system is now ready to absorb new files.
For a detailed demonstration on using the reflink feature, see https://blogs.oracle.com/linux/xfs-data-block-sharing-reflink.