adding a hard disk under linux

chris (2003-09-06 00:42:41)
8303 views
0 replies
To add a disk to your linux box:

First plug the thing in - make sure you get the jumpers fixed right and if you're unsure of what you're doing, just check in the BIOS that the system can smell the new device.

Then once you've booted and you have a shell running, try the following:

ls /proc/ide/drivers
hda hdb hdc hdd ide0 ide1 piix

let's say the new one is hdd - so first we need to create whatever partitions we want.

fdisk /dev/hdd

and use the following commands:
m - for help
p - to print the current state of the partition table
d - to delete an existing partition
n - to add a new partition - select '1' for the 1st number, then defaults for the next two
w - to write the new partition table and exit

once that's done, you can format the partition with mkfs as follows:

mkfs -t ext2 /dev/hdd1

and then mount into wherever you want it:

cd /
mkdir mnt
mount /dev/hdd1 -t ext1 /mnt

job done :)
comment