Setting Linux Partition Labels
When choosing labels, use meaningful names that are easy to remember. They are case sensitive and can be a maximum of 16 bytes in length. For grub2 search to work properly, labels must not contain embedded spaces.
Most recent Linux distributions including Ubuntu, Suse and Fedora use the ext4 filesystem by default for their root partitions. You can set the label for the root partition using the e2label command.
This must be done from within a Linux system. The gparted utility is available for all popular distributions and makes it easy to obtain information about your disks and partitions. You can also use gparted to set the label for your Linux swap partition.
gpartd can't set the label for the currently mounted Linux root partition, but it can be used to obtain the physical address needed below.
This example assumes the Linux root partition is on drive 0, partition 3.
Using gpartd we find that the physical address of the partition is /dev/sda3.
For Linux ext4 filesystems:
From a Linux command line enter:
sudo e2label /dev/sda3
The current disk label, if any, for that partition will be displayed.
Entering:
sudo e2label /dev/sda3 ubuntu-16.10
Will set the disk label to ubuntu-16.10
Note: If you a using the newer Btrfs filesystem, use the following command to set the partition label.
sudo btrfs filesystem label /dev/sda3 ubuntu-16.10
Setting Labels For Other Operating Systems
To set a label on a fat or NTFS filesystem from within Microsoft Windows, go to My Computer, right-click on the drive and click Properties to label the partition.
From within Mac OS-X you can use Finder and right-click on the drive. Then click Get Info to set the label.
Created with the Personal Edition of HelpNDoc: Create cross-platform Qt Help files