LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

e2label

change ext filesystem labels

TLDR

Display the current volume label
$ sudo e2label [/dev/sda1]
copy
Change volume label
$ sudo e2label [/dev/sda1] "[label_name]"
copy
Clear the volume label
$ sudo e2label [/dev/sda1] ""
copy

SYNOPSIS

e2label device [new-label]

DESCRIPTION

e2label changes or displays the filesystem label on an ext2/ext3/ext4 filesystem. Labels provide human-readable names for filesystems and can be used to mount filesystems by label instead of device name, which improves portability when device names change.If no label is specified, the current label is displayed. Labels are particularly useful in /etc/fstab entries, making system configuration more resilient to device renaming after hardware changes.

PARAMETERS

device

The filesystem device
new-label
New label (max 16 characters)

INSTALL

sudo apt install e2fsprogs
copy
sudo dnf install e2fsprogs
copy
sudo pacman -S e2fsprogs
copy
sudo apk add e2fsprogs-extra
copy
sudo zypper install e2fsprogs
copy
brew install e2fsprogs
copy
nix profile install nixpkgs#e2fsprogs
copy

CAVEATS

Labels are limited to 16 characters and are silently truncated if longer. e2label is a thin wrapper around tune2fs -L, so the two are interchangeable. The filesystem may be mounted while the label is changed, but the new label is only picked up by udev and /dev/disk/by-label after the next scan. Part of the e2fsprogs package.

SEE ALSO

tune2fs(8), blkid(8), mount(8), e2undo(8)

RESOURCES

Copied to clipboard
Kai