1832929 Members
2349 Online
110048 Solutions
New Discussion

Re: /dev/vg00 missing

 
Ken Penland_1
Trusted Contributor

/dev/vg00 missing

hopefully this one will be an easy one to fix, but I cannot figure it out.

Somehow /dev/vg00 was removed from the system, however the system is still up and the file systems are still mounted... is there a way to restore this information?

lvmtab and everything else should be intact, just the "stuff" in /dev is gone.

Please help!
'
13 REPLIES 13
Robert-Jan Goossens
Honored Contributor

Re: /dev/vg00 missing

Ken,

"just the "stuff" in /dev is gone"

is all the info in /dev gone, or "only" the vg00 directory ?

Robert-Jan
Pete Randall
Outstanding Contributor

Re: /dev/vg00 missing

Ken,

See Patrick's responses in this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=919439


Pete

Pete
Ken Penland_1
Trusted Contributor

Re: /dev/vg00 missing

just /dev/vg00 is gone, and thanks, that puts me on the correct track...however I cannot vgimport because vg00 is active, I cant vgchange it because it is "busy"

so that means I would have to boot off an alternate source to do this...since this is a new system we are trying to stand up, it would probably be faster just to reignite.
'
Robert-Jan Goossens
Honored Contributor

Re: /dev/vg00 missing

How about restoring the /dev/vg00 directory from the ignite tape and rebooting the server ?
Ken Penland_1
Trusted Contributor

Re: /dev/vg00 missing

how can you restore from an ignite tape? that would really be helpful!
'
Robert-Jan Goossens
Honored Contributor

Re: /dev/vg00 missing

Ken,

Check Cheryl's answer in this thread.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=72396

Regards,
Robert-Jan
vinod_25
Valued Contributor

Re: /dev/vg00 missing

hi

Try ...
vgexport -m /vg00.map /dev/vg00

mkdir /dev/vg00
mknod /dev/vg00/group c 64 0x000000
vgimport -m /vg00.map /dev/vg00 /dev/dsk/cXtYdZ
vgchange -a y vg00
vgcfgbackup vg00

regards

Vinod k
Bill Hassell
Honored Contributor

Re: /dev/vg00 missing

Once the system is booted, all the device files and directories for vg00 have done their job--that is, they are not used while the system is running. Only when something new comes along that needs to reference /dev/vg00/ do you need the files. So just pull out your backup tape and restore the /dev/vg00 directory. You can also recreate them by hand as they are always the same (unless you used non-standard names like /dev/vg00/MYvolume3). You need the directory /dev/vg00, the group file and a pair of device files for each lvol. bdf can tell you about the mounted device files, and vgdisplay -v vg00 can tell you about all the lvols by name. Remember that a pair of lvols will be the lvol and the rlvol name with different filetype (blocked vs raw).


Bill Hassell, sysadmin
Devender Khatana
Honored Contributor

Re: /dev/vg00 missing

Hi,

The best way for doing this will be to restore /dev/vg00 from the recent ignite backup and once restored confirm by rebooting the system.

The procedure for restoring -
# mt -f /dev/rmt/0mn rew (rewinds)
# mt -f /dev/rmt/0mn fsf 1 (fast forward)
#cd /
# tar xvf /dev/rmt/0m dev/vg00 (restore directory)
( Notice no rewind device file in first two commands)

If this is interrptued at 4th step for any reason you need to follow it from 1 again.

HTH,
Devender
Impossible itself mentions "I m possible"
Michael Weinstock
Occasional Advisor

Re: /dev/vg00 missing

Hi,

Specifically in relation to Bill Hassell's suggestion to manually recreate the missing device files, I'm interested in more information about how to recreate the missing device files pertaining to vg00's logical volumes.

I have a full list of vg00's lvols from /etc/lvmconf/vg00.mapfile

I understand the need for both character and block device files, but I am unsure as to the major and minor number required for the mknod command ?

Initially I tried:

mknod /dev/vg00/lvol1 b 64 0x000000
mknod /dev/vg00/rlvol1 c 64 0x000000

etc for all lvols ... rebooted, that didnt work... none of the filesystems could be mounted.

I then looked at /dev/vg01 lvol device files as a template and noticed the minor number was different to the group minor number, so I recreated all the lvol and rlvol device files in vg00 using a minor number of 0x000001

Now, /stand can be mounted, but all the other filesystems (which are vxfs) cannot be mounted ?

This is a new system and I had just finished installing applications and data so there is no backup as yet to restore from... had not got that far !

Any ideas as to how to proceed ?

Cheers,

Michael Weinstock
Patrice Le Guyader
Respected Contributor

Re: /dev/vg00 missing

Hi Michael,

I think you can only mount /stand because it's lvol1. You've done a mknod with 0x000001.

What I should try is to create lvol and rlvol like this :

group ==> 0x000000
lvol1 and rlvol1 ==> 0x000001 for /stand
lvol2 and rlvol2 ==> 0x000002 for swap
lvol3 and rlvol3 ==> 0x000003 for /
lvol4 and rlvol4 ==> 0x000004 for /opt
lvol5 and rlvol5 ==> 0x000005 for /tmp
lvol6 and rlvol6 ==> 0x000006 for /usr
lvol7 and rlvol7 ==> 0x000007 for /var

Perhaps you'll be able to mount your vxfs file systems.

Hope this helps
Kenavo
Pat

Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Bill Hassell
Honored Contributor

Re: /dev/vg00 missing

Recreating the missing device files is actually very easy. Assuming vg00 has standard lvol1, lvol2, lvol3, lvol4, etc names, you can do it with a mini-script:

umask 077
for LV in 1 2 3 4 5 6 7 8
do
mknod /dev/vg00/lvol$LV b 64 0x00000$LV
mknod /dev/vg00/rlvol$LV c 64 0x00000$LV
done

You can type all of that at the shell prompt or put it into a file. This assumes that you have 8 lvols (1 2 3 4 5 6 7 8) -- adjust as necessary.

VERY IMPORTANT: umask is probably not set in /etc/profile which makes all of your device files vulnerable to being removed accidently (or on purpose from a hacker). You should set umask to 077 for root, and fix all of your disk device files to no reaqd or write by users UNLESS you are also running Informix, Sybase or Oracle in raw access mode. The default HP-UX installation has no umask (very bad) so anything you create as root is wide open. This is also a flag to look at ANYTHING with world writability:

find / -perm -002

Now the following directories should be 777 (rwxrwxrwx): /tmp and /var/tmp, and the files in /usr/share/man can be 666 (rw-rw-rw). Otherwise, question everything that shows up in the find listing 'cause every login on the system can trash the contents of those items.


Bill Hassell, sysadmin
Michael Weinstock
Occasional Advisor

Re: /dev/vg00 missing

Thankyou Pat and Bill ! That did the trick.

One system alive and kicking and now safely backed up :)