1847985 Members
6283 Online
104022 Solutions
New Discussion

Re: VG activation

 
SOLVED
Go to solution
John Jayaseelan
Super Advisor

VG activation

Hi,

When a VG is created, the following are done

- The directory is created below /dev for the VG
- /etc/lvmtab file is modified to include the VG info with PV's

Is there anything else done during VG creation?
What is actually happening during the VG activation and how system knows the specified VG is activated or not?

Thanks
John Jayaseelan
15 REPLIES 15
Mark Grant
Honored Contributor
Solution

Re: VG activation

Actually, the directory is not created in the /dev directory. You have to create it yourself. You then have to "mknod group c 64 0x01000 (or some unique number)" in that directory.

/etc/lvmpvg might be updated if you are using physical volume groups.

I have no idea exactly what happens in activation but my guess is a kernel table is updated to reflect that the volume group is active on this machine and that this fact is also written to every physical volume in the volume group.

Just a guess mind.
Never preceed any demonstration with anything more predictive than "watch this"
Robert-Jan Goossens
Honored Contributor

Re: VG activation

Hi John,

To have the volume groups activated, check the
/etc/lvmrc file for the parameter AUTO_VG_ACTIVATE.

Setting AUTO_VG_ACTIVATE to 1 the volume groups will be activated.

Hope this helps,
Robert-Jan
Massimo Bianchi
Honored Contributor

Re: VG activation

There are some errors...


you must create, manually, the directory /dev/vgNAME and the group file under it, with an appropritate minor number .

SAM will do this for you, nonethesame...

When you create e vg, the creation data is written on each the disk and in the /etc/lvmtab.

The normal activation is a flag in memory, AFAIK, while the cluster flag is on disk.

HTH,
Massimo


Marco Santerre
Honored Contributor

Re: VG activation

Actually John,

When you want to create a VG, you have to create the subdirectory under /dev and you also have to create the group node file prior to doing the vgcreate command.

Once you have done the vgcreate command, you have included one disk in your VG and this one disk is tagged with the VGID. It is also activated at that time.
Cooperation is doing with a smile what you have to do anyhow.
Helen French
Honored Contributor

Re: VG activation

There is another important thing will happen on the disks. There will be a portion called VGRA (volume group reserved area) on the disks which will have all information about that VG (LV details, PV details, VG information etc). When you activate the VG, the system makes that VG (and the PVs) available (to use)for the system. The system can read the VGRA area of each disk and find out the details about a particular VG
Life is a promise, fulfill it!
John Jayaseelan
Super Advisor

Re: VG activation

Mark,

Is not 'vgcreate' should create the directories and group files?

Please tell what is happening in the system during VG activation, Is there any files are changed so that system knows the particular VG is active or not?

Thanks
Uday_S_Ankolekar
Honored Contributor

Re: VG activation

VG gets created after you added disks (Physical Volumes) in to a VG , You have to create special directory with mknod command
once you create VG you have to create Logical volumes with desired size and then each logical volumes needed to mount on specific file system depends on HFS or VXFS ( Online JFS)

There are lots of documents available on ITRC and docs.hp.com site.

-USA
Good Luck..
Mark Grant
Honored Contributor

Re: VG activation

John,

I think you get quite a complete picture from the above posts from my incomprehensible rambled guesswork throught to Shiju's extremely complete and interesting post.

Basically, if you are doing a "vgcreate" you must create the /dev and the group file yourself. It's not just a good idea, it's the law!
Never preceed any demonstration with anything more predictive than "watch this"
John Jayaseelan
Super Advisor

Re: VG activation

Hi,

Thanks to all for theLoads of useful info within minutes.

The situation is all the PV's are removed from a deactivated VG physically wihtout 'vgremove' and the directory is removed from /dev. What else needs to be done to complete the VG remove.

Thanks
Uday_S_Ankolekar
Honored Contributor

Re: VG activation

You have to create directory with VGname

like mkdir /dev/vgname and mknod /dev/vgname/group c 64 0x080000 (this should be a unique number)

vgcreate command creates a volume group
man vgcreate for more.

vgchange -a y /dev/vgname will activate volume group and it gets activated soon you create it
vgchange -a n /dev/vgname deactivates it.
When you run vgdisplay /dev//vgname if it does not display anything and errors out then that VG is not activated.
strings /etc/lvmtab shows the list of VGs,lvols and PVs in the system

-USA..
Good Luck..
Helen French
Honored Contributor

Re: VG activation

The general procedure to remove a VG is to remove it with 'vgremove' command, by first removing all LVs in that VG. The physical remove of the disks should come only after that. When you remove the VG with 'vgremove' command (or simple vgexport), it will remove the necessary files and update system with that information. You don't need to update/rmeove any file manually.

Also, during vg creation, if you are creating a VG through SAM, you are right. The configuration files (/dev/vgxx and /etc/lvmtab) will get created or updated by SAM. But if you do 'vgcreate' command manually, you need to do everything by yourself. Read the man pages for more information.
Life is a promise, fulfill it!
Marco Santerre
Honored Contributor

Re: VG activation

Hi John,

though I'm not sure I understand what you meant by the VG remove stuff, but here's the thing.

In order to completely remove a VG from a system, all you need to do is vgreduce all but one disk in the VG and then issue the vgremove command, and that will take care of removing the /dev/ VG directory. That's all you need to do to remove a VG from your system.

Now to know if your VG is activated, one quick way to do that is do a vgdisplay of your VG, if it returns any info about the VG, that means it is activated. If it gives you an error message saying it is not activated, then you know it's not activated.
Cooperation is doing with a smile what you have to do anyhow.
Helen French
Honored Contributor

Re: VG activation

I would recommend you to read this LVM document to get a clear picture of all questions you 've asked (TKB #KBRC00010637):

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066580919
Life is a promise, fulfill it!
John Jayaseelan
Super Advisor

Re: VG activation

Shiju,

Getting 'could not login' for the link.

Thanks
Helen French
Honored Contributor

Re: VG activation

That's becuase you have a 'BR' login (may Europe, not from US). That's the reason why the TKB (technical knowledge base) number has been provided. All you need is select "maintenance and support for hp products" from your left side bar and lolok for Knowledge base. Once you get these, select "search by document ID" and give this number.
Life is a promise, fulfill it!