Solved

Linux Harddrive Upgrade...

Posted on 2002-07-08
6
225 Views
Last Modified: 2010-04-20
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.
0
Comment
Question by:rclevlnd
6 Comments
 
LVL 1

Expert Comment

by:swapsthegreat
ID: 7138840
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
0
 
LVL 20

Expert Comment

by:Gns
ID: 7139048
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
0
 
LVL 40

Expert Comment

by:jlevie
ID: 7139088
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 20

Accepted Solution

by:
Gns earned 100 total points
ID: 7139113
Of course Jim is right, please disregard my comment (although the blurb about not restraining the new drive with the old drives partition table still stands... it's just that Jims suggestion is better.... don't know what I was thinking... Time for shut-eye:-).

-- Glenn
0
 
LVL 1

Expert Comment

by:oozbooz
ID: 7146669
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.
0
 

Author Comment

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

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question