Skip to contentSkip to conversation

Drive failure

linux-lvm Ewen McNeill 2 participants 2 messages May 15, 2003 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 10 lines · Herbert Poetzl
Quoted 4 lines · B. J. Zolp

Should I be able to dd (without reading the bad sectors) the failing drive (assuming it spins up and reads all the good sectors) to the replacement drive, then run fsck on the unmounted volume and then mount the volume with minimal data loss?

I guess, this should work ... but make sure, that you do the copy operation on another system, otherwise the LVM stuff could/will be irritated by two diffent disks with the same signature (after copying over)

Other things to consider:

- make sure you do the dd with an option to replace unreadable sectors with blank sectors (otherwise nothing will be written out for the unreadable sectors, causing everything to be "out of alignment" after the first bad block)

- do the copy in single user mode, preferable booted in such a way that the LVM isn't active (or on another system as suggested above)

- it'll take longer but consider copying in sector-by-sector chunks, as it'll reduce the amount skipped (eg, bs=512)

- you may want to map which logical volumes, and which files on those volumes, are affected by the bad sectors before you start, so you know which files you'll lose (you could use something like "badblocks" -- in _read_only_ mode!! -- to identify the affected blocks)

But aside from that, given an identical sized replacement disk and/or replacement partition, I'd guess it should, in theory, work. I've seen similar things done with other systems with logical volume managers (eg, HP/UX 10.20) reasonably successfully (we ended up restoring much of the data from backup anyway to get a consistent database snapshot, but it did save a bunch of volume reconstruction time, etc).

Ewen

#2 lore raw
Quoted 12 lines · Ewen McNeill
Quoted 10 lines · Herbert Poetzl
Quoted 4 lines · B. J. Zolp

Should I be able to dd (without reading the bad sectors) the failing drive (assuming it spins up and reads all the good sectors) to the replacement drive, then run fsck on the unmounted volume and then mount the volume with minimal data loss?

I guess, this should work ... but make sure, that you do the copy operation on another system, otherwise the LVM stuff could/will be irritated by two diffent disks with the same signature (after copying over)

Quoted 7 lines

Other things to consider:

- make sure you do the dd with an option to replace unreadable sectors with blank sectors (otherwise nothing will be written out for the unreadable sectors, causing everything to be "out of alignment" after the first bad block)

I plan on using the noerror switch for dd, what else would I need to use to make sure it replaces with blank sectors. I could not find anything in info dd or man dd.

Quoted 6 lines

- do the copy in single user mode, preferable booted in such a way that the LVM isn't active (or on another system as suggested above)

- it'll take longer but consider copying in sector-by-sector chunks, as it'll reduce the amount skipped (eg, bs=512)

great idea

Quoted 19 lines

- you may want to map which logical volumes, and which files on those volumes, are affected by the bad sectors before you start, so you know which files you'll lose (you could use something like "badblocks" -- in _read_only_ mode!! -- to identify the affected blocks)

But aside from that, given an identical sized replacement disk and/or replacement partition, I'd guess it should, in theory, work. I've seen similar things done with other systems with logical volume managers (eg, HP/UX 10.20) reasonably successfully (we ended up restoring much of the data from backup anyway to get a consistent database snapshot, but it did save a bunch of volume reconstruction time, etc).

Ewen

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/