Geekeries de tout poil

Modifier un nom de partition FAT32 avec Linux et mtools

[en attente de traduction, repompe pure et simple de ]

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:

1) Install mtools:

$sudo apt-get install mtools

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


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

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

Categorised as: Linux


  1. Cassandra dit :

    thanks for a great post and interesting comments. i found this post while surfing the web. thanks for sharing this article.

  2. Andrea dit :