Link to home
Start Free TrialLog in
Avatar of rclevlnd
rclevlnd

asked on

Linux Harddrive Upgrade...

Hi,

I have a Linux box and need to upgrade the
hardrive to a larger size.

My question is:

What is the best way to copy the data from the
old drive to the new drive, then remove the old
drive and be able to boot to the new one?  For example, like xcopy32 of win9x from drive to drive.

I've been searching all over, and have found nothing
covering this subject.

Any links to information on this subject are greatly
appreciated.

Thanks.
Avatar of swapsthegreat
swapsthegreat

hi

 u could try using dd

if ur old drive is say primary master, and new is primary slave

dd if=/dev/hda of=/dev/hdb

then reconnect the new drive as master removing old one
Um, and thus "shooting" the new drive with the old ones partition table... not good.

Create exactly the same partitions on the new drive with fdisk, then use dd to "copy" the partitions one by one. As the above example:
dd if=/dev/hda5 of=/dev/hda5
...
Remember to install your bootmanager (LILO or grub or whatever) to the new drive, before removing the old one.

Come to think of it, why (re)move the old one? Linux can happily live on several disk devices;-)

-- Glenn
I'd say the preferred method, which allows for resizing of partitons when moving the data, would be to create partitions to your liking on the new drive (fdisk) and make file systems on those data partitions (mke2fs). If you are running 7.2 or later tunefs can be used to convert the new file systems to ext3. The swap partition needs to have mkswap run on it. Then use dump/restore to transfer data from the old drive to the new. Check etc/fstab on the new drive to be sure it matches your new disk and then install boot blocks with lilo or grub-install, as appropriate. Pull the old drive and move the new one into it's place and you should be "good to go".

A "good thing" to have is a current boot floppy for the system. If you don't have one for the kernel you are currently running make one with 'mkbootdisk' and test it by booting from it before starting the transfer process. That way if something doesn't go quite right you'll still be able to boot the new disk and fix it. A nice feature of using dump/restore vs dd is that the new file system will be defrag'd and you'll only copy real data, rather than every block on the old drive.
ASKER CERTIFIED SOLUTION
Avatar of Gns
Gns

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can use IBM utility for isntalling HDs. the utility allows you to copy 1st HD to the 2nd. I used it once - worked great. They have one for Linux as well.

So this is the sequence:

1) create IBM Disk Manager floppy
http://www.storage.ibm.com/hdd/support/download.htm#diskmgr2k

2) boot from the floppy, while both disks are installed. 1st - old one, 2nd - new one.

3) use IBM utility to mirror 1st disk on 2nd one

4) shut down the machine

5) remove 1st disk, and make 2nd one a primary

6) reboot.
Avatar of rclevlnd

ASKER

This answer worked the best for me.  Sorry it took so long to reply.  Been in the middle of a job switch.  :)