Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can set the volume name when I format the partition with the -n option of mkfs.vfat. But how to just change the name without formatting?

I especially want to be able to use lower and uppercase letters. In worst case, I can use a windows tool, but windows by default transforms all letters to uppercase (but works fine with lowercase letters in volumes created with mkfs.vfat).

share|improve this question

Dosfstools, which provides mkfs.vfat and friends, also provides dosfslabel to change the label.

share|improve this answer
I will try this in some days. Do you know if it can save lower-case letters? – Den Jul 30 '12 at 5:51
It didn't work whit lower case letters. And after use, I got errors on the file system.... – Den Sep 20 '12 at 2:48
dosfslabel changed from supporting lower-case labels as of version 3.0.12 to rejecting them in 3.0.16 – D McKeon Jan 9 '14 at 20:11
@DMcKeon: it seems to work in 3.0.27, with a warning. – Craig McQueen Feb 29 at 3:51

Have a look at the ubuntu page about renaming usb drives, it's basically:

mlabel -i <device> ::<label>
share|improve this answer
Thanks! Change the name works, but it is transvormed to upercase: # mlabel -i /dev/sdc1 ::redsd # mlabel -i /dev/sdc1 -s :: Volume label is REDSD – Den Jul 27 '12 at 3:31
@Den FAT disk labels are uppercase only – Matteo Jul 27 '12 at 15:35
@Matteo I have here a HD whit FAT32 which have lower and upper case letters in the name: mlabel -vi /dev/sdb1 -s :: Volume label is miniTR – Den Jul 30 '12 at 5:50
@Den yes FAT32 supports it. It is most likely a FAT16 formatted drive. – Matteo Jul 30 '12 at 7:11
@Matteo Thanks for confirming I'm not completely silly ;-) The device I try to rename is a 15.9 GB FAT32 formated SD card. – Den Aug 17 '12 at 1:39
up vote 1 down vote accepted

So far the only way I found to change FAT volume name whit lower cases is to edit it whit a hex-editor (copy the first few sectors whit dd to a temp file, edit it and copy it back). It works well so far (even whit FAT16) and neither fsck nor CHKDSK from Win7 complained. But no guarantee of course ;-)

share|improve this answer

The solution is to use mkdosfs (mkfs.vfat) : it lets the user specify the volume label using the -n flag, and lowercase letters are kept lowercase, but this tool recreates the filesystem, so all data will be lost.

The non-destructive solution below is a combination of the mlabel and dosfslabel command-line tools.

  1. Connect the device to the computer if not already connected.
  2. Open a terminal window.
  3. Run sudo blkid | grep ' TYPE="vfat"' and
  4. Unmount the device by running umount /dev/sdb1 (substituting /dev/sdb1 with the name of the device found above). If it was mounted, and the unmount failed, then close some windows, kill some programs (e.g. sudo fuser -m /dev/sdb1), and try unmounting again.
  5. Run sudo env MTOOLS_SKIP_CHECK=1 mlabel -i /dev/sdb1 ::x (substituting /dev/sdb1 with the name of the device found above). If the system can't find mlabel, then install it by running sudo apt-get install mtools , and try again.
  6. Run sudo dosfslabel /dev/sdb1 MyLabel (substituting MyLabel with the desired label and /dev/sdb1 with the name of the device found above). Ignore any warnings about boot sector differences. If the system can't find dosfslabel, then install it by running sudo apt-get install dosfstools , and try again.
  7. Run sudo blkid | grep ' TYPE="vfat"' , and examine its output to verify that the label has been changed properly. Optionally, unplug the device, and then plug it back in. The system will recognize it, and mount it under /media/MyLabel, without converting lowercase letters in the volume label to uppercase.

Please note that there is an 11 character limit on the length of a VFAT volume label. If you specify a longer label, it will be truncated. There is another restriction: the label can contain only (some) ASCII characters: accented letters etc. won't work.

share|improve this answer
Thanks for your long answer! Can you explain what the command in 5. is doing exactly? It sets the label to 'x'? – Den Feb 23 at 13:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.