How to use the command 'e2label' (with examples)
- Linux
- December 25, 2023
The ’e2label’ command is used to change the label on an ext2/ext3/ext4 filesystem. It allows you to assign a specific name or label to a partition, which can be useful for identification purposes.
Use case 1: Change the volume label on a specific ext partition
Code:
e2label /dev/sda1 "label_name"
Motivation: The motivation for using this example is to easily modify the label of a specific ext partition. By modifying the label, you can quickly identify the purpose or contents of the partition.
Explanation:
e2label
: This is the command itself./dev/sda1
: This is the path to the ext partition that you want to modify."label_name"
: This is the new label that you want to assign to the partition.
Example output:
If you run the command e2label /dev/sda1 "data_partition"
, it will change the label of the partition at /dev/sda1
to “data_partition”.