Tag Archives: flash drive

Ubuntu 12.04: How to Format a USB Flash Drive CodeUnit 22 JUN 2012

If you are a Microsoft Windows user then no doubt you’ll be quite familiar with the concept of right-clicking on a USB flash drive icon under My Computer, selecting the context menu option ‘Format’, and then formatting your flash drive so that it is nice and sparkly empty. Unfortunately for us though, that tried and tested method isn’t quite supported under Ubuntu Desktop.

Using Ubuntu 12.04, this is one of the ways in which you can however format your USB flash drive. First, plug your USB stick in and wait for it to mount. Then open the Ubuntu Unity dashboard and type in “Disk Utility”.

Launch the resulting application and select your USB flash drive which should be listed in the left hand side device list. Scroll down the resulting page until the ‘Format Volume’ button becomes visible.

Click on this button, select the file system you want to use (9 out of 10 times, stick with FAT as this is supported by the widest range of devices) and hit the Format button.

Finally, marvel at how the application merrily discards all data currently on your USB flash drive before returning control of it to you, all sparkly empty.

Ubuntu Server: How to Mount a USB flashdrive from a Terminal Tips, Tricks and Tutorials 15 APR 2011

By default, an Ubuntu server installation does not auto mount USB flashdrives that are plugged into it. Thankfully though, doing this yourself is not particularly difficult.

Plug your USB thumb drive into the machine and run:

sudo fdisk -l

This displays a list of devices currently detected. Locate your device in the list – it will probably be something like /dev/sdb1

Now we need to create a mount point for the device. It makes sense to create it in the /media folder, so run:

sudo mkdir /media/external

In the above example we have decided to name the mount point external. You can name it anything you want, but avoid using spaces for multiple words – rather join multiple words with an underscore _ character.

Now to actually mount the drive. If the device is FAT16 or FAT32 (which most USB drives are), run:

sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=100,utf8,dmask=027,fmask=137

If however you are plugging in a NTFS external hard drive, you would run:

sudo mount -t ntfs-3g /dev/sdb1 /media/external

Done. You can now access the contents on the USB flashdrive by accessing /media/external.

When you finish using the drive, it is critical to unmount it before removing – this will prevent corrupt data and drive failures. To unmount:

sudo umount /media/external

Nifty.

Failed Flash & Missing Backups CodeUnit 03 MAY 2010

Sigh. After years of solid and faithful service, despite the lack of care, my Transcend JetFlash 4 GB USB flash drive finally borked and said it’s last goodbyes. But it didn’t go quietly into the night.

No, it kicked and screamed, corrupted and declared itself write-protected. I spent hours combing the Internet, trying out various solutions, tricks and suggestions, none of which worked and none of which could get the drive back into working, usable condition.

From low-level formats to registry hacks and just plain begging and pleading, all was for naught as I finally came to the conclusion that it was dead and dusted, leaving me only with one recourse – to open it up and operate on it in the hopes of a miracle happening.

Unfortunately that was not to be as my clumsy hands sliced the top of a connector clean off its housing and brought with it the finality of the waste bin.

But losing a faithful flash drive was not the worst part of this ordeal. No, the worst part was that I, a software technician of all people, had failed myself in that I didn’t keep any backups of the important data on the drive. Not a single backup whatsoever. Important personal documents, desktop application projects in mid development, databases built up over years, all gone because I was too lazy to keep up a decent backup programme.

But the loss now behind me, I have vowed to change my ways and send out this warning to those of you out there like me – backup your data, synchronize your drives, don’t fall in complacency.

Even if it is just by using the simplicity of rsync or its’ graphical counterpart, grsync, schedule your backups and stick to it – or as I have now done, place a perpetual reminder in your calendar and stick to it.

For you never know when the blight that is drive failure will strike again…