Tuesday, January 16, 2007

Moved my Sid to a new HDD

I had been using Sid on a 40 Gb HDD which was running out of life. A couple of bad sectors in the root partition made me buy a new 80 Gb HDD.

Here is how I moved my whole system to new HDD:

First i booted with ubuntu live cd. Partitioned the new hard drive with some ext3 filesystem. Then mounted them:

#mount -t ext3 /dev/hda5 /mnt/new_debian
#mount -t ext3 /dev/hdc6 /mnt/old_debian

#cp -av /mnt/old_debian/. /mnt/new_debian/.

Then mounted proc
#mount -t proc /proc /mnt/new_debian/proc

#chroot /mnt/new_debian /bin/bash
#cd /dev
#/sbin/MAKEDEV generic

Now editted fstab and mtab to reflect my new hdd setting (i.e. my new root and swap partitions):

#vim /etc/fstab
#vim /etc/mtab

Then ran grub

#grub
> root (hd0,4)
> setup (hd0)
> quit

#grub-install /dev/hda

My new system is working as good as my old one now.

No comments:

Back to Blogging

After a failed attempt last year to get back to blogging, I'm trying it again this year. I really wanted to get back, but got busy will...