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!!!

Advertisements

About jordilin

I'm a Senior Software Engineer with an MSc in Telecommunications Engineering. I've got a range of interests including Linux, a very powerful and limitless operating system, travelling, gastronomy and technology.
This entry was posted in HOWTOs. Bookmark the permalink.

7 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.

  4. Boyan says:

    I was able to format an external USB hard drive using GParted. I also changed the label, no issues there… I’m with Ubuntu 9.10

  5. Edmond Condillac says:

    It would be most appreciated if you would kindly advise about formatting and partitioning an external usb hard drive of capacity 500GB. It already has 3 partitions of 25 to 30 GB each with data files, which were written before the PC’s Windows XP operating system had crashed. It was then changed to Ubuntu 11.04. Thanks for your kind consideration.

    • jordilin says:

      You can still use GParted. If you have a mix of operating systems (Windows, Linux, etc…) I would use FAT32 or NTFS for compatibility. Linux can read them, but Windows cannot read ext3, ext4 as far as I know. FAT32 might be the most portable as it can be read by most operating systems out there.

  6. Christel says:

    Tag Heuer: These are the ultimate luxury sports watches.

    Rich people are rich because they know the true value of money and hence
    they manage their business. Buyers have got a lot of options through which
    they have to choose and they can get a general understanding as to how they have to match
    their watch shape to the wrist size they have and it should also be done according to
    the length of the hand and its size.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s