Skip to contentSkip to conversation

Recovering from disk failure

linux-lvm Måns Rullgård 2 participants 6 messages Aug 28, 2003 – Aug 29, 2003

lore
Share & tools
lore
#0 lore raw

Recently one of two disks in a volume group crashed, and I can't read it at all. Now, some LVs are entirely on the disk that survived. Is there any way I can just disable the broken LVs and continue using the complete ones? I'm using device-mapper and LVM2, but I used to use LVM1, and have not converted the disks to the new format. I have both LVM1 and LVM2 tools available, as well as a bunch of different kernels. Dirty hacks are OK, too.

Now I'm considering building a RAID5 array and run LVM on top of that. Is there something fundamentally bad with such a setup?

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#1 lore raw
Quoted 4 lines · M?ns Rullg?rd

Recently one of two disks in a volume group crashed, and I can't read it at all. Now, some LVs are entirely on the disk that survived. Is there any way I can just disable the broken LVs and continue using the complete ones? I'm using device-mapper and LVM2

Read the description of '--partial' on the lvm(8) man page. e.g. (lv|vg)change -ay --partial

And '--removemissing' in vgreduce(8) to *permanently* destroy the lost LVs (run with --test first to check what it will do).

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 7 lines · Alasdair G Kergon
Quoted 4 lines

Recently one of two disks in a volume group crashed, and I can't read it at all. Now, some LVs are entirely on the disk that survived. Is there any way I can just disable the broken LVs and continue using the complete ones? I'm using device-mapper and LVM2

Read the description of '--partial' on the lvm(8) man page. e.g. (lv|vg)change -ay --partial

I should have read the manuals before mailing. However, I still have some questions. Some LVs were split between the two disks. With the --partial option, it won't let me see them at all. Can I do something to get just read errors, or zeros, or whatever for the missing sectors? I could of course do some manual work with dd, but an automated method seems easier.

Quoted 2 lines

And '--removemissing' in vgreduce(8) to *permanently* destroy the lost LVs (run with --test first to check what it will do).

I don't want to do that until I've salvaged all the information I can get back. I have plenty of scratch space on other disks.

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#3 lore raw
Quoted 8 lines · [email protected] (M�ns Rullg�rd) writes:
Quoted 7 lines
Quoted 4 lines

Recently one of two disks in a volume group crashed, and I can't read it at all. Now, some LVs are entirely on the disk that survived. Is there any way I can just disable the broken LVs and continue using the complete ones? I'm using device-mapper and LVM2

Read the description of '--partial' on the lvm(8) man page. e.g. (lv|vg)change -ay --partial

Quoted 6 lines

I should have read the manuals before mailing. However, I still have some questions. Some LVs were split between the two disks. With the --partial option, it won't let me see them at all. Can I do something to get just read errors, or zeros, or whatever for the missing sectors? I could of course do some manual work with dd, but an automated method seems easier.

I figured it out, after reading some source code to determine that the dmsetup man page is incorrect. It tried to tell me that the "target_type" for an all-errors mapping is "io-err", when it is in fact "error". Someone should fix this.

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#4 lore raw
In reply to Måns Rullgård
Quoted 1 line · M?ns Rullg?rd

--partial option, it won't let me see them at all.

Should do, if you create /dev/ioerror with dmsetup as a device bigger than the device you lost.

e.g.

cat > tab1 << EOF
0 10000000 error
EOF

dmsetup create ioerror tab1
ln -s /dev/mapper/tab1 /dev/ioerror

Replace the 10000000 with a number slightly bigger than the
size of your problem disk in sectors. [device size in bytes / 512]

[Need to bring dmsetup(8) up-to-date.]

Alasdair

Signature · 1 line
[email protected]
#5 lore raw
Quoted 5 lines · Alasdair G Kergon
Quoted 1 line · M?ns Rullg?rd

--partial option, it won't let me see them at all.

Should do, if you create /dev/ioerror with dmsetup as a device bigger than the device you lost.

I figured it out, but thanks anyway. It seems to work better make /dev/ioerror return zeros. That way I can make a copy of the filesystem and fsck it.

Signature · 2 lines
M�ns Rullg�rd
[email protected]