How to create, view, and remove a filesystem label

Solution Verified - Updated -

Issue

  • We need to add a label to a filesystem, such as XFS or EXT4.
  • We want to check the currently configured label of a filesystem.
  • We need to change or remove an existing filesystem label.
  • We want to use labels in /etc/fstab instead of device names (e.g., /dev/sda1) for persistent mount configurations.

Environment

  • Red Hat Enterprise Linux (RHEL) - All versions
  • Filesystem:
    • XFS
    • EXT2, EXT3 and EXT4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content