1753795 Members
7096 Online
108799 Solutions
New Discussion юеВ

Logical Volume problems

 
SOLVED
Go to solution
Gary L
Super Advisor

Logical Volume problems

Hi

last year my colleague create the "vg08" and lvcreate the "lvsys8" mount on /u08. But yesterday I found the lvsys8 disappear,
# find / -name lvsys8 couldnot find it and no any LV info in /dev/vg08.
# Vgdisplay -v /dev/vg08 no any lv info
# pvdisplay /dev/dsk/c20t0d6
--- Physical volumes ---
PV Name /dev/dsk/c20t0d6
VG Name /dev/vg08
PV Status available
Allocatable yes
VGDA 2
Cur LV 0
PE Size (Mbytes) 16
Total PE 31995
Free PE 0
Allocated PE 31995
Stale PE 0
IO Timeout (Seconds) default
Autoswitch On
The output displayed 31995 have been allocated to LV, but Cur LV = 0, no LV in the PV

so I have re-lvcreated lvsys8 for vg08, but system warnning
lvcreate: Not enough free physical extents available.
Logical volume "/dev/vg08/lvsys8" could not be extended.
Run the "lvextend" command to create space on the Logical Volume.
# ll /dev/vg08
total 0
crw-r----- 1 root sys 64 0x080000 Feb 26 12:01 group
brw-r----- 1 root sys 64 0x080002 Feb 28 11:28 lveva8
crw-r----- 1 root sys 64 0x080002 Feb 28 11:28 rlveva8

the number is "2" 0x080002, I think it must have 0x080001 old lv exist, but I could not find it and del it. My new created LV no space in this Vg08, How I can do, urgent!
thank you very much ITSC experts.
15 REPLIES 15
Steven E. Protter
Exalted Contributor
Solution

Re: Logical Volume problems

Shalom,

strings /etc/lvmtab

Seems that the disk that was holding this logical volume is missing.

Perhaps you should run dmesg and check /var/adm/syslog/syslog.log for error messages and see why the logical volume disappeared and correct this problem before trying to re-create.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Gary L
Super Advisor

Re: Logical Volume problems

Hi Steven E. Protter,
thank you very much for your quickly reply and your kindly helps

# strings /etc/lvmtab output info as below:
/dev/vg00
/dev/dsk/c2t1d0
/dev/dsk/c2t0d0
/dev/vg01
}B;\
/dev/dsk/c20t0d0
/dev/vg02
/dev/dsk/c20t0d1
/dev/vg03
/dev/dsk/c20t0d2
/dev/vg04
/dev/dsk/c20t0d3
/dev/vg05
/dev/dsk/c20t0d4
/dev/vg06
/dev/dsk/c20t0d5
/dev/vg08
}E$Z
/dev/dsk/c20t0d6

vg08 and c20t0d6 these vg and pv have some problems.

I have checked dmesg and syslog, could not found the reason of lv disappear, so whether I could remove the lvsys8 both old and new and remove whole vg08 and recreate the vg08 and recreate the lvsys8. If i could, would you pls tell me the safty way and step to remove the lv and vg,
thanks
Court Campbell
Honored Contributor

Re: Logical Volume problems

You might try this:

unmount /u08

vgexport /dev/vg08

this will remove the info from /etc/lvmtab and the /dev/vg08 dir and any special files in that directory. But the volume group info on the disk will still be there.

then

mkdir /dev/vg08
mknod /dev/vg08/group c 64 0x080000
vgimport vg08 /dev/dsk/c20t0d6

this will add the volume group and scan any volume group and logical volume info off the disk. Hopefully the lvol info will be read and your lvsys8 will be there.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Robert-Jan Goossens
Honored Contributor

Re: Logical Volume problems

Hi Gary,

If you use these commmand you will have a fresh vg and lv, you will need to restore your data from backup.

# bdf | grep lveva8
# umount (the lveva8 filesystem)
# vgchange -a n /dev/vg08
# vgexport /dev/vg08

# mkdir /dev/vg08
# mknod /dev/vg00/group c 64 0x080000
# pvcreate -f /dev/rdsk/c26t6d0
# vgcreate /dev/vg08 /dev/dsk/c20t0d6
# lvcreate -L XXXX -n lvsys8 /dev/vg08
# mkdir /u08
# mount /dev/vg08/lvsys8 /u08
edit the /etc/fstab and add the newly created filesystem.
Restore your data from backup.

Hope this helps,
Robert-Jan
Denver Osborn
Honored Contributor

Re: Logical Volume problems

Sounds like someone simply removed the device special files for lvsys8.

To confirm, pvdisplay -v /dev/dsk/c20t0d6... you'll see "???" displayed for the PE to LE mappings instead of the expected "/dev/vg08/lvsys8". This means the lvol wasn't removed via lvremove, just the device special files were removed.

Recreate the block and character device special file to resolve. You can either vgexport/vgimport or mknod. The tricky part about creating the device special files is trying to figure out what the minor number would have been... I'd guess 0x??0008 based on the old lvname. where 0x?? = 1st 2 hex from the vg's group file. (ll /dev/vg08/group)

Safest bet is for you to export and import. When you export, the map file won't contain your "missing" lvol. However, it will be there after the import because it was never removed. Your import will display something like "begin import... lv number "X" found but not in the map file... lv lvolX has been added"

To export import and get your lv back:

vgchange -a n /dev/vg08
vgexport -v -s -m /tmp/vg08.map vg08
mkdir /dev/vg08
mknod /dev/vg08/group c 64 0x??0000
#<-use same "0x??" number as before export
vgimport -v -s -m /tmp/vg08.map /dev/vg08
vgchange -a y /dev/vg08

Hope this helps,
-denver
Denver Osborn
Honored Contributor

Re: Logical Volume problems

d'oh. this was a no brainer.. ;)

I missed the last 10 lines of your post. You did an lvcreate and it incremented to 02. The original lvol was 01.

Forget export/import.

mknod /dev/vg08/lvsys8 b 64 0x080001
mknod /dev/vg08/rlvsys8 c 64 0x080001

After you mknod, it should be good to go.

-denver


Denver Osborn
Honored Contributor

Re: Logical Volume problems

Hi Gary, I stumbled across your initial thread... what prompted you to run vgscan then eventualy a vgcfgrestore to c20t0d6? If your mount of lvsys8 fails after mknod, are you expecting the lun to have data on it?

-denver
Gary L
Super Advisor

Re: Logical Volume problems

Hi buddies

thank you very much for your kindly helps, thanks Steven E. Protter, Court Campbell, Robert-Jan and Denver.

As you know, yesterday afternoon ITRS Forums have some problems, I could not access and got your information, so I tried use vgcfgrestore make the PV status from unavailable to available. And used vgexport and vgimport to fixed LV "missing"'s problems, problem be fixed. This morning I check the forums, ha ha ha, we thought the same things. But i met a little bit problems, when I used vgimport, the system restored lvol1 and rlvol1 LV not my past lvsys8 and rlvsys8, but it was a happy things I found out the missing LV, but i don't know whether this lvol1 was my past lvsys8 and I have no idea how to rename LV, so I used stupid way, removed the lvol1 and re-created the lvsys8 for /dev/vg08, would you please tell me a right way to vgexport and vgimport lvsys8 directly not lvol1. Thanks!
Yes, the reason of the LV missing Vgdisplay couldn't see it but LV still in disk was someone rm the lvsys8 didn't use lvremove, sigh!

Thanks again! I hope I could give you 100 points
Gary L
Super Advisor

Re: Logical Volume problems

one more question:

after vgexport/vgimport, I got the lvsys8 and rlvsys8. Whether I should do:

#newfs -F vxfs -o largefiles /dev/vg08/rlvsys8

and mount lvsys8 /u08 ?

-gary