Modifying an XFS File System

Note:

You can't modify a mounted XFS file system.

You can use the xfs_admin command to modify an unmounted XFS file system, such as the following actions:

  • Enable or disable lazy counters

  • Change the file system UUID

  • Change the file system label

To display the existing label for an unmounted XFS file system and then apply a new label, use the following command:

sudo xfs_admin -l /dev/sdb
label = ""
sudo xfs_admin -L "VideoRecords" /dev/sdb
writing all SBs
new label = "VideoRecords"

Note:

The label can be a maximum of 12 characters in length.

To display the existing UUID and then generate a new UUID, use the following command:

sudo xfs_admin -u /dev/sdb
sudo xfs_admin -U generate /dev/sdb

To clear the UUID altogether, use the following command:

sudo xfs_admin -U nil /dev/sdb
Clearing log and setting UUID
writing all SBs
new UUID = 00000000-0000-0000-0000-000000000000

To disable and then reenable lazy counters, use the following commands:

sudo xfs_admin -c 0 /dev/sdb
sudo xfs_admin -c 1 /dev/sdb

For more information, see the mkfs_admin(8) manual page.