Installing a second hard drive is easy if you know how. I needed to do this on my computer and below is the steps, please follow this.
I assume that you have installed the hard drive in your PC, and you have rebooted your machine. In this example our primary hard drive is located at /dev/hda and our second, new hard drive is located at /dev/hdc (replace according to your system)
Partitioning your new drive
Next up we need to partition our drive with this command :
cfdisk /dev/hdc
The cfdisk controller will load up and here you can create a new partition on your drive. From the menus at the bottom I selected the following :
1. New >> Primary >> Size in MBYour new partition has been created at /dev/hdc1
2. Once done select Write
3. Select Quit
Format the new disk
Now that we have a new partition at /dev/hdc1 we need to format it for usage by the system. From a Linux shell type :
This will now format our partition with the ext3 filesystem which should work fine for your Debian system.mkfs.ext3 /dev/hdc1
Mount your new drive
Now that we have partitioned the drive and formatted it we can now mount the drive to begin using it. From a shell run:
mkdir /new-diskThe above commands create a new directory for the drive to be mounted in and then we mount the drive to this directory. To check that the drive has been mounted run the following:
mount -t ext3 /dev/hdc1 /new-disk
ls -lsa /new-diskYou should see the following:
# ls -lsa /new-diskAdding to fstab
total 24
4 drwxrwxrwt 3 root root 4096 2007-01-29 01:57 .
4 drwxr-xr-x 22 root root 4096 2007-01-29 01:58 ..
16 drwx------ 2 root root 16384 2007-01-29 01:57 lost found
Everything is now up and running however we need to add our new drive to /etc/fstab so that it will be mounted automatically when we reboot the machine. First let's edit fstab :
vim /etc/fstabAt the end of the file add the following line:
/dev/hdc1 /new-disk ext3 defaults,errors=remount-ro 0 1Save the file and you're done.
No comments:
Post a Comment