Linux Change Disk Label Name on EXT2 / EXT3 / EXT4 File Systems

To change the disk label on an EXT2, EXT3, or EXT4 file system in Linux, you can use the e2label command.

Here’s an example of how to change the label of an EXT4 file system located on the /dev/sda1 device to new_label:

sudo e2label /dev/sda1 new_label

After running this command, you can verify that the label has been changed by using the following command:

sudo e2label /dev/sda1

The output of this command should be the new label, in this case new_label.

Note that changing the label of a file system requires root privileges, so you need to run the e2label command with sudo. Additionally, the label you set must be less than 16 characters long and can only contain letters, numbers, and dashes.

Leave a Comment