Wednesday, April 14, 2010

Renaming FAT32 and NTFS filesystems

Previous: Installing Gwibber

I wanted to rename my Western Digital My Book volumes, because they are all named "My Book." It would be too easy to make a mistake and format the wrong volume or restore from the wrong backup. From community help at https://help.ubuntu.com/community/RenameUSBDrive, I learned that gparted can rename an NTFS filesystem without reformatting it.

To install gparted, I opened a Terminal and ran
sudo apt-get install gparted
sudo apt-get install mtools
sudo apt-get install ntfsprogs
Gparted is the partition management utility, mtools is a package of utilities for working with FAT filesystems, and ntfsprogs is a package of utilities for working with NTFS filesystems.

Running gparted as root (that is, sudo gparted), I saw the partitions on my internal drive but none of the external drives. There's a Devices drop-down in the GParted menu, and there I found three devices /dev/sda, sdb, and sdc. I identified the volume I wanted to rename, right-clicked on it and chose unmount. This ran for a long, long time. I checked using Nautilus and the drive was not mounted. I cancelled gparted and started it up again, to see if it would let me try the rename operation. It just kept searching and searching and searching for partitions on /dev/sbc.

I disconnected the external drive, killed gparted, and started it again. This time it immediately displayed the list of partitions on the internal drive. I shut down gparted, then reconnected the external drive. After it automounted, I unmounted it using Nautilus, but left it physically connected. Once again, gparted just looped, ostensibly searching for partitions on the device.

A FAT32 filesystem



So, gparted did not work. I tried the command-line approach outlined on the community help page cited above. I connected the external drive and waited for it to automount. Then I ran
mount
to see the mounted filesystems and found where the external drive was mounted. In this case, it was /dev/sdc1. I unmounted it with
sudo umount /dev/sdc1
Then I verified it was the volume I wanted with
sudo mlabel -i /dev/sdc1 -s ::
Finally, I changed the volume label with
sudo mlabel -i /dev/sdc1 ::500GB_FAT32_external
I mounted the volume and it worked fine.

An NTFS filesystem



Followed a similar procedure to relabel an NTFS volume. Connected it, waited for it to automount, and unmounted it with
sudo umount /dev/sdb1
Checked the current label with
sudo ntfslabel /dev/sdb1
Changed the label with
sudo ntfslabel /dev/sdb1 1TB_NTFS_external
Checked to be sure I had changed the label correctly, then re-mounted the volume. Worked great!

Next: Using rsync for backups

1 comment: