[CentOS] Replacing a hard drive

Edward Milstein eddiem5 at yahoo.com
Wed Mar 14 15:42:12 UTC 2007


On Mar 14, 2007, at 9:35 AM, Bowie Bailey wrote:

> I have a CentOS 4.4 system where all of the main filesystems are on a
> single hard drive.  This drive is starting to give some errors, so  
> I got
> a new (larger) drive to replace it with.  What is the easiest way to
> copy my filesystems over to the new drive?
>
> I considered using dd, but I lose the extra capacity of the new drive
> that way.
>
> I tried using SystemImager, but it is giving me some errors.
>
> I think the easiest way may be to boot from the LiveCD, recreate the
> partitions, copy the info with rsync and then fix the boot  
> partition and
> grub.  Any tips or pointers to a good how-to?
>
> --
> Bowie

Here is what I recently did for a similar operation.

1) Download the system restore iso http://www.sysresccd.org/Main_Page

2) Boot into the sysrescue cd

3) Run partimage against your old disk to save the slices.

4) Partition your new disk as per your old disk (sfdisk -d /dev/disk1  
| sfdisk /dev/disk2)

5) Use partimage to restore backups you just did to the new disk.

6) Remove old disk

7) Remove CD

8) Reboot

Viola..

-ed-

PS.  You might need to fix grub if addressing for the new disk  
changed but there are smarter people to comment on that aspect.



More information about the CentOS mailing list