Linux – Renaming a volume under Linux

formattinglinuxpartitioning

It may be a very basic question, but I have USB devices that keep their old name after reformating it with mkfs and even after a repartitioning with fdisk.

I wonder if there is a way to change the disk label with simple basic tools (note that, I do not want to use the mtools as answered here).

Best Answer

It is depends on which file system is in the partition.

If the fs is ext2/ext3/ext4, e2label should work:

e2label  /dev/sda5 my_label

If that is NTFS, choose ntfslabel:

ntfslabel  /dev/sda9  my_label

If that is FAT, choose mtools that is what you already got:

mlabel -i /dev/sda4 ::my_label
Related Question