HOWTO: Formatting and partitioning your external usb hard drive

So, you have just bought a brand new external usb hard drive where you’ll store your backup data. Well, then now the question. How I format my new external usb hard drive using Ubuntu Linux or any tool available in the Linux world? In Ubuntu, there are two tools that aim to format and partition your hard drive which are Gparted and Qparted. Both of them nearly equal, so I’m going to introduce you to Gparted and afterwards DiskDrake

GPARTED

Using Gparted with an installed Ubuntu Os is quite difficult and buggy because your external hard drive must be unmounted and Ubuntu mounts it automatically. The best way to do it is using the Gparted live cd which can be found in:

http://gparted.sourceforge.net/livecd.php

It starts a fluxbox window manager with Gparted launched automatically. Then you can very easily format and partition your external usb hard drive. Your external hard drive will always be in /dev/sdaX.

DISKDRAKE

You can use DiskDrake with another live cd, but in this case a Linux Os live cd such as PCLinuxOS which can be downloaded from:

http://www.pclinuxos.com/news.php

Once you download the image, burn it, and boot from it. Enter the OS with user=root and password=root. It will go into a KDE Desktop. Open the K menu and run the command diskdrake. The DiskDrake partition editor will pop up. Then, there you are. It’s very easy to use. Partition and format your hard drive as you want.

Volume Labels?

With the apps pointed out, you will not be able to add labels (volume), but don’t worry, the linux command line is here to help us. Just once you have formatted your hard drive type:

df -k

and some lines will appear such us:

/dev/sda5 100789972 131232 95538828 1% /media/usbdisk

You see that Ubuntu automatically mounts the formatted harddrive with the generic label usbdisk. But you want an specific name. Then type:

e2label /dev/sda5 nameofthelabel

Once done, unmount the hard drive and plug it in again. Ubuntu will mount automatically the hard drive and a folder with the name of nameoflabel will appear in your desktop. Another issue. Most probably, Ubuntu will mount the hard drive with root permissions. To change the permissions, so you can write in your hard drive change them by writing this:
chown yourusername:yourgroupname /media/nameofthelabel

and all the changes will be remembered for future mounts. Cool!!!

3 Responses to “HOWTO: Formatting and partitioning your external usb hard drive”

  1. george Says:

    diskdrake won’t show my usb drive, wat now?

  2. smauleon Says:

    gparted worked well inside Ubuntu, I just had to unmount the drive (in gparted, right click and unmount. Then you can format the disk).

    But e2label and chown didn’t work. I tried them with sudo.

    Ubuntu mounts the drive in /media/disk, and gives it to ‘user:root’, but I want ‘user:user’. So with the drive unmounted, I created /media/disk and I changed its owner. Then Ubuntu mounted the drive in /media/disk-1!

    At least the drive is usable.

    Good luck Jordi, Salut i força al canut!

  3. smauleon Says:

    Excuse me, maybe e2label didn’t work because I formatted in FAT32, not in a Linux format. I use the drive with windows, too.

Leave a Reply