[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Replacing hda - Easiest Way?

On Aug 4, 2008, at 2:52 PM, Scarletdown wrote:

I'm going to be upgrading my primary hard drive (80GB) with a new 500GB
drive today.  The old drive has 7 assorted partitions on it:

/dev/hda1 - /
/dev/hda5 - /tmp
/dev/hda6 - /root
/dev/hda7 - /opt
/dev/hda8 - /var
/dev/hda9 - /usr
/dev/hda10 - /workspace
So, what would be the easiest way to transfer everything from the old
drive to the new one?  I remember from previous experience that just
doing a straight up copy from one to the other didn't work.  I need to
copy and
1:  keep all permissions intact
2:  Copy my boot loader from the old drive to the new one
(unfortunately, I can't remember if GRUB went on the mbr or on the boot
record of the first partition)

If you can leave the old disk in the box for a while, start by installing the new drive as hdb, partition it and mkfs the filesystems -- all while booted to the old drive. Set up a bunch of mount-points for the new partitions, e.g.:

/dev/hdb1	/new
/dev/hdb5	/new/tmp
/dev/hdb6	/new/root
/dev/hdb7	/new/opt
	...you get the idea...

Then boot single user to the old drive, mount the new drive partitions and use rsync to copy the contents of the various partitions to the new drive. Then install grub however you like on hdb. Since eventually you will want to get rid of the old disk and install the new one as hda, you may have to fiddle with things like / etc/fstab and the grub menu.lst file, but that should be pretty obvious.

Take a look at places like http://www.troubleshooters.com/linux/grub/ grub.htm for hints.


Reply to: