Operating System - HP-UX
1854905 Members
2672 Online
104105 Solutions
New Discussion

Re: a lv had been removed. :(

 
Ryan Gu
Frequent Advisor

a lv had been removed. :(

Somebody want to change a lv name,so he did it by mv cmd.But it's very unpleasent that another lv's block file had been overwrited.How can I do to recovery the block file?
eg:
brw-r----- 1 root sys 64 0x00000a Mar 3 12:46 patch
crw-r----- 1 root sys 64 0x00000a Mar 3 12:46 rpatch
now,the rpatch is lost.I only have rpatch.
Ryan Gu
3 REPLIES 3
Michael Steele_2
Honored Contributor

Re: a lv had been removed. :(

See what's in /etc/lvmconf and restore if pleased. To list out:

vgcfgrestore -f /etc/lvmconf/vg##.conf -l

To restore:

vgcfgrestore -n /dev/vg## /dev/rdsk/cXtYdZ

Also see what's still in the lvm header on each disk:

vgexport -v -s -p -m /tmp/vg##_map /dev/vg##

vi /tmp/vg##

If happy then:

vgexport -v -s -p /tmp/vg##_map /dev/vg##

-and-

mkdir /dev/vg##
mknod /dev/vg##/group -c 64 0x0000
vgimport -v -s -m /tmp/vg##_map /dev/vg##
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: a lv had been removed. :(

That's a typo:

If happy then:

vgexport -s -p -m /tmp/vg##_map /dev/vg##

-p = preview
Support Fatherhood - Stop Family Law
S.K. Chan
Honored Contributor

Re: a lv had been removed. :(

You would simply run mknod to recreate that file. Assuming this is in vg01 ..
# cd /dev/vg01
# mknod /dev/vg01/patch b 64 0x00000a
# chmod 640 patch