Operating System - HP-UX
1752619 Members
4421 Online
108788 Solutions
New Discussion юеВ

Re: /dev/vg00 in /etc/lvmtab miss

 
stephen peng
Valued Contributor

/dev/vg00 in /etc/lvmtab miss

dear all,
vg00 is consisted of four pv, and one or two of the pvs were failed. after lvreduce, and assume that i delete the orginal /etc/lvmtab, i run vgscan to re-produce the /etc/lvmtab, when i run "strings /etc/lvmtab", the first line of the output, ought to be /dev/vg00, has turned out to be /dev/, right now i run "vgdisplay vg00", it said there is no /dev/vg00 in /etc/lvmtab. i have found the right way to delete the failed pv link in /etc/lvmtab of vg00, but how can i retrieve the right /etc/lvmtab without a backup? it is so weird to me and makes me so confused.
look forward to your reply.

stephen
11 REPLIES 11
Yang Qin_1
Honored Contributor

Re: /dev/vg00 in /etc/lvmtab miss

Did you run vgreduce to remove broken disk from vg00? Can you find back orignal /etc/lvmtab? You may read man page for vgreduce, hope it will help.
stephen peng
Valued Contributor

Re: /dev/vg00 in /etc/lvmtab miss

yang,
hi. vgreduce won't work in such circumstance cause system could not query the failed pv. i just want to know how i can retrieve the /etc/lvmtab!
thanks
Shardha
Valued Contributor

Re: /dev/vg00 in /etc/lvmtab miss

hi,

Rename lvmtab as lvmtab.back and then run vg scan hope full it will work.

Shardha.
stephen peng
Valued Contributor

Re: /dev/vg00 in /etc/lvmtab miss

shardha,
i had told that if i run vgscan in this situation, /dev/vg00 in /etc/lvmtab would change to /dev/, and this was not correct, i want to know how i can retrieve a good /dev/lvmtab!
Khairy
Esteemed Contributor

Re: /dev/vg00 in /etc/lvmtab miss

Hi stephen,

if possible, go to single lvm mode by interupting normal boot process and choose to interact with ISL.

At isl prompt, run..
ISL> hpux -lm

Then deactivate vg00.
# vgchange -an vg00

Export vg00
# vgexport vg00

Remove or replace the failing disk. Perform vgimport back. Assuming your 1st vg00 disk is c1t15d0.

# mkdir /dev/vg00
# mknod /dev/vg00/group c 64 0x000000
# vgimport vg00 /dev/dsk/c1t15d0

Activate vg00
# vgchange -a y vg00

Verify vg00
# vgdisplay vg00

Try mount 1 of the vg00 lv.
# mount /usr

If OK. Then boot to multiuser mode.

Hope this will help you! If it works, don't forget assign some points to me.

Rgds
Yang Qin_1
Honored Contributor

Re: /dev/vg00 in /etc/lvmtab miss

Hi, Stephen, If you can restore an old lvmtab which contain information of vg00 then you can use vgreduce to remove the broken disk. vgreduce man page says: "-f vg_name force reduction of missing physical volume(s) in a given volume group. This option does not require a physical volume (PV) to be supplied on the command line. vgreduce obtains the name of each physical volume (PV) belonging to the volume group from the file /etc/lvmtab. It then reads the LVM structures from each PV and compares these with that held by the kernel to work out which PVs are missing."

To re-create (instead of retrieve) lvmtab, normally people runs "vgscan". Apparently, it does not work for you. When the server is rebooted, and if there is no lvmtab, system will create one during the reboot. However, if your vg00 is corrupted, to reboot your server, the risk will be -- you cannot start your server any more.

Yang
stephen peng
Valued Contributor

Re: /dev/vg00 in /etc/lvmtab miss

dear all,
maybe you won't catch what i said, it seems that Khairy's reply does help, consider that after i operate using Khairy's method, then i would get an /etc/lvmtab, containing only the information of /dev/vg00, so how can i retrieve the other vgs' information in /etc/lvmtab? i must be a long and hard process. do i need to vgexport all the vgs before, and after i retrieve the /etc/lvmtab containing /dev/vg00, vgimport all the vgs again and run vgscan to get a perfect /etc/lvmtab? i really need to get the whole correct procedure to avoid accident!

Yang Qin,
in this circumstance, you should use vgreduce -l instead of -f to reduce the failed link, if you use -f, you will be told that the os could not query the failed pv link, and error will follow when you run vgscan in this situation; when you use -l, it would delete the failed link in vg and update the /etc/lvmtab at the same time.

thanks a lot!
Yang Qin_1
Honored Contributor

Re: /dev/vg00 in /etc/lvmtab miss

I used -f option to remove broken/missing disks and I was able to re-create lvmtab after running "vgreduce -f /dev/vg00".

You cannot use -f option because you do not have a lvmtab. If you can restore one from your old backup give it a try.

You you really want to boot the system to LVM maintenance mode and re-create lvmtab for vg00. You cannot need to be warried about the other VG in lvmtab. When you boot your system to multi-user mode the system will create lvmtab with all VGs for you.

To be on the safe site, before you start print output of vgdisplay -v from the other VGs. Create map files with vgexport -p -m file_name (vg01.map, vg02.map ...) in case you lose everything, you still have a change to import them back.

Yang
Khairy
Esteemed Contributor

Re: /dev/vg00 in /etc/lvmtab miss

hi stephen,

once you got the vg00 right, then go to multi user mode. From there just run vgscan and all the remaining vgs will be autodetected. Run strings /etc/lvmtab to verify this.

Rgds