Re: Recover LUNs that are accidentally added to an LV (207 Views)
Reply
Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 1 of 5 (225 Views)

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

Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 5 (221 Views)

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...

Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 3 of 5 (217 Views)

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 

Trusted Contributor
Earl_Crowder
Posts: 76
Registered: ‎07-17-2001
Message 4 of 5 (207 Views)

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.

 

 

Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 5 of 5 (199 Views)

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. 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.