1844063 Members
2894 Online
110227 Solutions
New Discussion

Corrupted disk in LVM

 
Amit Manna_6
Regular Advisor

Corrupted disk in LVM

Hi,

If one of the disk in a logical volume gets corrupted. how can we recover the data of the disk.

Anybody please help.

5 REPLIES 5
Mark Grant
Honored Contributor

Re: Corrupted disk in LVM

Unortunately, the most likely place you will recover this data is from your backup tapes unless the logical volumes are mirrored.

It's always wise to mirror your logical volumes.

Never preceed any demonstration with anything more predictive than "watch this"
Amit Manna_6
Regular Advisor

Re: Corrupted disk in LVM

Could yo please let me know how to replace the disk and put the data from backup in the new disk and put it in the same logical volume as a mirror.

Shaikh Imran
Honored Contributor

Re: Corrupted disk in LVM

Hi,
Reply for you 2nd post:

If it is mirrored just connect the disk,
1)pvcreate on that disk
2)include the disk in the same volume group by vgextend
3) lvextend -m 1 on all the LV's
Example:
Say you vg01 is having one disk
/dev/dsk/c4t5d0
Your replaced disk is /dev/dsk/c4t5d3 and you want the mirror on this disk.
pvcreate -f /dev/rdsk/c4t5d3
vgextend vg01 /dev/dsk/c4t5d3
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c4t5d3

This will create the mirror on the new disk
you can see this by lvdisplay -v

But for the above operation you should have mirror disk installed which is a seperate product.


Regards

I'll sleep when i am dead.
Bharat Katkar
Honored Contributor

Re: Corrupted disk in LVM

Amit,
Actually your logical volume is part of VOlume group and not directly the disk.

Disk is added into volume group and space of VG gets increased and then you create LV into VG. So can't say which lv is using which disk that is why it is called as logical volume.

But finally it depends on how you have configured it.
For e.g. If you have only 1 lv in VG say vg01 and only 1 disk configured for that VG01 then what you can do is replace the disk the faulty disk, remove earlier disk from VG01, then add new disk to VG01, create similar LV, filesystem and restore filesystem which resides in that particular LV.

If you provide info about your VG and LV configuration then it will usefull to give proper workaround.
Suppose your affected disk belongs to VG01 then post this output:
#vgdisplay -v vg01
And possibly
#lvdisplay -v lvname
this output for all lv's that belongs to VG01

Regards,
You need to know a lot to actually know how little you know
Robert-Jan Goossens
Honored Contributor

Re: Corrupted disk in LVM

Hi,

Could you post

# vgdisplay -v

Regards,
Robert-Jan