1753445 Members
5377 Online
108794 Solutions
New Discussion юеВ

lvreduce and PVG

 
SOLVED
Go to solution
KapilRaj
Honored Contributor

lvreduce and PVG

Gents,

Is there a reason why lvreduce would not support using PVGs as an argument ?.

i.e. I can extend a mirror by the following command,

lvextend -m 1 /dev/vgkaps/lvol10 pvg3 pvg4

But when I goto reduce the first mirror ( part of a migration )

lvreduce -m 0 /dev/vgkaps/lvol10 pvg1 pvg2

It does not work ! I need to use the device special files.

Regards,

Kaps
Nothing is impossible
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: lvreduce and PVG

Shalom,

Can we have an error message? Not all error messages are meaningful in Linux, but most LVM messages can be interpreted.

I think the lvreduce command is merely misformed in this case.

The man page might give you better syntax.You also should make sure there are no open processes on the filesystem before you try lvreduce.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
James R. Ferguson
Acclaimed Contributor
Solution

Re: lvreduce and PVG

Hi Kaps:

> Is there a reason why lvreduce would not support using PVGs as an argument ?

Well, the manpages clearly show that only a 'pv_path' is a qualifier to the logical volume path of an 'lvreduce' whereas either a 'pv_path' or a 'pvg_name' can qualify the logical volume path of an 'lvextend'.

That's an obvious answer that begs the question, of course. As for "why" one can't use a 'pvg_name' argument with either command, I would guess that since the '/etc/lvmpvg' file can be manually editted, it could be "unsafe" to rely on its contents as the guide for removing logical extents. Conversely, when allocating new extents, it is possible to verify the allocation policies of the targets based on the contents of the file and simply allow or deny the allocation at the onset -- a "safe" operation.

Regards!

...JRF...
Sandman!
Honored Contributor

Re: lvreduce and PVG

Imho for PVGs I edit the lvmpvg directly instead of using lvextend or lvreduce. Could you post the attibutes of lvol10 as well as the contents of lvmpvg i.e.

# lvdisplay -v /dev/vgkaps/lvol10
# cat /etc/lvmpvg

~cheers
KapilRaj
Honored Contributor

Re: lvreduce and PVG

Thank JRF and Steven. Of course , I have seen the man pages that it supports a pv_path NOT a pvg name. I thought about it and was not able to find a valid reason why HP did not give that option. JRF's comments have given me a possible reason.
Nothing is impossible