Solved

Linux Harddrive Upgrade...

Posted on 2002-07-08
6
222 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP Apache application gives "Forbidden" message 5 45
Java / Linux and Regular Expressions 11 71
AWS vpc peering connection 1 43
is my large folder zipped corrupted 4 51
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
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.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

863 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

23 Experts available now in Live!

Get 1:1 Help Now