- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reducing Logical Volumes and Volume Groups - remov...
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
12-01-2003 07:54 AM
12-01-2003 07:54 AM
I'm looking for a consensus on the best strategy to accomplish this goal:
1. I have two volume groups (vg_u1,vg_u2) that contain approximately 400GB and 300GB of disk respectively. However, the actually usage of all the filesystems is approximately 250 and 200GB respectively. I wanted to consolidate the disks being used so that we can remove the unused disks from the array - however, they have already been assigned to the volume group. We have Online JFS version 4 if necessary.
Please help.
Thanks
Jeff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2003 08:01 AM
12-01-2003 08:01 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
But the exact method of how you go about doing the removal will depend on the configuration of your volume group (striping/mirroring/lvol sizing)....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2003 08:01 AM
12-01-2003 08:01 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
# vgdisplay -v /dev/vg_u1
Check the PVs on the volume group and do:
# pvdisplay -v /dev/dsk/cxtydz (repeat this for all PVs)
Find the one which are free, then remove it from VG:
# vgreduce /dev/vg_u1 /dev/dsk/cxtydz
repeat the same procedure for /dev/vg_u2.
I would suggest you to backup your data before you do any of these process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2003 08:03 AM
12-01-2003 08:03 AM
SolutionYou have a couple of ways to do it. You can try to reduce the size of the existing logical volumes and then use pvmove to move the remaining extents off of the PVs that you want to reduce.
The other method is to backup everything safely, nuke the volume groups, recreate them with the smaller logical volumes, and then restore your data.
I'd highly recommend the second method. The first method relies on the lvreduce command which is very tricky. The nature of LVM is that the extents that get used are not always continuous. You'll have to use fsadm to try to defrag the filesystems to get all the used extents together, and I've never seen that work successfully. Plus, if the first method totally bombs, you'll wind up using the second method anyway to recover. Might as well cut to the chase and do it right the first time.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2003 08:26 AM
12-01-2003 08:26 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
- Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2003 02:55 AM
12-02-2003 02:55 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:32 AM
12-15-2003 07:32 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
One more question. Each volume group has many logical volumes. What is the best way to go about removing and re-creating the logical volumes? Anyone have any scripting tricks?
Thanks again,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:39 AM
12-15-2003 07:39 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
# umount your_mounted_file_systems
# vgchange -a n vg_name
# vgexport vg_name
You can now start from scratch and recreate all your disks with:
# pvcreate -f pv_raw_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:41 AM
12-15-2003 07:41 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:48 AM
12-15-2003 07:48 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
If you want to keep your existing LVM defenitions, but just want to re-size your LVs, then you need to recreate your existing LVs without removing any. You can follow my original post for that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 07:51 AM
12-15-2003 07:51 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
Thanks again,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 08:07 AM
12-15-2003 08:07 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
For script, do something like this: Put your lv_names in a file, say 'lvnames':
lv=`cat lvnames`
for i in $lvnames
do
your_lvm_command $i options
other_commands_if_needed
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2003 08:08 AM
12-15-2003 08:08 AM
Re: Reducing Logical Volumes and Volume Groups - removing disks
You can save your LV names from your bdf output
## bdf|grep '^\/' |awk '{ print $1 }'
Also, you dont need to remove the VGs only blow away the LVols only...
THEN:
lvremove LVOL
vgreduce /dev/dsk/ctd ## For each disk you want to remove
THEN recreate your LVOLS:
lvcreate -n LVOL /dev/vg01
lvextend -L
newfs -F vxfs
mount
THEN make sure your mount options are loaded
mount -o remount,