Operating System - HP-UX
1839816 Members
3265 Online
110156 Solutions
New Discussion

Re: recover VG with multiple disks

 
SOLVED
Go to solution
George Liu_4
Trusted Contributor

recover VG with multiple disks

A vg /dev/vg00 contains three disks, say /dev/dsk/c0t0d0, /dev/dsk/c0t1d0, and /dev/dsk/c0t2d0. Now, looks c0t0d0 is bad and not accessible. the other two are still good. we can still use vgimport to import them. There is any way to recover the contents from the good ones?
14 REPLIES 14
RAC_1
Honored Contributor
Solution

Re: recover VG with multiple disks

Does pvdisplay returns any thing?? (for bad disk)

Can you activate the VG?? (vgchange -a y -q n vgxx)
Do you what partitions (lvs) were residing on the bad disk? If you know that and have enough space on other disks, try moving the data on bad disk(pvmode command) to other two disks.

pvmove -n /dev/vgxx/lvolx source_pv dest_pv

Anil
There is no substitute to HARDWORK
George Liu_4
Trusted Contributor

Re: recover VG with multiple disks

pvdisplay hangs for bad disk.

VG cannot be activated. vgchange returns error

Don't know the lvs info.

Thanks.
Sridhar Bhaskarla
Honored Contributor

Re: recover VG with multiple disks

George,

You could try activing them wiht no quorum mode. You may not be able to recover the data from the lvols that used the failed disk. But the others may be recovered.

vgchange -a y -q n vgxx

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
RAC_1
Honored Contributor

Re: recover VG with multiple disks

Try actvating vgxx with qourm override.

vgchange -a y -q n vgxx.

Once activated, check which lvs reside on faulty disk. Mount those LVS with read only.

mount -F vxfs -o ro /dev/vgxx/lvolx /mount_point.

Then try copying data somewhere else.

Anil
There is no substitute to HARDWORK
George Liu_4
Trusted Contributor

Re: recover VG with multiple disks

activate is successful, but couldn't mount. got I/O error
Todd McDaniel_1
Honored Contributor

Re: recover VG with multiple disks

You must remove that bad disk or replace it for the vg to be able to mount.

vgreduce the disk out and then you will be able to mount.

Also, mv /etc/lvmtab /tmp/lvmtab, then vgscan again to make a new one.



-----------------------------------------------------------
From the man page for vgreduce....


Force reduction of missing PVs from volume group: vg01
vgreduce -f /dev/vg01
Removes the physical volume from the volume group when it is still in
the lvmtab file, but it is currently marked as missing from the volume
group: vg01
vgreduce -l /dev/vg01

The following messages will appear after missing PVS has been removed
successfully:

PV with key 0 successfully deleted from vg /dev/vg01

Repair done, please do the following steps.....:

1. Save /etc/lvmtab to another file.

2. Remove /etc/lvmtab.

3. Use vgscan -v to recreate /etc/lvmtab.

4. NOW use vgcfgbackup(1M) to save the LVM setup.


Unix, the other white meat.
George Liu_4
Trusted Contributor

Re: recover VG with multiple disks

At this time. There is already no record for this vg in /etc/lvmtab. BTW, vgimport did something as vgscan for the file.
Sridhar Bhaskarla
Honored Contributor

Re: recover VG with multiple disks

Hi,

I haven't seen vgimport running vgscan anytime so far.

Try importing it back. It may complain that the disks are missing. Activate it using the above command and try to mount the logical volumes. If all the logical volumes have shares on the failed disk, then you will not be able to mount any of them. This is a famous draw-back of striping, which I wish you didn't have.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Todd McDaniel_1
Honored Contributor

Re: recover VG with multiple disks

Did he say he striped them?

I read it as vg00 has 3 disks with maybe 2 mirrors...
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: recover VG with multiple disks

That is exactly why you cant mount it. your LVM info is messed up.

When you have this type of problem, the disk wont be in the lvmtab...

You will need to clear that disk from the Lvol before you can use it.
Unix, the other white meat.
Sridhar Bhaskarla
Honored Contributor

Re: recover VG with multiple disks

vgreduce -f will work only if the PV doesn't have any physical extents alloted to the logical volumes. So, if you want to use that command, you will need to take out the PV from the definitions of all logical volumes. It's a painful process. Run 'lvdisplay -v -k /dev/vgxx/lvolx' and it will show a number in the "PVx" column related to missing PV. Then you need to use 'lvreduce -k ...' command to reduce the PV. That works good for mirror disk. But if it is not a mirror disk but the LV has data on it, then you will have to remove the LV. Even it is the same case with vgscan.

You will not be able to mount the LVs that have data on the failed disk.

If you still have old lvmtab, put it back and try 'vgchange -a y -q n vgxx'. Only logical volumes that didn't use that failed disk can be mounted.

-Sri

PS: He didn't say his LVs were striped. That was only a comment.
You may be disappointed if you fail, but you are doomed if you don't try
George Liu_4
Trusted Contributor

Re: recover VG with multiple disks

Sorry forgot to mention it was striped
Michael Tully
Honored Contributor

Re: recover VG with multiple disks

If you were using stripes for all LV's across all three disks, you will need to get your backup tapes, as I don't you will mount anything. Your best bet would to recreate the VG/LV's and restore from tape.
Anyone for a Mutiny ?
Todd McDaniel_1
Honored Contributor

Re: recover VG with multiple disks

No points here please..

MY 2 cents is DONT stripe your vg00... that is very strange concept to me. Mirroring should be sufficient.

And saves you from this heartache the next time a disk fails... it wont take your box down.

Disks will fail and it isnt pretty when you cant boot.
Unix, the other white meat.