-   Linux - General (
-   -   How to change "volume label" of the USB drives? (

kaz2100 10-26-2007 04:14 PM

How to change "volume label" of the USB drives?

Question is:
How to change "volume label" on the drives connected through USB? - USB memory stick, external hard drive (ext3), ...

Reason is:
Volume without label is recognized as generic name by udev. This is confusing every once in a while. So I want specific name to each USB stick, external drive...

I know how to set it, using mkfs. (for ext3 mkfs.ext3 -L labelName, for vfat mkfs.vfat -n volumeName) But doing so, drive is initialized.
I tried "mlabel" but does not work well.

For some reason, web search gives me only mlabel.

Is there any way to keep content and change "volume label" ?

I appreciate any suggestion.

Happy Penguins!

jschiwal 10-26-2007 05:40 PM

I use "mlabel" to do it. You probably need to edit /etc/mtools.conf to be able to assign a dos device name to the pen drive.

Here is an excerpt from a previous message I posted:

Install the "mtools" package if you have it. This package supplies the "mlabel" package. Add the following line to
drive p: file="/dev/sdb1". The p: device name is arbitrary. The default config will cover your floppy drives, but adding such a line will probably be needed to assign a dos type device name to a linux device. The /etc/mtools.conf file is well commented with plenty of commented out examples.

Use the appropriate value for the device, either /dev/sda1 or /dev/sdb1 in your case.
Now you can use mlabel to relabel the drive like this:
mlabel p:label

Hendronicus 10-26-2007 08:44 PM

I'd use e2label, like this: e2label device newlabel

kaz2100 10-31-2007 04:02 PM


Thanks, both tricks do.

Also I found that tune2fs can change label.

Happy Penguins!

andrew.46 12-07-2008 02:55 AM



Originally Posted by jschiwal (Post 2938160)
I use "mlabel" to do it. You probably need to edit /etc/mtools.conf to be able to assign a dos device name to the pen drive.

Thanks for giving me the solution to a problem I wrestled with for about 2 hours :-). I was trying to alter a FAT32 external HDD so of course only mlabel was suitable.


sswam 07-10-2012 08:44 AM

ridiculous, wrapper script
That's ridiculous, so I wrote a wrapper script:

LxQ 08-29-2012 09:39 AM

Label USB device via GUI
In GPARTED right click on entry. There's an option to label......

dax5 09-09-2013 03:07 PM

Disk Utility can also be used
To avoid installing anything and messing with mtools I have just used Disk Utility (it seems installed automatically in Ubuntu 12.4).

All times are GMT -5. The time now is 03:51 PM.