I'm working with a Linux server with a failing drive, and am interested in the best/easiest way to transfer the existing data onto a new drive, and reboot with the new hardware.

The server is running a fairly ancient version of SUSE (2.6.8-24 kernel), and contains two internal SCSI drives. One is divided into the various standard partitions. The second is mapped to a custom mount point to hold certain data. It is the first drive that is failing.

The OS detected an error, and automatically remounted the /home partition read-only.

I have spare drives of the same size and type of the failing drive. I also have some larger drives.

  • 1
    Just curious - how do you know the OS disk is failing? – fpmurphy Dec 29 '11 at 14:19

You can use the dd if=/dev/sda of=/dev/sdb bs=1M command to copy the raw data from one unmounted drive to another. Then swap the drives and reboot. Be sure to set the block size correctly to avoid a very slow copy. see also https://serverfault.com/questions/4906/using-dd-for-disk-cloning

edit: Fixed the block size in the example command to be more realistic for modern systems.

  • 2
    Actually, I would use a block size larger than 1 KB - try 1 MB or something like that. Also note that while dd is good for cloning, the drives effectively must be of the exact same size (which they would be in the OP's case, but which definitely isn't the general case) for it to work out nicely. – a CVn Jan 1 '12 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.