Operating System - HP-UX
1753316 Members
5547 Online
108792 Solutions
New Discussion юеВ

Re: lvreduce couldn't reduce logical volume

 
SOLVED
Go to solution
Michael Peddycord_1
Occasional Advisor

lvreduce couldn't reduce logical volume

I am getting the following message when I try to remove a mirror from a logical volume.
lvreduce: couldn't reduce logical volume:
no such file or directory.

The file for the LV exists, the file for the disks exists.

And upon further investigation an lvdisplay -v on the volume returns about 5000 extents as valid and the remaining 32000 with PX_NOPV.

Any help would be appreciated.
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: lvreduce couldn't reduce logical volume

The command to remove a mirror is lvsplit.

Please show the syntax you are using.

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
Michael Peddycord_1
Occasional Advisor

Re: lvreduce couldn't reduce logical volume

the command I am using is lvreduce -m 0 /dev/vg02/lvol1 /dev/dsk/c12/t0/d1 /dev/dsk/c12/t0/d2. The other volume I removed the mirror from had no issues. This is on an 11.11 system.
Bharat Katkar
Honored Contributor

Re: lvreduce couldn't reduce logical volume

Hi,

1. Check whether your LV has mirror copies. for e.g. it is /dev/vg00/lvol4
# lvdisplay /dev/vg00/lvol4 | grep Mirror | cut -d " " -f 17
If this returns 1 then it is mirrored and 0 not mirrored.
so it should be 1
2. lvreduce -m 0

This should work.
Regards,




You need to know a lot to actually know how little you know
Bharat Katkar
Honored Contributor

Re: lvreduce couldn't reduce logical volume

what does
# lvdisplay /dev/vg02/lvol1
return ?

Regards,
You need to know a lot to actually know how little you know
Michael Peddycord_1
Occasional Advisor

Re: lvreduce couldn't reduce logical volume

lvdisplay says status available/syncd
mirror copies 1
consistency recovery mwc
schedule parallel
lvsize(mbytes) 614000
current le 38375
allocated pe 76750

but when you do a -v, the first 5600 show up fine with the logical extent followed by the first disk then the physical on that disk and the mirrored disk and the physical on that disk. beginning after about 5600, the display shows the logical extent followed by PX_NOPV followed by 00000 then PX_NOPV and 0000.

All other things point to the disks being fine, I can access data on the entire disk etc.
Bharat Katkar
Honored Contributor

Re: lvreduce couldn't reduce logical volume

Then i doubt why it is not working.

# lvreduce -m 0 /dev/vg02/lvol1

This always works for me... give it a try once.

Regards,
You need to know a lot to actually know how little you know
Sundar_7
Honored Contributor

Re: lvreduce couldn't reduce logical volume

Could be a bad drive or something.

did you try a dd on the mirror disk that lvdisplay shows as PX_NOPV ?

dd if=/dev/rdsk/c5t6d0 of=/dev/null bs=1024k

Learn What to do ,How to do and more importantly When to do ?
Michael Peddycord_1
Occasional Advisor

Re: lvreduce couldn't reduce logical volume

lvmreduce - yes it always has worked for me. It worked on a previous volume in fact. Also, I need to specify the volumes to remove from the mirror, as I am replacing those disks with the new volumes that I am keeping. The mirrors have been active for 2-1/2 months. The dd idea would be great if it were just the mirror disk or the primary disk having the PX_NOPV, but it is on both the mirror and the primary that it shows up on.
Tom Danzig
Honored Contributor
Solution

Re: lvreduce couldn't reduce logical volume

From PHKL_30622 patch description:


Warning: 04/07/13 - This Critical Warning has been issued by HP.

- PHKL_29979 introduced behavior hat affects logical volumes with greater than or equal to 65536 physical extents. Logical volumes with less than 65536 physical extents are not affected by this defect. Since the maximum number of logical extents in a logical volume is 65535, this problem can only occur in mirrored logical volumes where the number of physical extents can exceed this number. For example, a logical volume with no mirrors contains 40000 logical extents and 40000 physical extents. Once this logical volume is mirrored, it will contain 40000 logical extents and 80000 physical extents.

The problem is due to the LVM kernel interface returning an incomplete mapping of extents to LVM commands.

The commands affected include lvdisplay(1M),
lvextend(1M), lvreduce(1M), lvsplit(1M), lvmerge(1M), pvmove(1M), and others. The incomplete extent map can cause LVM commands to fail or return incorrect results.

This can also lead to data corruption, as mirrors may not be fully resynchronized after a system panic.

- Below are examples of how the problem manifests itself in the output and execution of some of the LVM commands.

# lvdisplay -v /dev/vg02/lvol1
--- Logical volumes ---
LV Name /dev/vg02/lvol1
...
Current LE 32768
Allocated PE 65536
...
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c16t0d0 32768 65536
--- Logical extents ---
LE PV1 PE1 Status 1
PV2 PE2 Status 2
00000 /dev/dsk/c16t0d0 00000 current
/dev/dsk/c16t0d0 00000 current
00001 /dev/dsk/c16t0d0 00000 current
PX_NOPV 00000 current
00002 PX_NOPV 00000 current
PX_NOPV 00000 current
...
32767 PX_NOPV 00000 current
PX_NOPV 00000 current



- As patch PHKL_29979 and the superseding patches PHKL_30552 and PHKL_30622 address an important number of critical defect fixes, HP advises to not remove these patches. The superseding patch, PHKL_30697, that will correct this behavior, is expected to be available by late August.


Formatting of above text is probably screwwed up. See the HP patch database.