Replace failing hard drive on Linux server

0

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.

user57770

Posted 2011-12-29T05:54:18.200

Reputation: 115

1Just curious - how do you know the OS disk is failing? – fpmurphy – 2011-12-29T14:19:11.673

Answers

2

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.

Chris Nava

Posted 2011-12-29T05:54:18.200

Reputation: 7 009

2Actually, 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 – 2012-01-01T18:36:58.453