- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- vg active?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 01:31 AM
01-14-2002 01:31 AM
is there anyother way than the vgdisplay output
( which displays an error ) to see if a vg is
active or not?
thx...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 01:36 AM
01-14-2002 01:36 AM
Re: vg active?
Do a bdf and see if any of the logical volumes under this vg have been mounted.
If not, try to mount any of the logical volumes. It shouldn't say unable to open the logical volume if the vg is not activated
Or do a lvdisplay on any of the logical volumes in the volume group
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 01:46 AM
01-14-2002 01:46 AM
Re: vg active?
i am writing a script based on
"strings /etc/lvmtab" output,reading it line by
line and doing some operations, but because
some of vgs listed are not active( they are
defined because of a cluster membership ),
due to my vgdisplay output,some error conditions appear...to suppress those messages,
i simply wrote:
vgdisplay $line > /dev/null 2>&1
if [ $? -eq 0 ]
then
condition, just to check if it is activated...
but what works well in the command line without
any problems, causes the script to wait for a
5 minutes when used in...
any suggestions?
thx...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 01:52 AM
01-14-2002 01:52 AM
Re: vg active?
Try using the vgchange command instead. If you do a vgchange -a y
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 01:56 AM
01-14-2002 01:56 AM
Re: vg active?
I would do like this.
vgdisplay -v > /tmp/vg.out 2>/dev/null
1. Get all the VGs that are active on the system.
grep "VG Name" /tmp/vg.out |awk '{print $3}'
2. Get the primary disks that are active
grep "PV Name" /tmp/vg.out |grep -v Alternate |awk '{print $3}'
3. Get the alternate disks
grep "PV Name" /tmp/vg.out |grep Alternate |awk '{print $3}'
4. Get the Lvols
grep "LV Name" /tmp/vg.out |awk '{print $3}'
5. Getting it straight redirecting errors to null
vgdisplay -v 2>/dev/null |grep "VG Name" |awk '{print $3}'
This may give you some idea
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 02:39 AM
01-14-2002 02:39 AM
Re: vg active?
note it will say if already active, or otherwise activate it.. so you may want to disactivate after:
vgchange -a n vgname
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 02:54 AM
01-14-2002 02:54 AM
Re: vg active?
If a volume group is already active then Im afraid a vgchange -a y on it doesnt return an error (like already active) , it simply displays the same message (activated successfully) wether or not it was already active.
However, ive found a way to test for sure if a VG is active or not. Do the following command on one of the lvols in the VG;
adb 0x2000?2X | adb /dev/
If the VG is active this will return some data in 3 columns, if the VG is not active it will return an error; text address not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 04:05 AM
01-14-2002 04:05 AM
SolutionThe strings /etc/lvmtab is a hack at best since this file is actually a binary file. Most of the time, it looks reasonable but occasionally strings will produce garbage characters that your script must accomodate. And lvmtab probably has entries that are incorrect, leading to the error messages you are receiving in vgdisplay.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 06:43 AM
01-14-2002 06:43 AM
Re: vg active?
I'd be most concerned with why vgdisplay is hanging in a script. It shouldn't be, especially since you say it is working from command line without problem. I can run vgdisplay against an inactive VG in a script without problem. So, could this be a scripting issue?
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 06:46 AM
01-14-2002 06:46 AM
Re: vg active?
Try "vgdisplay -v /dev/vg_name"
Then for all the lv's listed under the VG, try,
lvdisplay -v /dev/vg_name/lv_name
Also for all the disks listed for that VG, try
pvdisplay -v /dev/dsk/cxtydz
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2002 06:51 AM
01-14-2002 06:51 AM
Re: vg active?
The VG should be active on the node to run vgdisplay on that Vg. For a cluster VG you can run the vgdisplay command on the node where the VG is active at that moment. If the vg is not active you can make it active on a cluster node with the cluster services running using,
vgchange -a e /dev/vg_name
then do a vgdisplay
to deactivate the Vg on the node,
vgchange -a n /dev/vg_name
If the cluster services are not running on the node and you want to activate a cluster vg on this node, make sure the vg is not active on any node, then do,
vgchange -c n /dev/vg_name
This will deactivate the cluster info from the vg,
then activate the vg using,
vgchange -a y /dev/vg_name
do a vgdisplay...
deactivate the VG,
vgchange -a n /dev/vg_name
put the VG back into cluster mode,
vgchange -c y /dev/vg_name
To activate the VG without quorum, use
vgchange -q n -a e /dev/vg_name
Hope this helps.
Regds