Renaming USB Drive Labels in Linux
Rename your usb drive in linux
Rename your usb drive in linux

There, you got all the inspirations from the web and your friends and have now Linux proudly running on your system. (Linux is the kernel, ya ya I know you got it). Your friend approaches you to help him get rid of the virus in his USB drive. And you are proud you are of help in terminating viruses with ease, thanks to Linux’s security. And he asks you to do a favour. To rename the USB drive label to his name, from the name “disk”.

You try to rename it from the terminal, but it fails. (Yes, command mv doesn’t work here.)

You open /media, right click on the USB Drive folder and go to Properties. But you find no option there either to change the drive Label! (Am talking with respect to Ubuntu. It’s great if other distros have it).

Did your new Linux system fail you? In Windows, you can rename Labels of USB’s just by visiting its Properties. Can’t Linux do even this simple thing!

Let me assure you that, you can, but in a slightly round about way.

From Terminal

You will be using the mlabel command.

1. First type the mount command to find out the device location of you pen drive. Find the line which goes like “/dev/sdc1 on /media/disk …”.

2. This means the device sdc1 which is my pen drive is mounted on /media/disk.

3. Next unmount the device.

sudo unmount /media/disk

4. Next use this command.

sudo mlabel -i /dev/sdc1 ::<new_label>

If you get a message like:
Total number of sectors (7831520) not a multiple of sectors per track (63)!
You can easily ignore the check by running this command:

echo mtools_skip_check=1 >> ~/.mtoolsrc

Try again and it should work.

5. The name of the USB should have changed. Unplug and Plug the pen drive back in and it will be mounted with the new label name.

The GUI way

1. For this you need the Gparted software. Install it if you don’t have it already.

2. Open the software as a super user, and select the pen drive from GParted>Devices>

3. Unmount the device if it hasn’t been, by right clicking on it.

4. After unmounting, right click on it and select “Label” and change it to whatever you want it to be. And then Apply it, by clicking the Edit>Apply All Operations.

5. Your pendrives label should be changed now.

Yes, it is a pretty around the way method. But unfortunately, nautilus doesn’t currently support partition renaming. Hope it’s there in Karmic Koala!

17 thoughts on “Renaming USB Drive Labels in Linux

  • March 5, 2013 at 9:46 am
    Permalink

    This was helpful, but, as others have noted above. the command

    sudo mlabel -i /dev/sdc1 ::

    fails under Ubuntu 12.10. Removing the “-i” worked. It would be good to update the page to reflect this.

    Reply
  • October 14, 2012 at 12:23 am
    Permalink

    the mlabel i have doesnt have the -i, i see only [-vcsn] in the man page

    Reply
  • August 12, 2012 at 7:58 pm
    Permalink

    another easy way
    I also found when using the Disk Utility, I had to unmount the volume before it would allow me to rename the label
    thanks

    Reply
  • August 7, 2012 at 3:50 pm
    Permalink

    very nice..thanku..I changed the label in Gparted..It worked

    Reply
  • October 13, 2011 at 5:20 am
    Permalink

    Thanks Gparted instructions helped me…

    Reply
  • October 3, 2011 at 3:11 am
    Permalink

    Thanks, worked perfectly in CentOS 5.7

    Reply
  • June 23, 2011 at 11:41 am
    Permalink

    thnx! GParted did the trick for me 🙂

    Reply
  • June 6, 2011 at 10:42 pm
    Permalink

    Thanks for a great how-to. I believe the mlabel command may have changed under 10.04, as I couldn’t get it to work from the command line. However the gparted GUI option worked like a charm. Simply run System -> Administration -> Disk Utility, click on the iPod, make sure it’s unmounted (if not, you can unmount it with the GUI), and then click the button that allows you to edit the volume label. Simple and effective. Thanks for pointing this out!

    Reply
  • March 23, 2011 at 3:33 pm
    Permalink

    Thanks! The mlabel trick worked on MEPIS 8.5. The only thing to note is that the label will only be in upper case (all caps) even if you use lower case in the mlabel command.
    Cheers

    Reply
  • September 13, 2010 at 2:51 pm
    Permalink

    The GUI way worked! Although with few adjustments. Thanks a lot ya.

    Ah but I did not read sohlside’s comment on umount thingy.

    Reply
  • February 12, 2010 at 3:57 pm
    Permalink

    Excellent! Thank you.

    Reply
  • February 4, 2010 at 12:14 am
    Permalink

    Same here. Wish the author (or a commenter) would suggest an alternative.

    Reply
  • January 3, 2010 at 8:44 am
    Permalink

    Thanks for the article. One small tip for readers though, with sincere courtesy and respect intended, the unmount command is “umount” not “unmount”.
    Thanks for this. This method is less risky than doing it in gparted IMO.

    Reply
  • November 15, 2009 at 6:06 pm
    Permalink

    using ubuntu 8.04

    mlabel command was not recognised
    in gparted, there is no ‘label’ option

    thus for me this didn’t work at all

    Reply
    • August 18, 2012 at 2:44 pm
      Permalink

      You’ve just got to install the package mtools in advance – this package will install mlabel on your system.

      Reply
  • October 2, 2009 at 5:36 am
    Permalink

    huh thats good to know nice work!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.