How to format a thumbdrive in Ubuntu

While the Linux OS in general, and Ubuntu in particular, has progressed so much in the user’s desktop (and in my opinion, to the point superior to other competing OSes), there is still room for improvement. I occasionally encountered situations where Ubuntu seemed to be lacking in some fundamental use cases.

Just the other day, I got an IM from someone wanting to know how to format his thumbdrive. This is simple enough in Windows. Right-click on the drive icon, select “Format”. But things are not so rosy in Ubuntu.

I am sure there are commands I could type in the terminal to accomplish this task swiftly. The problem is learning the command itself. It will take too long and I am lazy. So, the simpler way is to use GParted.

Install GParted

sudo apt-get install gparted

Plug in and unmount drive

Plug in the thumbdrive, wait for it to be auto-mounted. Then, right-click on the drive’s icon in the desktop and select unmount. Or you can choose any of the other methods to unmount the drive. Do not unplug the drive after unmounting, else we will be back where we started. :)

Use GParted to format

GParted can be found in:

Panel Menu > System > Administration > Partition Editor

GParted

Use the dropdown box on the top-right to select the drive you wanted to format. Then, right-click on the partition to format, and select “New”. The “Create new Partition” dialogbox will appear. Set your preferred options, click “Add”, then click “Apply”.

On a brighter note, notice that there are many more things you could do here. For instance, you could create more than one partitions on a thumbdrive.

Set a label

One nifty thing you could do in GParted is to change the drive’s label. If you do so, the drive will subsequently be mounted under the label, rather than the default generic “disk”. In other words, if you label the drive “thumbdrive”, it will appear as “thumbdrive” in Nautilus and the desktop, and be mounted under “/media/thumbdrive”.

Unplug and plug the drive

Close GParted, unplug the thumbdrive, and plug it back in. It should now be auto-mounted to the label you have just set.

Change owner to user

One final task. If you format the drive to filesystems such as ext3, you need to set the owner of the drive to your username. Otherwise, it will be owned by root, and you would not be able to write to it as a normal user. To change the owner:

sudo chown user:user /media/thumbdrive

Where, user is your username, and thumbdrive is the disk label you set earlier.

Note: you don’t have to do this for a FAT filesystem.

You might wonder why you would want to format a thumbdrive to something other than FAT32. With FAT32, the drive could be read in a Windows PC.

Personally, I choose ext3 for two reasons. First, the files I copied into it will have it’s permission preserved. The Linux/Unix “ugo” permissions would be lost when you copied a file to a FAT32 drive. Second, FAT32 suffers from the limitation of 4GB maximum file size. You might conceivably want to copy over a file that is larger than 4GB.

Conclusion

So, doing a drive format was simple enough, but it’s not so straightforward. It is easy to do once you know how. But the method is not so easily discoverable as right-click a drive icon and select “Format”.

The point is, while Ubuntu has come a long way, there are some of these common and uncommon use cases that might need to be improved upon.

Post a Comment

Your email is never published nor shared. Required fields are marked *