Solved

Linux Harddrive Upgrade...

Posted on 2002-07-08
6
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
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.

717 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