LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-29-2008, 10:15 PM   #1
ewolf
LQ Newbie
 
Registered: Dec 2007
Location: Chicago, USA
Distribution: Debian, NetBSD
Posts: 25

Rep: Reputation: 15
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!

Last edited by ewolf; 04-29-2008 at 10:24 PM. Reason: grammar
 
Old 04-30-2008, 12:41 PM   #2
esaym
Member
 
Registered: Nov 2006
Distribution: Lots of Debian
Posts: 165

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

http://www.linuxquestions.org/questi...airing-632876/
 
Old 05-10-2008, 01:40 AM   #3
ewolf
LQ Newbie
 
Registered: Dec 2007
Location: Chicago, USA
Distribution: Debian, NetBSD
Posts: 25

Original Poster
Rep: Reputation: 15
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
 
  


Reply

Tags
badblocks, dd, ext3, filesystems, mdadm, raid, recovery, software


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the expected output of mke2fs -c -c when there are bad blocks on the disk? pipopo Linux - General 6 02-06-2008 04:43 AM
add a new disk to raid1 array retrev Linux - General 1 04-08-2007 02:57 AM
Clone IDE disk to SATA disk sdem Linux - Software 1 02-16-2006 06:51 AM
bad blocks/disk pb nadine.mauch Linux - General 0 10-07-2004 03:49 AM
Bad BLocks on Hard disk... hpnadig Linux - Hardware 0 03-10-2004 12:38 PM


All times are GMT -5. The time now is 02:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration