1753666 Members
6016 Online
108799 Solutions
New Discussion юеВ

Re: LVM failure

 
SOLVED
Go to solution
Naoyuki
Advisor

LVM failure

Supposed vg01 consists of diskA and diskB and vg01 has lvol1 which has extents on both diskA and diskB but no data on DiskB.

Does anyone know what will happen if DiskB fails physically?
Lvoll is not usuable even after disk replacement and vgcfgrestore?

I tryed destroy diskB but OS didn't recognize diskB had problem and I could continue to use lvol1.

I use lvol1 as filesystem.

Thanks in advance.
10 REPLIES 10
Jean-Louis Phelix
Honored Contributor

Re: LVM failure

Hi,

What do you mean by 'I tryed destroy diskB' ? If you did something like a dd with vg01 active, then you will get in trouble only when LVM will access data on DiskB or if you deactivate/reactivate vg. If you don't need space on DiskB, you should rather use it to mirror DiskA.

Regards.
It works for me (┬й Bill McNAMARA ...)
twang
Honored Contributor

Re: LVM failure

Is lvoll still usuable if you remove physical volume diskB from volume group /dev/vg01:
# vgreduce /dev/vg01 /dev/dsk/(diskB)
Bernhard Mueller
Honored Contributor

Re: LVM failure

Hello,

so I understand you have a filesystem across both disks but it is NOT mirrored.

then if diskB fails you will have be prepared to restore your data, because HOW could you be sure that you have really no data on diskB?

In your test case you probably destroyed the LVM Header by doing a dd on the raw device of diskB then redid pvcreate on diskB and a vgcfgrestore.

this only worked because you just recently set up the filesystem and therefore you were lucky that you had no data on it. Else you would have been into a restore situation.

Regards,
Bernhard
Massimo Bianchi
Honored Contributor

Re: LVM failure

Hi,
as far as i has experience, when diskB fail you will no longer have access to the lvol.

You may be able to umount it, if you are lucky, but not to mount it any more.

Even after a disk-replacement and vgcfgrestore, because vgcfgrestore does a restore of only the metainformation, not the data inside the lvol.


How did you do your test ?
if you did a dd over the disk, and you tried not to access the part of lvol on diskB, easily you saw nothing, you must do some I/O.

Did you see any message in syslog ?

To recover the situaion, after the vgcfgrestore, you might have to do an lvreduce and after a resize of FS, but you may lose data.

HTH,
Massimo
Bill McNAMARA_1
Honored Contributor

Re: LVM failure

lvdisplay -v /dev/vg01/lvol1

this will show you on which disk lvol1 resides. maybe not all of it is screwed!

vgdisplay -v /dev/vg01
to check the vg state
the lvol will be usable after disk failure + vgcfgrestore, however, all data on the lvols' filesystem will need to be restored:
cat /etc/fstab
to view the potentially screwed filesytems on that lvol.
It works for me (tm)
Naoyuki
Advisor

Re: LVM failure

Hi.

Thank you for all your replies.

I destroyed diskB using dd.
Because I destroyed part of diskB and there was no I/O on that bad area, I think I still could use it.

If I understand what you all said correctly,
if there is no data on diskB, then lvol1 is still usable after disk replacement and vgcfgrestore.
Anyway, probably some data on diskB, so lvol1 has to be restored.

Am I saying right?
Jean-Louis Phelix
Honored Contributor
Solution

Re: LVM failure

hi,

In fact, if you use vgcfgrestore on the disk after replacement, you will correct problems at LVM level, but at filesystem level you will still have missing structures. If you really don't had data on it, perhaps a fsck could fix. The clean way would be newfs and restore data.

Regards.
It works for me (┬й Bill McNAMARA ...)
Naoyuki
Advisor

Re: LVM failure

Yes, come to think of it, there is no way to confirm there is no data on diskB.
Probably some data on diskB and could cause a problem when that bad block is accessed.

Thanks again.
Massimo Bianchi
Honored Contributor

Re: LVM failure

Hi,
sorry for previous posting, i didn't see that lvol1 had no data on diskB... i was missing a good black coffee:).

if it has no data, then lvol1 will be usable.

After the vgcfgrestore remember to issue a "vgchange -a y" to vg01, because otherwise it will not see the restored disk.

You can check if you have data on diskB using lvdisplay -v /dev/vg01/lvol1.


If you have no PE on that disk, using vgreduce you should be able to remove all problems.

HTH,
Massimo