Operating System - HP-UX
1833522 Members
3110 Online
110061 Solutions
New Discussion

Re: Removing unused logical volumes

 
SOLVED
Go to solution
Sim Soon Huat_1
Occasional Contributor

Removing unused logical volumes

Hi! I'm a new HPUX administrator and I got some questions regarding LVM. How to remove a unused logical volume? What are the things that I should take note before remove it from a vg?

Thanks!

4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: Removing unused logical volumes

To remove a logical volume from a volume group you use the lvremove command. Do a 'man lvremove' for more information.

Before you remove a logical volume, make absolutely sure it is not in use. Check your /etc/fstab to make sure it is not being mounted. If it is still being mounted, make sure the data is not in use and make a backup of the data.

If you do want to remove a logical volume, make a note of its configuration (ie. size, mount point, striped?, mirrored?, vg it belongs to, etc.) so that you can easily recreate it if need be.
Dan Hetzel
Honored Contributor

Re: Removing unused logical volumes

Hi,

Patrick is right on the track (as usual) but you could use 'vgcfgbackup -f ...' to save a volume group configuration to an alternate file.

Pay attention to the following (from vgcfgbackup manual page):
It is recommended that any alternate configuration backup file be
created in the root file system (as is the case with the default path
name). This facilitates easy volume group recovery during maintenance
mode, such as after a system crash.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Dave Wherry
Esteemed Contributor

Re: Removing unused logical volumes

Check one other thing. Just because it is not in /etc/fstab does not mean it is not used. It could be a raw volume used by a database. It is a good idea to put your raw volumes in fstab as a reference.
If you have a database on that box check to see if it is using raw volumes before you start doing lvremoves.
Henry Weldon
Advisor

Re: Removing unused logical volumes

For your Raw LV's, try using "fuser -u /dev/vg##/*lvname" to make sure the LV is not used anymore. Also, get email from your DBA certifying the LV is no longer used.
Be Prepared