new hard drive

Place to discuss Fedora and/or Red Hat
Post Reply
worker201
guru
guru
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

new hard drive

Post by worker201 » Thu May 05, 2005 5:02 pm

This isn't really a Fedora specific question, but since I am using Fedora, here you go.

I managed to fill up an 80GB hard drive, so I need to add a second hard drive. I just bought a new Seagate 120GB. What I would like to do is have the /home directory be the mount point for this drive. That way, all my 'home' stuff will be on the new drive, leaving programs and OS stuff on the old drive.

Is this possible without reformatting the whole box?

Suggestions welcome.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu May 05, 2005 5:40 pm

Sure it is. Make a note of your current partition scheme with "fdisk -l" and take note of your partition layout in /etc/fstab. Make sure you set your jumpers right on both the new and old drive and install the new drive. After you boot back up you should see it in "fdisk -l" output. Here is an example of what I would do assuming your new drive is showing up as "/dev/hdb" and your current root partition is on "/dev/hda1" and your current home directory is on your "/" file system and you want all of your new drive to be used as /home:

1) Log in as root and make sure no other users are logged on.
2) # fdisk /dev/hdb
- n
- 1
- <ENTER> (first cylinder should default to 1)
- <ENTER> (last cylinder should default to last cylinder on drive)
- w
3) # mkfs.ext3 /dev/hdb1
4) # mkdir /mnt/home
5) # mount /dev/hdb1 /mnt/home
6) # cd /home
7) # cp -a * /mnt/home

The above will create a partion on your new disk, format it ext3 and copy all of your directories/files to the new file system keeping all permissions exactly as they are. Before deleting anything from your existing /home directory I would mount the new partition over /home and make sure everything still works OK and if everything is good unmount it and delete all the data from the /home directory on your "/" file system and add an entry to your /etc/fstab for the new partition. To test mount:

1) # umount /mnt/home
2) # mount /dev/hdb1 /home

Now log in as a normal user (without rebooting or you'll lose the mount). If everything seems to be in order you can unmount it and delete your data from the /home directory on your "/" partition. Log off and log back in as root:

1) # umount /home
2) # cd /home
3) # rm -rf *

Remount the new partition and add it to your /etc/fstab:

1) # mount /dev/hdb1 /home
2) # vi /etc/fstab

Add this line:

Code: Select all

/dev/hdb1            /home                   ext3    defaults        1 2
I would stick it in as the 2nd or 3rd line (right under your root and boot (if you have one) file systems).

worker201
guru
guru
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Post by worker201 » Thu May 05, 2005 8:01 pm

Well, that was easy enough. Occasionally, I screwed up a bit, because I was following your instructions for hdb1, while I was working with hdd1. Also had a slight issue when I moved the floppy drive to a different bay so the new hd could be slave to the optical drive, and close enough for the cable to reach. After turning the thing around, the floppy was hidden behind a panel. Instead of mucking about with those unpleasant plastic parts, I just switched them back - turns out the cable was long enough.

It's getting damn crowded in there. I have a bay and a power plug left for another optical drive. But, I'm out of connecting cable! Hopefully, this newest drive will be okay - 200GB total are dedicated to Linux. If I need another hard drive, it might be easier to just buy another computer!

Thanks a ton for all your help.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu May 05, 2005 8:14 pm

Just a side note, I usually don't put a hard drive as a slave to an optical drive. I don't remember what the reason is but I think there were valid reasons for it. Still, everything should be fine.

worker201
guru
guru
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Post by worker201 » Thu May 05, 2005 8:21 pm

Well, as I said, there wasn't any other place to put it. I have 3 hard drives, a cd/dvd writer, and a floppy. hda and hdb are master/slave, and the floppy uses a smaller cable. So slaving to optical was my only choice. If I have any troubles, Dell will be hearing about it!

User avatar
cdhgold
administrator
administrator
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

Post by cdhgold » Thu May 05, 2005 8:44 pm

the reasons you were thinking of Void are performance ones. example if the new hdd is a ATA133 and the optical is a ATA66 then the hdd will slow down to ATA66 speeds. IDE/ATA devices will slow down to match the speed of the slowest device on the channel. If one of the original drives are same ATA speed as the optical and the other original is faster you might get some performance boost by putting the 2 fastest drives on same channel. Hope this helps.

Cdhgold

worker201
guru
guru
Posts: 668
Joined: Sun Jun 13, 2004 6:38 pm
Location: Hawaii

Post by worker201 » Thu May 05, 2005 8:50 pm

How can I determine if this is happening to me? Is there a way to look up the device speed of my optical drive? Or do I have to google for brand-specific info?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu May 05, 2005 10:38 pm

Wow, the FAQ questions in this article seem to say just the opposite of what I was thinking:

http://www.mikeshardware.com/howtos/how ... de_hd.html

You can use the "hdparm" command for checking speed and checking/setting configuration. For instance "hdparm /dev/hdb" should list it's settings. "hdparm -I /dev/hdb" will list a lot of information about the drive. "hdparm -Tt /dev/hdb" will do a performance test. See the man page, lots of options.

Post Reply