Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding New IDE Hard Drive 3

Status
Not open for further replies.

gk4u

Programmer
Jul 2, 2002
21
IN
Hi All
I want to Connect New IDE hard Drie in My Existing Linux Server Red Hat 5.0.
& Further i want to mount /usr on new hard drive how ican achieve this...

Regards
GK
 
(1) attach the new hard drive.

(2) you will need to create partitions on the hard drive.
You will need to know what the drive is connectecd as
Primary Master = hda
Primary Slave = hdb
Secondary Master = hdc
Secondary Slave = hdd

fdisk /dev/hd?
create as many partitions that you need.
example:
n (new)
p (primary)
ENTER (start first cylinder at begining)
ENTER (use the whole disk as 1 partition)
w (write the partition table)

(3) You need to put a filesystem on the hard drive.
Since this is RedHat 5.0 then it most likely is ext2. Unless another filesystem was put on . Type "mount" and look to see if /usr is on ext2. You can use a different type of filesystem if you like, but it will be best for you to use what the others are.

type mkfs.ext2 /dev/hd?X (X is the partition number. If you make one partition then it will be 1.

Example: 1 partition on i drive on the secondary channel.
mkfs.ext2 /dev/hdc1

(4) Mount the drive. Once the format is finished formating you need to mount the drive. Create a temp mount space.
"mkdir /mnt/hdc"
mount /dev/hdc1 /mnt/hdc

(5) Copy the data from /usr to /mnt/hdc
cd /usr
tar -cvf - . | tar -C /mnt/hdc/ -xvf -

(This will copy /usr to /mnt/hdc preserving the integrity of the information. Type extactly as shown above with the dashes spaces and periods and the pipe symbol. Pipe is SHIFT \ .
Type diff /usr /mnt/hdc/ to see if there are any differences in the directories.)

(6) Edit the fstab to now use the new usr partition. I do not know how familiar you are with vi so use pico. Copy the fstab to a backup file.
cp /etc/fstab /etc/fstab.bk
pico /etc/fstab

You will need to either change the mount point of /usr (if it exists) or create one for /usr.

enter:
/dev/hdc1 /usr ext2 defaults 1 1

(7) Test the new mount point. Reboot the server and login. Once logged in type mount.
See if /dev/hdc1 is on /usr with type ext2.

That should be it.


 
Well done, clonny2. I give you a star.
Truly very comprehensive help.
 
Thanks clonny2 it will do......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top