Revision 6 as of 2006-03-08 03:39:01

Clear message

Editing FAT32/NTFS Partition Labels

There are 2 programs you use to label a drive. The program used depends on the partition type.

  • For FAT32 Partitions you use Mtools.

  • For NTFS Partitions you use ntfsprogs.

Instructions for both are given below.

Editing FAT32 Partition Labels using mtools

I wanted to rename the fat32 partitions that get automounted when they are plugged in to the USB drive. Two were exactly similar external hard disk drives, and one was an iPod. The exactly similar hard disk drives (one each at home and work) were both getting mounted at /media/sda1 or sda2 etc, and it was impossible to distinguish one from the other easily. Also, I found that it wasn’t that easy to edit the partition labels for FAT32 partitions. So I thought I would summarize how I named my fat32 partitions to have consistent names. This has the benefit that when these drives are automounted, they will be at the location /media/partition-label, where partition-label is the label that you give the partition.

Step by step instructions to re-label FAT partitions follow:

Instructions:

1) Install mtools:

sudo apt-get install mtools

2) After the usb drive is automounted after plugging in, find out the device descriptor using:

mount

and Note down where it says “sda1″ or similar

3) copy the mtools.conf to ~/.mtoolsrc

cp /etc/mtools.conf ~/.mtoolsrc

4) Edit ~/.mtoolsrc to add one line at the very end:

drive i: file="/dev/sda2"

–you may have to change sda2 to something else depending on what you got in step 2 above.

5) Change to the “drive” i:

mcd i:

6) Check what the label for the drive is currently:

sudo mlabel -s i:

7) Change the label to something pretty:

sudo mlabel i:my-ipod

replace my-ipod with what you would like to name the usb drive

8) Check if the label has changed:

sudo mlabel -s i:

I got the following output – Volume label is MY-IPOD

You’re all set!! The next time that partition gets automounted, it will be at /media/MY-IPOD

Editing NTFS Partition Labels using ntfsprogs

Instructions:

1) Install ntfsprogs:

sudo apt-get install ntfsprogs

2) After the drive is automounted after plugging in, find out the device descriptor using:

mount

and Note down where it says “sda1″ or similar

3) Change the label to something pretty:

sudo ntfslabel /dev/sda1 newlabel

replace newlabel with what you would like to name the usb drive / Harddisk

you may have to unmount the drive for this to work (system-> administration-> disks -> then under partitions for the hard disk hit disable).

3) Check if the label has changed:

Restart your computer to see the label change if your harddrive is internal, and for usb just unplug/plug in USB again


Credits

The information on this page was completely copied from http://ubuntu.wordpress.com/, and i believe it deserves to be in the wiki because the wiki is where i looked when i first had this problem.

CategoryDocumentation CategoryCleanup