Phil’s Diary - [Blog @ http://www.philsdiary.net/]
Tuesday November 23, 2004
Done

Well I think the harddisk upgrade went ok, I mean the BIOS seemed to think it was an 8GB drive, but Linux happily formatted it to 160GB. I managed to copy my old /home to it, and remount it. Time will tell I guess whether the permissions have been mangled or the files corrupted. For anyone interested (and me in the future, he’res roughly what I did).

- before anything, check /proc/ide, the harddisks are listed as hda, hdb etc.

- shortdown and install new drive, then reboot and again check /proc/ide, you should see a new drive, eg. hdb has appeared. I’ll use hdb as the drive in this example.

- run fdisk /dev/hdb

- add a new partition (or partitions). Make sure you write the changes and don’t just quit.

- run mkfs -t ext2 -j /dev/hdb1 to format the first partition (change the hdb1 to hdb2 for the second, third etc.).

- now mkdir a new directory, eg. /newhome, and mount the partition to it: mount /dev/hdb1 /newhome.

- Use init 1 to drop to single used more (so we can be sure nothing in /home is being used).

- cp -av /home /newhome should copy everything (v shows you the files, a copys the permissions).

- Now rename /home to /oldhome

- Add an entry in /etc/fstab, something like /dev/hdb1 /home ext3 defaults 1 2

- mkdir home (because we renamed the old one.

- umount /newhome Unmount the old temporary setup.

- rmdir /newhome (it should only be a shell now, so can remove it)

- reboot

You can then clear up /oldhome later, when you’re sure everything’s gone ok.

This may be a little incorrect in areas, but is enough of a reminder to me so that I should be able to figure it out next time around.

Note for the pedantic: I’d originally written Gb, for Gigabyte. I’ve since changed this to avoid confusing with Gigabit.

Posted by Phil on November 23, 2004 08:10 PM | Categories: Linux

160Gb, that's like 20GB. :)
Strange that the BIOS only sees an 8 gigabit drive ...
Gb - GB

Posted by: sjon at November 24, 2004 6:54 AM