This tutorial is about partitioning a USB external hard drive as good for internal drive.

First, list devices on your system using one of the following commands :

1
dmesg

(USB drive should appear as SCSI drive)

1
fdisk -l | grep ‘^Disk’

Now, assuming your new drive is “sdb”, use the following command to invoke the fdisk partition utility :

1
fdisk /dev/sdb

To create a new partition (assuming this is a new unused drive), just type “n“. Then, save your work typing “w” and “q” to exit the utility.

Any doubt or need help about fdisk utility, just type “m“.

Let’s format the partition as traditional EXT3 Linux file system :

1
mkfs.ext3 /dev/sdb1

Okay, the hard disk partitioning and formatting is done now.

Create a directory where you want to have your drive mounted (replace all “external_hd” value with the name you want to use ) :

1
mkdir /mnt/external_hd

Mount the drive :

1
mount /dev/sdb1 /mnt/external_hd

You’re now ready to use it! However, this mount will not survive to a reboot. To make it permanent, you need to edit fstab :

1
vi /etc/fstab

And add the following line :

1
/dev/sdb1               /mnt/external_hd           ext3    defaults        1 2

NOTE : If you manually mount the drive instead doing the fstab way, do not forget to manually unmount it before unplug it! Serious data loss problem may occur if you skip this step!

1
umount /dev/sdb1