Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
33
rated 0 times [  33] [ 0]  / answers: 1 / hits: 142775  / 2 Years ago, mon, december 13, 2021, 12:14:52

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?


More From » usb-drive

 Answers
5

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.


[#40416] Wednesday, December 15, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
itagde

Total Points: 241
Total Questions: 113
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
2 Years ago
itagde questions
Thu, Jun 10, 21, 21:24, 3 Years ago
Sat, Aug 13, 22, 22:41, 2 Years ago
Thu, May 20, 21, 11:52, 3 Years ago
Tue, Aug 23, 22, 06:19, 2 Years ago
;