- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- A simple question about removing a vg
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
05-03-2003 07:57 AM
05-03-2003 07:57 AM
A simple question about removing a vg
I'm learning LVM.I found the following words in my studen workbook
"vgremove VG
* VG must have only 1 PV left in it and this must be unused"
What does it mean?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2003 08:45 AM
05-03-2003 08:45 AM
Re: A simple question about removing a vg
# vgdisplay -v vg01
--- Volume groups ---
VG Name /dev/vg01
VG Write Access read/write
.....
Cur PV 2
Act PV 2
......
--- Physical volumes ---
PVName /dev/dsk/c2t10d0
...
PVName /dev/dsk/c2t12d0
..
Now assume all the logical volumes have been removed and you're left with 2 physical volumes (or physical disks). In order to vgremove vg01 you have to vgreduce the PVs from the VG until only 1 PV is left. In the above example ..
# vgreduce /dev/vg01 /dev/dsk/c2t12d0
Now you're left with only 1 PV (ie c2t10d0). At this point ..
# vgremove /dev/vg01
will be succesdful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2003 11:37 AM
05-03-2003 11:37 AM
Re: A simple question about removing a vg
You can see this by doing a 'vgdisplay' (look for 'CUR LV', for the current number of logical volumes in the volume group, should be zero), or a 'vgdisplay -v' will provide a verbose listing of the LVs in the VG (again, to use vgremove, there shouldn't be any entries).
So, the two requirements are, you must have used 'lvremove' to remove each of the LVs in the VG (file systems must be unmounted first, or the command will fail). Then, vgreduce must be run, specifying all but one of the physical volumes in the VG, so that only one PV is left in the VG. Once these tasks are complete, 'vgremove' will wipe the VG off your system.
An alternative to this is the 'vgexport' command, which preserves the VG information on the physical volumes, but which does remove the VG information from the /etc/lvmtab file, as well as deleting the /dev/vgxx directory and special device files.
Once you become comfortable with LVM, you may find that you often use 'vgexport', since it does it all with one command. The only issue is that the PVs still have a VGRA (VG info in a header "reserved area"), so to use the PV(s) for some other purpose, you have to wipe the existing VG metadata off the physical disk.
To do that, you use the 'force' switch on the 'pvcreate' command (pvcreate -f /dev/rdsk/c?t?d?), since pvcreate won't overwrite an existing VGRA without the 'force' option.
Regards, --bmr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2003 11:29 AM
05-05-2003 11:29 AM
Re: A simple question about removing a vg
vgexport -v /dev/vg??
this will remove the volume
group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2003 10:25 PM
05-05-2003 10:25 PM
Re: A simple question about removing a vg
By saying that "VG must have only 1 PV left in it and this must be unused" the document wants to say that be cautious to remove the right LV from the right VG and after you have made the VG free with any LV (means no LV left on that VG) you should reduce the VG to just one PV and then the VG can be removed.
This is very clean procedure but if you are looking for short cut way and you are sure about the LV and VG just use vgexport command.
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2003 11:10 PM
05-05-2003 11:10 PM
Re: A simple question about removing a vg
vgexport: Only removes entry in the /etc/lvmtab and directory in /dev corresponding to VG. Do "strings /etc/lvmtab", u will find each VG and associated PV's with it. Even after vgexport, all LV's are intact in VG. but u can not display VG or LV's. u can get the VG back, by creating directory in /dev and group file with mknod and with vgimport
vgreduce: using this u can remove one or more PV's from VG.
vgremove: removes the VG, in order to do this the safest way is to remove LV's first, then remove PV's one by one until one PV left in VG and then VG. "must be unused" means no LVs are present in that PV.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2003 03:47 AM
05-06-2003 03:47 AM
Re: A simple question about removing a vg
Sadly enough I did not save a copy and did not note who the poster was.
My/our apologies.
For what it is worth, the last few lines, said something like "Bill, ...", so perhaps that is meaningful for the original poster.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2003 07:08 AM
05-15-2003 07:08 AM
Re: A simple question about removing a vg
8^)
--bmr