Adding an extra Hard Drive
After installing Clark Connect and the admin tools PuTTY and WinSCP
on your windows PC system,
it's time to install
the main file storage hard drive.
(I didn't connect this for the initial C-C install as I wanted to manually format
it and wasn't confident in doing
a manual partition of the entire operating system)
When you connect a
hard drive into a Linux system the device is given a specific location, with
IDE/PATA hard drives:
/dev/hda = primary / master
/dev/hdb = primary / slave
/dev/hdc = secondary / master
/dev/hdd = secondary / slave
... and with SATA hard drives:
/dev/sda = 1st SATA drive
/dev/sdb = 2nd SATA drive
/dev/sdc = 3rd SATA drive
/dev/sdd = 4th SATA drive
As I have connected my 500GB SATA hard drive to the first SATA port on the motherboard my device location is /dev/sda - obviously adjust the following commands to suit your device location.
Creating Partitions and Formatting
Login as root using PuTTY:
First remove any existing partitions and create one big one using the fdisk
command, enter:
fdisk /dev/sda
To get a list of possible options enter m.
I used the p option to view the existing partitions, then d option to delete each of the existing unwanted partitions. (I'd installed Linux on this drive previously so it had several unwanted partitions on it).
Once I'd removed all the existing partitions, I created a new one with the n option.
When asked for the type of partition enter p for primary, then give it the partition number 1.
When asked for the first cylinder press 'enter' to accept the default value (normally 1), and when asked for the last cylinder press 'enter' again to accept the default value (should be the maximum number of cylinders).
To write the partition table and exit enter w.
(For a guide to partitioning and the fdisk utility, see this page:
http://www.lissot.net/partition/partition-05.html)
To format the new partition with the Linux 'ext3' file system enter:
mkfs.ext3 -m 0 /dev/sda1
Note - The hard drive was formatted with the ext3 files system, but we will mount it as an ext2 file system as we don't want 'journaling' to occur, (so we can spin down the drive when not in use).
Mounting the partition
Still logged in using PuTTY:
Create a directory for the location of the new partition, I chose to put it in
the
conventional '/mnt' directory and call it 'HardDrive', enter:
mkdir /mnt/HardDrive
To mount the drive automatically on boot, login with WinSCP and double click on
the '/etc/fstab' file to edit it,
add the following line to the bottom of the file:
/dev/sda1 /mnt/HardDrive ext2 defaults,noatime
0 0
Remember to press 'Return' after the line - it will fail to mount at boot if you
don't!!!
To force the changes in the fstab without re-booting, enter:
mount -a
Now change the permissions of the drive so everyone has read write access (this is
important if you plan to share it with Samba), enter:
chmod -R 777 /mnt/HardDrive