Operating System - HP-UX
1753445 Members
5320 Online
108794 Solutions
New Discussion

Re: Recover LUNs that are accidentally added to an LV

 
VKV
Advisor

Recover LUNs that are accidentally added to an LV

Hi,

I  addded 20 LUNs to an LV on a HP-UX 11.23 server so that I can extend a file system.  However there was an error in the client request and they want these LUNs to be allocated to another  file system which  resides in another VG. If I use lvreduce can I be sure that the newly added disks will be freed? Is there any way that I can specify the disks from which the LEs should be removed from? What is the best approach for this ?

 

Thanks

VKV

4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: Recover LUNs that are accidentally added to an LV

Hi:

 

You can use 'lvreduce' and specify the 'pv_path' you want to eliminate.  When the physical disks you want to reclaim are freed from the logical volume(s), use 'vgreduce' to eliminate the physical disks from the volume group.

 

Hae a look at the manpages for both commands.

 

Regards!

 

...JRF...

VKV
Advisor

Re: Recover LUNs that are accidentally added to an LV

Hi,

lvreduce accepts  pv_path as an argument only if -m option is specified. As I am not looking for reducing mirror copies here I cannot use that option.


 lvreduce -L 60000 /dev/vgrm0_dm_stg/lv_cp_dm_joi10 $DISK1

Usage: lvreduce        [-A Autobackup]        [-k]        {-m MirrorCopies |         -l LogicalExtentsNumber |         -L LogicalVolumeSize}        [-f]        LogicalVolumePath [PhysicalVolumePath ...]

"PhysicalVolumePath": Can be used only if "-m" has been specified. 

 

Thanks

VKV 

Earl_Crowder
Trusted Contributor

Re: Recover LUNs that are accidentally added to an LV

If you've extended the filesystem, make sure you reduce it before doing the lvreduce!

 

lvreduce removes extents from highest-numbered back, so if you lvreduce the lvol back to the original size, it should free up the space on the luns you added.  Then you can vgreduce the vg to free up the luns.

 

 

VKV
Advisor

Re: Recover LUNs that are accidentally added to an LV

Thanks Earl for that confirmation.

 

I have asked the backup team to backup the Filesystem. I will try lvreduce and post the outcome.