LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   RAID1 array down to one disk with bad blocks, clone to good disk with dd noerror? (http://www.linuxquestions.org/questions/linux-server-73/raid1-array-down-to-one-disk-with-bad-blocks-clone-to-good-disk-with-dd-noerror-638781/)

ewolf 04-29-2008 10:15 PM

RAID1 array down to one disk with bad blocks, clone to good disk with dd noerror?
 
Hello,
I have a server which I tried to set up a software RAID1 (mdadm) array on. I was succesful, sort of. There are 3 logical partitions (/boot, swap, and /), which were to be mirrored between two 500GB WD hard drives, sda and sdb. Installation of Debian Lenny went without a hitch. The /boot and swap partitions would sync on the array from sda to sdb just fine, but the large / partition would not sync. It would get to about 65% and then restart the sync from scratch. I have determined that there are bad blocks on both sda and sdb, and this was causing the sync to restart. However, I haven't filled up the / partition to anywhere near that capacity yet, so I don't think there is anything important on those bad blocks.

I removed sdb from the array, so, in short, I now have a working Debian installation living on the good part of a bad disk in a RAID1 array of, well, only 1 disk.

My question is this: If I use dd with the noerror switch, and clone sda to some working replacement drive, will the ext3 filesystem be corrupt due to the null spaces that dd swapped for the bad blocks?

I.E. does the ext3 filesystem put any important information in areas of the disk that haven't been used yet? Or are those blocks essentially full of zeroes until the filesystem places some files or directories on them?

I appreciate any advice. Sure, I don't want to reinstall and reconfigure my software, but for the most part, I am curious.

Thank you!

esaym 04-30-2008 12:41 PM

badblocks usually don't cause corruption. I some info on bad blocks here:

http://www.linuxquestions.org/questi...airing-632876/

ewolf 05-10-2008 01:40 AM

Thanks for the links, they were helpful.

I just copied the drive over with

dd if=/dev/sdX of=/dev/sdY bs=512 conv=noerror,sync

and everything went smoothly. When I use dd to make backup images, I usually use a much larger block size to make things go faster, but since bad blocks are overwritten with zeroes when the noerror,sync flags are set, I think that using the 512 byte block size is important in this scenario.

In addition, the second replacement drive arrived from WD and the initial RAID1 sync seems to have gone without a hitch.

Cheers,
Elijah


All times are GMT -5. The time now is 04:25 PM.