Last updated: 2026-08-18

Partition & filesystem volume labels (e2label, UUID, fstab)

Category: Storage AdministrationTopics: UUID, PARTUUID, Volume Labels, fstab

Dynamic device node paths like /dev/sda and /dev/nvme0n1 can change order when storage hardware or bus controllers change. Linux solves this with Persistent Block Device Naming using filesystem UUIDs, GPT PARTUUIDs, volume labels, and partition labels in /etc/fstab.

Persistent identifier types

IdentifierLocationfstab Syntax ExampleUse Case
Filesystem UUIDSuperblock of the filesystemUUID=4f923b7a-9a81-4b72-9d33-871d8a11a2bcStandard /etc/fstab entries; remains constant regardless of bus changes or repartitioning of other disks.
GPT PARTUUIDGPT partition table entryPARTUUID=8c6b1b8a-70e2-4c77-96a1-94e51f729221Kernel boot parameters (root=PARTUUID=...); persists even before filesystems are formatted.
Filesystem LABELFilesystem superblock headerLABEL=ROOT_FSHuman-readable volume identification for removable media and backup drives.
GPT PARTLABELGPT partition table headerPARTLABEL=EFI_SYSTEMPartition identification prior to filesystem creation.

Managing volume labels across filesystems

FilesystemSet Label CommandView Label CommandMax Characters
Ext4 / Ext3 / Ext2sudo e2label /dev/sdX1 "ROOT_FS"
or sudo tune2fs -L "ROOT_FS" /dev/sdX1
sudo e2label /dev/sdX116 chars
XFSsudo xfs_admin -L "DATA_POOL" /dev/sdX1sudo xfs_admin -l /dev/sdX112 chars
Btrfssudo btrfs filesystem label /mnt/pool "STORAGE"sudo btrfs filesystem label /mnt/pool255 chars
FAT32 / ESPsudo fatlabel /dev/sdX1 "EFI-SYSTEM"sudo fatlabel /dev/sdX111 chars

Sample /etc/fstab configuration

# /etc/fstab: Static filesystem mounting configuration
# <file system>                            <mount point>  <type>  <options>                         <dump> <pass>

# Root Filesystem (Ext4, persistent UUID)
UUID=b5e8697b-9516-43b9-bb22-835ec443dbcf  /              ext4    defaults,noatime,errors=remount-ro 0      1

# EFI System Partition (FAT32, persistent UUID)
UUID=7A29-C412                             /boot/efi      vfat    umask=0077,fmask=0077,shortname=winnt 0   2

# User Home Directory (Btrfs subvolume)
UUID=89d21c33-4f32-498c-8c01-f2bc394a819b  /home          btrfs   subvol=@home,compress=zstd,noatime 0      0

# In-Memory Temporary Storage (tmpfs)
tmpfs                                      /tmp           tmpfs   defaults,noatime,mode=1777        0      0

If a filesystem is corrupted and repaired, its UUID may change. The filesystem repair guide covers recovery tools that can rewrite superblock identifiers.

Sources & references

  1. e2label(8) — Linux manual page — documents e2label for displaying or changing ext2/ext3/ext4 volume labels, including the 16-character limit
  2. xfs_admin(8) — Linux manual page — documents xfs_admin for XFS filesystem label management with -L option to set labels and -l to print them
  3. fatlabel(8) — Linux manual page — documents fatlabel for setting MS-DOS/FAT32 filesystem labels, including the 11-byte limit
  4. blkid(8) — Linux manual page — documents blkid for querying block device attributes including LABEL and UUID tokens from filesystem metadata
  5. lsblk(8) — Linux manual page — documents lsblk for listing block devices with filesystem information, supporting lsblk -f for viewing labels and UUIDs

Frequently asked questions

Why should I use UUID instead of /dev/sda in fstab?

Device node paths like /dev/sda are assigned dynamically at boot and can change order when hardware changes. UUIDs are stored in the filesystem superblock and remain constant regardless of bus changes or repartitioning of other disks.

What is the difference between UUID and PARTUUID?

UUID is stored in the filesystem superblock and identifies the filesystem. PARTUUID is stored in the GPT partition table entry and identifies the partition itself. PARTUUID persists even before the filesystem is formatted.

How do I set a label on an Ext4 filesystem?

Use sudo e2label /dev/sdX1 "ROOT_FS" or sudo tune2fs -L "ROOT_FS" /dev/sdX1. Ext2/3/4 labels are limited to 16 characters.

How do I set a label on an XFS filesystem?

Use sudo xfs_admin -L "DATA_POOL" /dev/sdX1 to set the label and sudo xfs_admin -l /dev/sdX1 to view it. XFS labels are limited to 12 characters.

What is PARTLABEL in Linux?

PARTLABEL is a human-readable name stored in the GPT partition table header. You can use it in /etc/fstab with syntax like PARTLABEL=EFI_SYSTEM to identify a partition before a filesystem is created on it.

How do I view filesystem labels and UUIDs?

Use lsblk -f to view all devices with their filesystem labels, UUIDs, and mount points. You can also use blkid to query individual devices.