31 July 2008

Installing a USB disk drive on Linux is easy

I did not appreciate how easy it was to add a new USB disk drive to a Linux system.

I only needed temproary access to the disk drive on a Linux system so that I could format the disk as a Linux partition.

The steps were:

  1. Plug the USB disk drive (a Western Digital My Book Office Edition External Hard Drives 500 GB, USB 2.0, Remote Access WDH1B5000N)
  2. As root (su command)
    1. cd /mnt
    2. mkdir usb_disk
    3. mount /dev/sda1 usb_disk
    4. /sbin/fdisk /dev/sda
      1. p (to show and verify the partions)
      2. Changed the required partition to have an id of 83 - Linux partition
      3. w (to write table to disk and exit)
    5. umount /dev/sda1
    6. /sbin/mkfs.ext2 /dev/sda1 (being a 500 GBytes disk, this took around 3 hours)
    7. mount /dev/sda1 usb_disk
  3. Copy the files to the USB disk

It really was as easy as that. Considering that the version of Linux (Red Hat Linux release 7.2 Enigma ) was over 7 years old and it was running on a Pentium processor (not even a Pentium 2), that is very impressive!