Re: Recover LUNs that are accidentally added to an LV (102 Views)
Reply
Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 1 of 5 (120 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

Please use plain text.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 5 (116 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...

Please use plain text.
Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 3 of 5 (112 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 

Please use plain text.
Trusted Contributor
Earl_Crowder
Posts: 76
Registered: ‎07-17-2001
Message 4 of 5 (102 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.

 

 

Please use plain text.
Advisor
VKV
Posts: 17
Registered: ‎07-14-2011
Message 5 of 5 (94 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. 

Please use plain text.
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