How To: check and change filesystem label with e2label

Перевод: Проверяем и меняем метки файловых систем с e2label

e2label in EXT e2label with ext2/ext3/ext4 filesystems

Some Linux distros (especially older ones) have preference for using filesystem labels instead of unique identifiers (UUIDs) or device names.

Long time ago there was a post here about using tune2fs for configuring filesystem label, but for ext filesystems (ext2/ext3/ext4) there’s an easier way: use e2label command.

Check ext2/ext3/ext4 Filesystem Label with e2label

Simply run e2label and specify the device name:

root@ubuntu:~ # e2label /dev/sda1

Set Filesystem Label with e2label

If you run the same command and specify the label, it will get assigned to the device:

root@ubuntu:~ # e2label /dev/sda1 rootdisk
root@ubuntu:~ # e2label /dev/sda1
rootdisk

I’ll show how to use filesystem labels in /etc/fstab tomorrow.

See Also

  • tune2fs command
  • Change filesystem label with tune2fs
  • How To: use filesystem labels in /etc/fstab
  • Free up reserved space with tune2fs



Keep Learning

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets