Modify persistent naming attributes

You can change the UUID or Label persistent naming attribute of a file system.

Before you begin

  • If you are modifying the attributes of an XFS file system, unmount it first.

About this task

Note
Changing udev attributes happens in the background and might take a long time. The udevadm settle command waits until the change is fully registered, which ensures that your next command is able to use the new attribute correctly.

In the following commands:

  • Replace new-uuid with the UUID you want to set; for example, 1cdfbc07-1c90-4984-b5ec-f61943f5ea50. You can generate a UUID by using the uuidgen command.
  • Replace new-label with a label; for example, backup_data.

Procedure

  • To change the UUID or Label attributes of an XFS file system, use the xfs_admin utility:
    # xfs_admin -U new-uuid -L new-labelstorage-device
    # udevadm settle
  • To change the UUID or Label attributes of an ext4, ext3, or ext2 file system, use the tune2fs utility:
    # tune2fs -U new-uuid -L new-labelstorage-device
    # udevadm settle
  • To change the UUID or Label attributes of a swap volume, use the swaplabel utility:
    # swaplabel --uuid new-uuid --label new-labelswap-device
    # udevadm settle