Skip to contentSkip to conversation

Removing faulty disk from LVM2

linux-lvm Magnus Nilsson 2 participants 3 messages Feb 4, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I've got an 8 disk VG where one PV is dying.

Through pvmove'ing parts of the PV I've narrowed it down to PE #14858 of 38154 4MB PE's. All the other PE's on that PV have been moved. The machine hard-locks every time that PE is accessed, so I can't activate the VG with 'vgchange -ay vg00'. It also seems that I have an unfinished pvmove of that last PE that I can't abort since I can't activate the VG.

According to the lvm manpage I've tried using 'vgchange -P -ay vg00' after creating /dev/ioerror using dmsetup. That lets me activate the VG without having the faulty PV plugged in, but it still doesn't let me mount the LV's complaining that it can't find the superblock. I did 'echo "0 99999999999 error" >/foo && dmsetup ioerror /foo && ln -s /dev/mapper/ioerror /dev/ioerror'

Nevertheless, the manpage says that activating with -P will only let me read, but I don't have the required ~1TB of space to do a backup.

Is there any way of just skipping that last PE and let me repair the filesystem afterwards? Perhaps by vgcfgrestore'ing an edited backup, excluding the broken PV?
Alternatively I could remove another PV from the VG, create a new VG and copy data over in chunks (I've added a new disk so I have free space in the VG).

Sadly I can't provide any command output since both /usr and /var is on the VG. I'm using Linux 2.6.10 with device-mapper 1.00.21 and LVM 2.00.33.

//Magnus

#1 lore raw
Quoted 6 lines · Magnus Nilsson

Through pvmove'ing parts of the PV I've narrowed it down to PE #14858 of 38154 4MB PE's.

Is there any way of just skipping that last PE and let me repair the filesystem afterwards? Perhaps by vgcfgrestore'ing an edited backup, excluding the broken PV?

Firstly, pvmove --abort abandons a pvmove cleanly.

Two ideas:
Use dmsetup directly to hide the problematic PE.
e.g. dmsetup table vg1-lvol1 to display the table,
Work out which sector(s) are the problem and replace them with an 'error' line

Edit a (current) VG backup file to 'move' 1 extent elsewhere.
e.g. 1 segment containing the problematic extent turns into 3 segments

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 18 lines · Alasdair G Kergon
Quoted 6 lines · Magnus Nilsson

Through pvmove'ing parts of the PV I've narrowed it down to PE #14858 of 38154 4MB PE's.

Is there any way of just skipping that last PE and let me repair the filesystem afterwards? Perhaps by vgcfgrestore'ing an edited backup, excluding the broken PV?

Firstly, pvmove --abort abandons a pvmove cleanly.

Two ideas:
Use dmsetup directly to hide the problematic PE.
e.g. dmsetup table vg1-lvol1 to display the table,
Work out which sector(s) are the problem and replace them with an 'error' line

Quoted 4 lines

Edit a (current) VG backup file to 'move' 1 extent elsewhere.
e.g. 1 segment containing the problematic extent turns into 3 segments

Alasdair

Thanks for the tips.

I did try 'pvmove --abort' before mailing, but since the VG couldn't be found the pvmove couldn't be aborted. I tried using -P with pvmove, but the parameter wasn't recognised.

I managed to fix the problem myself though. I thought that maybe the machine would behave differently if the disk was on a different controller, so I moved the faulty disk from the Promise TX2 controller to the motherboard. The machine still complained about the disk, but at least it didn't hard-lock. That allowed the final pvmove to go through, so I could vgreduce the PV. An fsck.ext3 discovered a couple of FS hickups on one of the 3 LV's, but nothing major.

I hope that I will never have to use your ideas, ever. :)

//Magnus