Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Friday, September 24, 2004

Adding a Second Hard Drive

The plan is to use the 7GB drive in the Compaq that will become my new server as the operating system drive. I'll purchase a 160GB drive where I would like all extra software and user files to live. I found a few links explaining how the 2nd drive is installed.

Adding a Linux Hard Drive
Adding an Extra New IDE Hard Drive
Adding Additional Hard Drives in Linux
Adding a New Hard Drive - Newcastle University

...and there are many others.

Next, I need to find out how to direct the /home folder and maybe others to the new drive.

David Phillips says to do it like this:

If you have a fairly large drive that you want to use I would move /usr over to it like this

I will pretend it's /dev/hdb but it could be anything

make partition we will call hdb1
format it
mke2fs /dev/hdb1
tune2fs -j /dev/hdb1
or use whatever fs you want

mkdir /tempdir
mount /dev/hdb1 /tempdir
mkdir /tempdir/usr
cp -a /usr/* /tempdir/usr

now you need to make sure everything is there before removing it from /usr
umount /dev/hdb1
rm -rf /usr/*
mount /dev/hdb1 /usr/

you should have everything in /usr and everything is good to go for boot up

add the line to mount /dev/hdb1 on boot in fstab
/dev/hdb1 /usr ext3 defaults 1 1

when you delete all files from /usr it will give the space to /
when you mount /dev/hdb1 in /usr it will have it's free space in /usr and will not use any space in /
all you need to do is have the empty folder /usr in / and mount /dev/hdb1 on it.


I'll give it a try once I'm at that point. I have to get the new client machine built first so that I can free up this Compaq.

0 Comments:

Post a Comment

<< Home