Clone Failing Hard Drive?

Kimball Larsen kimball at
Wed Nov 7 09:28:32 MST 2007

So, we have a little internal server here at work that is used mostly  
for storage and samba shares - it has (at last count) 5 different  
drives attached to it (some are IDE, some are SATA, and one that is  
in an external firewire enclosure).

As it was built to be a storage server in the first place, the main  
drive with the system on it is pretty small, and was relatively old  
(this machine was mostly cobbled together from old parts from other  

All the drives we use for storage are fine, but the main drive is  
beginning to show signs of pending failure.  I'd like to get it  
replaced with a new drive as soon as possible (have new drive  
arriving today), but I'd really, really prefer to not have to re- 
configure the entire system as an install from scratch.

Here is what lshw has to say about the drive in question:

                 description: IDE Channel 0
                 physical id: 0
                 bus info: ide at 0
                 logical name: ide0
                 clock: 33MHz
                    description: ATA Disk
                    product: ST3120026A
                    vendor: Seagate
                    physical id: 0
                    bus info: ide at 0.0
                    logical name: /dev/hda
                    version: 8.54
                    serial: 5JS5GH45
                    size: 111GB
                    capacity: 111GB
                    capabilities: ata dma lba iordy smart security pm  
partitioned partitioned:mac
                    configuration: mode=udma5 smart=on
                       description: Apple partition map
                       physical id: 1
                       bus info: ide at 0.0,1
                       logical name: /dev/hda1
                       capacity: 31KB
                       description: Apple Bootstrap
                       physical id: 2
                       bus info: ide at 0.0,2
                       logical name: /dev/hda2
                       capacity: 977KB
                       capabilities: bootable
                       description: Apple UNIX SVR2
                       physical id: 3
                       bus info: ide at 0.0,3
                       logical name: /dev/hda3
                       capacity: 110GB
                       description: Apple UNIX SVR2
                       physical id: 4
                       bus info: ide at 0.0,4
                       logical name: /dev/hda4
                       capacity: 1473MB

And smartmontools reports that the drive has had 4 errors in the last  
few weeks (2 of which caused the kernel to set the filesystem into  
read-only mode and forced a reboot/fsck of the drive, with filesystem  
errors found and corrected).

So, my question is then:  how can I clone this drive onto a new disk,  
preserving the partitions, etc.  Secondly, if the new disk is a  
larger capacity, can I expand one of the partitions to fill the extra  
space after I do the cloning?

Years ago I used dd for something similar, but as I recall the  
geometry of the drives in question was identical.


- Kimball

More information about the PLUG mailing list