how to replace harddisk?

Dear fellow openSuse 10.3 users,
Recently i have been getting messages saying something like: “your harddisk is failing” and mentioning som secotrs that apparently have not been readable or writable. That’s why i want to replace my harddisk with a brandnew one.

I intend to copy all the data from the old harddsik to the new one and then remove the old one. In the end i want to be able to boot the system from the new hd.

The problem is that i am quite a linux-noob when it comes to ‘low-level-issues’ (such as hardware :P), so i’m hoping to find some help on the issue here.

Some information on the machine:
old HD: 80GB IDE
partitioning (as far as i remember): 10 GB /-part; 2 GB
the device file is /dev/sda
swap-part; rest=homeDir-part.
new HD: 750GB IDE (i intend to connect this one to the secondary IDE port, until the old HD is ready to be removed)
(as far as I know thos one’s not partitioned, formatted or anything.)

Could anyone please tell me what to do in order to get this new HD in place of the old one?
How do i have tot set the jumpers on the drive? (Do i have to change anything in the bios?)
how do i copy the data? (how do i identify the new HD’s device file? do i have to make the partitions first? do i have to format the partitions first? does the swap partition need to be copied at all?)
when copying is done, do i have to do anything to make the system boot from the new HD after i moved it from the secondary IDE port to primary IDE port?

So if anyone could give me some help on this one, that’d be really great.

PS: i’ve searched the forum before but i couldn’t find anything quite matching this case.
PS2: i do not know the dd command (from as much as i’ve learned so far this command is needed to copy entire drives, or something. so if i nedd it, i’d appreciate some explaination on that one too :wink: )

Your ‘model’ of trying to have both old and new drives in place at the same time
makes the job about 10 times harder than it needs to be.

I’d approach it this way:

First, decide what personal DATA you want, then insert a USB-flash-drive into the
machine and copy the files you want onto it. (e.g. maybe your present
‘/home/username’ directory tree).

Then remove the old drive. Install the new drive in its place, setting the jumpers
exactly the same way as they were on the old drive.

Boot up an installation-CD/DVD and do a fresh installation of Linux.
[Maybe you want to take 11.0 for a spin, instead of 10.3, or whatever!?]

When it’s working, copy the flash-drive files onto the new system.

[As an alternative, you could THEN set the jumpers on the OLD drive to ‘slave’
instead of master, and install it, AFTER having done the installation on the new
drive. Doing it this way, tho, with the new drive
as the ‘first’ drive, grub/boot issues will be transparent. And, if there’s any
issues trying to access the old-drive, you won’t really care, because you’ll
already have the important stuff backed up onto the flash-drive.]

My 2-cents worth…

Dave [who prefers single-disk systems for their simplicity]

Here’s another idea, similar to Dave’s, but different.
Move the old drive to motherboard connection #2 and install the new drive on motherboard connection #1.
Install openSUSE 10.3 or 11.0 (not the KDE4 option) onto drive #1. openSUSE will take the whole drive if you let it.
Then when it’s over, reboot the new installation and log on as root, not as your own username. As root, issue a command to clear off the new /home partition and then a command to rewrite it with the files from the old /home partition pn the second drive. That will preserve your email settings, browser settings, programme defaults, Desktop and so on and on and on.

To write the old home partition onto the new home partition the command is like this:

cp -a /oldhome/* /home

where you have mounted the drive #2 old home partition in a folder /oldhome so you can access it from the new installation just that once; then unmount it and forget it.

There are more details on the link below – but that is slightly different from what you want – nearly the same though – good for a background reading:
Linux HowTo: Use Separate Partitions for the Users’ Data and the Root Filesystem

thanks for your tips.

but unfortunately i am not completely satisfied :stuck_out_tongue:
the thing is, there are a bunch of users on the system that all have their own profile. Besides there is a bunch of configuration files that took me a long time to design, and i installed a few things that were unavailable via yast. And I don’t want to lose all that by installing a new system. Besides: reinstalling suse takes really really long.
So there is no way that i can partition the new drive, copy the data and remove the old drive (since i want to throw that one out in the end)?


Copying home like that preserves each users personal settings, desktop, firefox and so on. What are the configuration files? where are they?

I might have missed something here (as I usally do)… but I’m interpreting from your first post that there is nothing wrong with your setup, but your disk needs replacing.

If this is true why not just make an image of the existing disk to the new disk (keeping all the current data and layout) and continue on the new disk?

there are enough tools that can do this for you.

What filesystem are you using? Have a look at BootIt as for an example imaging tool. (it supports reiser, ext2-3 and xfs… as also ntfs/fat/etc)


In your case I would recommend to make 1 to 1 copy of your disk,
Get a new disk connect it and use tool like partimage (Main Page - Partimage) or other imaging tool. Boot your computer from rescue CD that has partimage (for example Main Page - SystemRescueCd) and clone your hard drive.
After successful cloning you can remove the old drive and the system should work fine. No need to reinstall everything.

If you planning to get larger hard drive some disk imaging utilities can resize the partition while cloning (Acronis TrueImage but its commercial software).

I am trying to do something similar to the original poster. Except I am trying to replace an old ide drive (/dev/hda) with a SATA drive (/dev/sda). If I do a mirror copy of the old drive to the new one, will it boot properly even if the device name is different?

You should be able to get that to work alright…

Have a look here as what might be needed to be changed to get it booting : Good Things To Know When Imaging Linux To Different Hardware - openSUSE Forums

In your case you probably only need to adjust the mentioned files


If you run into ‘trouble’ it’s probably better start a new thread for it.

Wishing you luck,