Linux 101 : Why we label a disk or a partition? - e2label, mkfs.ext4, labels, UUIDs -
We also add the partition to our "/etc/fstab" file, so it would be mounted automatically on reboot:
If we add a new drive to our system, or if we remove a drive from our system, the name of the devices and partitions might change.
It might go from "/dev/sdb" to "/dev/sdc", or from "/dev/sdb1" to "/dev/sdb2" for example.
To avoid that issue we use disk labels to name our partitions - disk labels don't change -.
We can create a label for our "/dev/sdb1" partition using the below command:
We can display the UUIDs of our hard drives using the below command:
Comments