Solved

Linux Harddrive Upgrade...

Posted on 2002-07-08
6
220 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 20

Accepted Solution

by:
Gns earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now