How do I rename a USB drive?

129,411

Solution 1

First, obtain the location of your USB drive:

sudo fdisk -l

Assuming that your device location is /dev/sdb1/:

You can safely check the current label without any side effects by issuing the following command:

sudo file /dev/sdb1 -s

Most USB sticks are formatted using FAT16/FAT32. To change the label via the prompt, use the mlabel command. The label of a FAT filesystem requires to be exactely 11 characters. No more, no less. When characters are omitted, spaces are added at the beginning, and seemingly random characters are appended at the end.

Install the mtools package (GNU Tools for MSDOS filesystems):

sudo apt-get install mtools

Then you might need to configure the mtools drives settings, hence add the following two lines to /etc/mtools.conf (you will need sudo to edit)

# second and third drives, first partition
drive u: file="/dev/sdb1"
drive v: file="/dev/sdc1"

Having saved, you should then be able to look at your USB drive in (say) /dev/sdb1 as drive u:

sudo mtools -v u:

(See comments ....) Then relabel:

sudo mlabel -i /dev/sdb1 -s ::"LABEL HERE "

For other filesystems (rarely used for USB sticks), see this page.

Solution 2

  1. Open "Disks" application
  2. Select the flash drive in the panel on the left
  3. Press the Unmount button (should look like a "stop button")
  4. Click on the gears icon ("More actions") and choose "Edit filesystem"

Solution 3

None of the given answers worked for me on my 14.10 system. I used gparted as described in https://help.ubuntu.com/community/RenameUSBDrive.

  1. sudo apt-get install gparted
  2. open gparted
  3. choose the thumbdrive from the dropdown in the top-right corner
  4. unmount the volume (right-click on drive)
  5. right click and choose "label"
  6. click on green tick to apply changes

Solution 4

Right click on the drive you want to edit to bring up the properties window. Then the name will be highlighted by default. Just type your name and click enter.

Share:
129,411

Related videos on Youtube

Theo Carper
Author by

Theo Carper

Phillies, Flyers, Eagles, Tech & video game junkie.

Updated on September 18, 2022

Comments

  • Theo Carper
    Theo Carper over 1 year

    How exactly would I rename a USB drive?

    I've read that you can go into the Disk Utility, click on Edit Partition, and there is an option to rename the label but I can't click in the area to rename.

    Is there any other way?

  • Theo Carper
    Theo Carper about 12 years
    I also found when using the Disk Utility, I had to unmount the volume before it would allow me to rename the label.
  • guettli
    guettli over 9 years
    Please tell me in which application I should do the right click. Thank you
  • Alastair Hodgson
    Alastair Hodgson over 7 years
    What is the unmount volume button? The buttons don't seem to have tooltips -_-
  • gerlos
    gerlos over 7 years
    On Ubuntu 16.04 you find the unmount button on the right side panel, after you select your flash drive, below the list of volumes. It should look like a square (like a "stop button"), and when you click it it will change in a triangle (like a "play button"). To change the flash drive label click on the gears icon and then on "edit file system".
  • Nell
    Nell over 7 years
    None of the other solutions worked. This is the best way to do it. I would add another step: 6. Click on the green tick to accept the label change.
  • Krieger
    Krieger about 7 years
    Just a heads up - You may have to do sudo nano ~/.mtoolsrc, then add "mtools_skip_check=1" to the file and save it in order to change the label of your USB.
  • moooeeeep
    moooeeeep over 6 years
    The executable is called disks. It can be run via ALT+F2
  • Mac Shout
    Mac Shout almost 6 years
    Additional comment on the gparted solution above ... I am using gparted version 0.25.0 which requires you to explicitly apply operations, so after typing the new label I had to [Edit || Apply All Operations], or Ctrl-Enter for the KB shortcut. Even at that, the 'mount' option was not enabled, but quitting gparted made the volume mount and appear again in the file browser.
  • wjandrea
    wjandrea almost 6 years
    The executable is called gnome-disks on Ubuntu 14.04 and later.
  • MikeW
    MikeW about 5 years
    I presume they mean when the USB drive appears as an icon on the desktop. This implies use of GUI !
  • MikeW
    MikeW about 5 years
    I presume they mean when the USB drive appears as an icon on the desktop. This implies use of GUI !
  • MikeW
    MikeW about 5 years
    Just to restate, the skip-check setting is probably required ....
  • artu-hnrq
    artu-hnrq over 4 years
    In 18.04 Bionic Beaver LTS, it isn't allowed while the device is active. And if you eject it Nautilus don't show it anymore
  • ViaTech
    ViaTech over 3 years
    I had to reformat using this util in order to successfully change the name
  • KTibow
    KTibow over 3 years
    Might not be supported if it's ext4
  • Brian Leach
    Brian Leach about 2 years
    In the UI, make sure the active partition is selected. Otherwise, the unmount (stop) button isn't present. If just the free space is selected, that unmount option is not available / is invisible.