We add a partition "/dev/sdb1" for example to our system, and we set an "ext4" filesystem on it using the mkfs.ext4 command:
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: