|
|
Build an External Backup Drive for Linux
Here's a simple and fairly cheap way of building a portable, external backup drive for Linux if you have existing internal hard drives lying around. The whole thing costs about $50 and an hour or two of your time. Let's begin.
Prerequisites
- Any old hard drive - I have a 40Gb hard drive from 2002 which I'll be referring. You can use any hard drive you want as long as it's supported by the external hard drive enclosure (see Venus DS3 below).
- Venus DS3 - This is the external hard drive enclosure brand. It supports USB/firewire. Any brand should suffice as long as it has support for USB/firewire. For more information on this brand, click here. I bought it at Newegg.com. It also supports SATA drives and drives up to 750Gb in size.

The really nice thing about this brand is that it has a fan to cool the hard drive, and it is very quiet. The picture below is the removable component inside of the enclosure case.

- A USB cable - Since I set this up using USB, we'll refer to it. For the Venus DS3, a USB cable was provided like the picture below.

- A small phillips screwdriver - Self exaplanatory
- You must have root access to your system.
Steps to Setup the Unit as a Hard Drive
- First, read the directions provided with the unit as to how to install the hard drive into the enclosure. It's actually very straight-forward.
- There's a power switch on the back of the enclosure on the left. Keep it off (the 0 side is pressed down). The middle button is for the USB connection. The hole on the right is for the power cord.

- Insert the hard. You may have to adjust the four-prong plug on the left depending on how old your hard drive is.

The connected drive looks like this:

- Connect the power supply to the enclosure.
- Press the 1-0 button down (button on the left, see pic above) to the 1 position on the enclosure to turn on the unit.
- Plug in the USB cable to the computer.
- Your computer should recognize the drive right away. On Suse machines, a pop-up box will ask you if you would like to open the drive. Choose cancel.
- Next, identify the block device of the drive. On my machine, the enclosure is recognized as a SCSI device (although it's not a SCSI drive). Thus, it is on /dev/sda. The easiest way to identify the block device is to look in /var/log/messages (or other log that contains kernel messages).
- We'll assume the block device is on /dev/sda. Use the following command to look at the drive.
fdisk /dev/sda - The information provided may or may not be for Linux. In fact, and more than likely, the drive is setup for Windows and may have multiple partitions.
- Next, we'll remove all information on the hard drive and create only one, new Linux partition. You need to be sure you want the drive erased because there will be no way to recover anything (unless you're a forensics expert).
- From the fdisk menu, choose 'p' to view the partition tables. You should see at least one partition table. To delete a partition, choose 'd'. If you have more than one partition, it will additionally ask you which partition number to delete. Repeat until all partitions are deleted.
- Add a new partition by choosing 'n'. It will then ask if you want an extended or a primary partition. Choose 'p' for primary partition. Next, choose '1' for the Partition number. For the first and last cylinder, I wanted to use the entire drive. Thus, I went with the defaults by just hitting return after each of those questions. An example is below.
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-38166, default 1): Hit Enter
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-38166, default 38166): Hit Enter
Using default value 38166
Command (m for help): - You will need to make sure the partition is a Linux partition. Choose 'p' and ensure Id = 83 and System = Linux. If not, choose 't' to change a partition's Id. Then type '83'.
- Finally, write the new information to the hard drive by choosing 'w'.
Setup the Backup Drive
- I had a little trouble at this point in which I had to unplug the usb from the computer a few times before the operating system recognized it as /dev/sda1.
- The newly created partition must be formatted as a Linux filesystem type (although a Windows FAT type would work - highly discouraged, though). I chose ext3. You can choose anything you want (ext2, reiserfs, jfs, etc.).
- To format as ext3, do the following:
mkfs.ext3 -b 1024 -i 1024 -L Backup /dev/sda1 -b 1024 - Block size of 1024 bytes - Best for systems with a lot of small files. Other possible choices are 2048 and 4096.
-i 1024 - Inode size of 1024 bytes - I just chose this to equal the block size. Other possible choices are 128, 256, and 512.
-L Backup - The hard drive label name which I called "Backup".
- Formatting took about 30 minutes on this 40Gb hard drive.
- Once formatting is complete, you can now mount the drive.
- Create a mount point. Any name will suffice.
mkdir /mnt/backup - Mount the drive.
mount -t auto /dev/sda1 /mnt/backup - You're now able to read and write to your new backup drive!
- Once you're satisfied with the setup, you can put the internal portion of the Venus DS3 into the enclosure case. Use the phillips screw driver to secure things in place.
If you find any errors or inconsistencies, please let me know by adding a comment. I hope this helps anyone trying to make a backup drive from old hard disks!
|
There are currently 0 users and 2 guests online.
|