Adding a Hard drive in Linux--
In five steps
Written By: shaggy112
This NHF assumes that you have already physically installed your hard
drive in your computer and configured it in your computers bios
1. Type "dmesg | more" to find out what the drive
is called. If this will be the second drive in your system...it will
probably be something like "/dev/hdb" (while the first drive is
hda). Once you have found this in dmesg...make a note of it as you will
need it later. For this NHF, we will assume that the new drive is /dev/hdb.
2. You must now partition your new disk. In your shell type:
fdisk /dev/hdb2
This will take you to a prompt that says "Command (m for help):".
At the prompt, type "p" to display the existing partitions. If
you have partitions that you need to delete, type "d", then at the
prompt, type the # of the partition that you wish to delete. Next, type
"n" to create new.
Type "1" (assuming that this will be the first partition on new
drive), and hit enter. Then you will be prompted for the cylinder that
you want to start with on the drive. Assuming that this is the first
partition on the drive, type "2" (as it is unsafe to start on
1). You will now be asked for your ending cylinder, hit enter to consume
the whole drive, or specify cylinder to use only part of the drive (that
created /dev/hdb1). If you would like to continue making
partitions, repeat this step...otherwise we are through partitioning.
3. Now, we need put a filesystem on the disk (similiar to format in the
MS-OS world). To put a clean filesystem on your newly partitioned drive,
type:
mkfs /dev/hdb1
Repeat this step as with appropriate partition number, or with multiple
new partitions...just type:
mkfs /dev/hdb1 && mkfs /dev/hdb2
This will put a filesytem on each partition, as long as the previous exits
with no errors.
4. You will now need to decide the mount point for each new partition on
your drive (which would be a directory below /). For this NHF we will
mount our new partition in /new.
Type:
mkdir /new
That will be the mount point for your drive. Now you will need to edit
"/etc/fstab". You will want to make an entry at
the end of the file similiar to this:
/dev/hdb1       /new     ext2       defaults       1   1
After you have created a similiar entry for each partition, write the
file.
5. FINALLY, type:
mount -a
This will mount the partions in the directory that you specified in /etc/fstab. If the mount command exits with no
errors....you are done!!
Hopefully this NHF has been of some use to you!
Any questions/problems or feedback -- shaggy112
|