cancel
Showing results for 
Search instead for 
Did you mean: 

running vgscan with system up?

 
Highlighted
Steve Howie
Occasional Advisor

running vgscan with system up?

Hi

I need to run vgscan to recreate /etc/lvmtab to clear up the old 'duplicate minor number' error when trying to create a new Volume group using SAM.

I've run it using the -p option to preview any problems, and yes, it does say that the new minor number will conflict with that assigned to an old, deleted volume group.

Do I have to run vgscan with the system in single user mode, or can it be run in multi-user mode? I will be backing up lvmtab - I just need to know if vgscan needs to be run in single user mode.

Any help appreciated.

Scotty

(HPUX 11.11)
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: running vgscan with system up?

Hi Scotty:

> I need to run vgscan to recreate /etc/lvmtab to clear up the old 'duplicate minor number' error when trying to create a new Volume group

You need to 'vgexport' a volume group to remove it from the '/etc/lvmtab' and remove the device files in '/dev'.

If, for some reason, there is no volume group to export, but the device files with the minor number you want remain orphaned, simply remove those device files.

Posting the *actual* messages from:

# vgscan -p -v

...would be useful to see as would:

# ls -l /dev/vg*

Regards!

...JRF...
S. Ney
Trusted Contributor

Re: running vgscan with system up?

I did a vgscan -v on an overnight maintenance a few years ago while the system was relatively quiet. It was on an 11.11 system and I did not have to go into single user mode. I followed The fix listed in certified document ULVMKBRC00008020.
To resolve the errors:

1. Check to see if the /dev/slvmvg file exists:

# ll /dev/slvmvg

Note: If the file "does exist", then perform Steps
A, B, C, D, and E.

If the file "does not exist", perform Steps B, C, D,
and E. (do not perform Step A).

2. Perform the following commands:

A. # mv /dev/slvmvg /tmp

B. # mv /etc/lvmtab /etc/lvmtab.currentdate

C. # vgscan -v

D. # strings /etc/lvmtab
I did not do the vgchange -a y vg00 step.
Note: This command verifies that everything is correct.

E. # vgchange -a y /dev/vg00

F. # vgdisplay -v /dev/vg00
Steve Howie
Occasional Advisor

Re: running vgscan with system up?

Hi James

I've attached the output from vgscan -v -p

It looks like an old volume group /dev/vx03 is the one with the minor number which conflicts with any new attempts to create a VG. We only have /dev/vx01, /dev/vx02 and /dev/vx06 in use at the moment. /dev/netapp was the newest attempt.

Here is the device file listing:

# ll /dev/vx*/group
crw-r--r-- 1 root sys 64 0x000000 Jun 11 2004 /dev/vx01/group
cr--r--r-- 1 root sys 64 0x010000 Apr 21 2008 /dev/vx02/group
crw-r--r-- 1 root sys 64 0x020000 Apr 21 2008 /dev/vx03/group
crw-r--r-- 1 root sys 64 0x030000 Apr 21 2008 /dev/vx04/group
crw-r--r-- 1 root sys 64 0x040000 Apr 21 2008 /dev/vx05/group
cr--r--r-- 1 root sys 64 0x050000 Jun 11 2004 /dev/vx06/group
cr--r--r-- 1 root sys 64 0x020000 Jun 7 14:46 /dev/vx07/group


So I really need to toss vx03, vx04, vx05 and vx07 .... vx03 is the culprit though

thanks, Steve
raghu_14
Advisor

Re: running vgscan with system up?

Hi,

Yes, you need to toss vx03, vx04, vx05 and vx07 using vgchange -a n / vgexport commands. You may toss up /dev/netapp and recreate it if needed with different minor number.

If you are using Sept 2008 update of 11.31 or onwards, then you don't have to manually create the volume group special files (using mkdir/mknod), but vgcreate command will take care of creating the required device special files for you.

Regards,
Raghu
A ship in the harbor is safe, but that is not what ships are built for.
Steve Howie
Occasional Advisor

Re: running vgscan with system up?

Hi Raghu

vgscan made no difference, since the existing active volume groups are the only entries in /etc/lvmtab.

I tried vgexport but the command says that it can't find the volume group in the /etc/lvmtab. I only have entries for vx01, vx02 and vx06 ( Three active volume groups). SAM tells me there are no deactivated volume groups in the system. I'm cleaning up a mess that was left from a couple years ago.

The HP tech working on this asked me to try vgexport to removed the device files - if that fails, remove them manually.

So would this be all thats needed for manual removal of the stale device file entries for volume group vx03 ?

rm -fR /dev/vx03/*

Thanks

Scotty
James R. Ferguson
Acclaimed Contributor

Re: running vgscan with system up?

Hi (again) Scotty:

> So would this be all thats needed for manual removal of the stale device file entries for volume group vx03 ?
rm -fR /dev/vx03/*

Yes:

# rm -rf /dev/vx03

Regards!

...JRF...
Steve Howie
Occasional Advisor

Re: running vgscan with system up?

Hi once again James

Never had a chance to try rm -fR, but the HP tech working on the case told me you should do a

rmsf -a /dev/vx03/*

to get all the special files under vx03 - if you omit the '*' at the end, it will sqwak about vx03 not being a special file

Then follow with

rmdir /dev/vx03

to actually remove the directory itself (not a special file).

5 points to you for your original reply!

And a thank you to everyone else for your input - I can now create a Volume group.

Scotty
Steve Howie
Occasional Advisor

Re: running vgscan with system up?

Stale device file entries removed using rmsf -a followed by rmdir to remove container folder