PDA

View Full Version : [ubuntu] Change volume label in fat32 partition



adit
October 22nd, 2010, 11:56 AM
I have a partition in hard disk drive (/dev/sda4) formatted with fat32. Current volume label is "MYNAME". I want to change it to "MyName"

Paqman
October 22nd, 2010, 12:04 PM
There may be an easier way, but I know Gparted can change the label on a volume. It's in the repos, and comes preinstalled on the LiveCD.

adit
October 22nd, 2010, 12:29 PM
I tried it under windows vista.
And also tried the following command.

:~$ sudo mlabel -i /dev/sda4 ::
Volume label is MYNAME
Enter the new volume label : MyName
No use.
In the sidepane "Places" in nautilus it is shown as MYNAME

adit
October 22nd, 2010, 12:32 PM
Tried to rename with gparted also. Same problem

yetiman64
October 22nd, 2010, 12:32 PM
Try and do a logout and then log back in. I have noticed on occasion that labels won't change in the places menu and nautilus sidepane until you do so.

ironic.demise
October 22nd, 2010, 12:33 PM
System > Administration > Disk utility.
Find you're disk drive (sda, should be described as something like 500gb disk)
click it
In the window with the disk drive details click the volume you want to change (sda4, should have MYNAME written on it, it's the long bar that names all volumes, just click yours)

then click "edit filesystem label"
and type what you want.

adit
October 22nd, 2010, 12:40 PM
In response to post#6
That also done. Same problem. The volume label does not accept lower case letters at all.
Now I have a doubt. Is fat32 filesystem case insensitive when labelling the volumes?

plucky
October 22nd, 2010, 02:19 PM
In response to post#6
That also done. Same problem. The volume label does not accept lower case letters at all.
Now I have a doubt. Is fat32 filesystem case insensitive when labelling the volumes?

My USB stick is FAT32 and the Label has upper and lowercase letters.

Do you have it mounted in /etc/fstab file with the label specified?

ironic.demise
October 22nd, 2010, 02:26 PM
His problem may also be an autorun.inf setting.
on the root of the stick check the autorun.inf for a line "LABEL=MYNAME"

adit
October 24th, 2010, 11:26 AM
I solved the problem by
1) Back up the partition
2) Delete the partition
3) Create filesystem

sudo mkfs.msdos -n MyName /dev/sda4
4) Finally restore from the backup
It is a 30 GB partition. The entire process took 2 hours.
As far as known to me there are no tools (either in unix or in windows) to change the volume label of fat32 partition in a case sensitive manner.

coffeecat
October 24th, 2010, 11:55 AM
As far as known to me there are no tools (either in unix or in windows) to change the volume label of fat32 partition in a case sensitive manner.

Theoretically, you can't but Acronis Disk Director in Windows somehow manages to get lower-case letters onto FAT32 partition labels. Which may be of little use to you.

Frustratingly, I'm sure I've done it in Ubuntu, somewhat by accident, but I can't remember how. I just tried in Maverick's Gparted and that didn't work.

coffeecat
October 24th, 2010, 12:05 PM
I solved the problem by
1) Back up the partition
2) Delete the partition
3) Create filesystem

sudo mkfs.msdos -n MyName /dev/sda44) Finally restore from the backup
It is a 30 GB partition. The entire process took 2 hours.

I've discovered how I did it in the GUI. Rather than simply trying to label the FAT32 partition in Gparted, use Gparted to create a new partition table on the drive first. Then create a FAT32 partition. Then label it. The proof is in my screenshot.

Of course, you'll still have a several-hour backup and restore to contend with if there's data to preserve.

HermanAB
October 24th, 2010, 12:22 PM
DOS volume labels (and a few other things in DOS and Windows) are upper case only.

adit
October 24th, 2010, 12:31 PM
DOS volume labels (and a few other things in DOS and Windows) are upper case only
When I create filesystem with

mkfs.msdos -n MiXedCaSe /dev/sda4
the case is preserved whether I access the filesystem from unix or windows.

tajiknomi
October 24th, 2010, 01:07 PM
Note that while labeling your disk...U should Unmount it first....(using-GPARTED)

Vishal Agarwal
October 24th, 2010, 01:11 PM
If you have the window/Dos installed then u can use "label" command through command prompt.

cjv8888
October 24th, 2010, 01:19 PM
Try the instructions here:

https://help.ubuntu.com/community/RenameUSBDrive

which includes renaming FAT32 drives.

kazimof
December 3rd, 2010, 01:34 AM
gparted worked for me by dismounting the FAT32 USB stick and running it as superuser thus:


sudo gparted

MestreLion
December 28th, 2010, 05:57 AM
I stumbled upon this issue when Ubuntu suddenly stopped automounting my USB on /media/<label> and started mounting on /media/<UUID> instead, apperentely for no reason. Nautilius showed the partition as "16GB Filesystem" instead of using the label, as if there was none.

I cleared and re-set the label on gparted, it worked, monting and nautilus were back to /media/label, but now trapped in that annoying uppercase issue.

Somehow, trying some commands, i was able to restore the proper case without deleting and re-creating the partition, thus preserving all the data. No need to back and restore :D

Here how i did:
- clear the label (may use gparted for this)
- set it using either dosfslabel or mlabel (or both, not sure which actually fixed it)

To check:


sudo dosfslabel <device>
sudo mlabel -i <device> -s ::
sudo blkid
To set:


sudo dosfslabel <device> <label>
sudo mlabel -i <device> ::<label>
Warning: after fiddling with these commands, filesystem always got corrupted. Heres how i fixed it:



sudo fsck <device> -r
Hope this helps!

Troop116rules
August 30th, 2012, 03:39 AM
i was able to restore the proper case without deleting and re-creating the partition, thus preserving all the data. No need to back and restore :D

Here how i did:
- clear the label (may use gparted for this)
- set it using either dosfslabel or mlabel (or both, not sure which actually fixed it)

To set:


sudo dosfslabel <device> <label>


I am sorry for reviving the topic, but I wanted to assess MestreLion's confusion on what command to set the label.

All I did, after clearing the label in GParted (which is done by setting the label to null, that is, no characters at all. GParted handles this as clearing the label.), is run this:

sudo dosfslabel <device> <label>
This set the correct label with lowercase letters. It seems FAT labels cannot be 'changed' without forcing uppercase letters. But GParted can do more than change. It can reset/clear the entire label, thus allowing dosfslabel to set the label to the wanted text.

Note: Don't use GParted to add the label after clearing. GParted uses mlabel by default to set the label, which I've seen have issues setting labels with lowercase letters on existing partitions.