How do I unlock and/or remove a locked volume?

June 24th, 2011 - 06:30 am ET by Derek Dongray | Report spam

I recently decided to move a volume group off of a mixed device (SATA+USB)
md raid mirror after encountering the "bio too big" bug (which apparently is
likely to cause data corruption, but is classified as WONTFIX! See
https://bugzilla.redhat.com/show_bug.cgi?idI8162 or
http://lmgtfy.com/?q=bio+too+big+wontfix).

The sequence started to use was:

1. Fail USB drive and remove from the raid mirror (mdadm).
2. Repartition USB drive (parted).
3. Create Physical Volume on USB drive and add to Volume Group (lvm pvcreate
& vgextend).
4. Move Volume Group off of raid mirror (lvm pvmove).
5. Remove raid mirror from Volume Group and stop if being a Physical
Volume (lvm vgreduce & pvremove).
6. Stop raid mirror (mdadm).
7. Repartiton SATA drive (parted).
8. Create new SATA-based Physical Volume and add to Volume Group (lvm
pvcreate & vgextend).
9. Move volume group off USB-based Physical Volume (pvmove).
It was at this point (after a few hours) that the sysem 'hung' and was
totally unresponsive. After powering down and rebooting, I attempted to
abort the pvmove (pvmove --abort) but the system locked up again and I
rebooted a second time. This time, the abort appeared to succeed, but when I
started the pvmove againb I got a message about ignoring the locked volume
'pvmove0'. I proceeded with the remaining step:

10. Remove USB-based Physical Volume from the Volume Group and stop it being
a Physical Volume (lvm vgreduce & pvremove)

The system appears to be running OK, but there is a zero-length, locked
Logical Volume which I can't remove.

# lvs -a raid/pvmove0
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
[pvmove0] raid p-C 0

# lvdisplay -a -v raid/pvmove0
Using logical volume(s) on command line
Logical volume
LV Name /dev/raid/pvmove0
VG Name raid
LV UUID 2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v
LV Write Access read/write
LV Status NOT available
LV Size 0
Current LE 0
Segments 0
Allocation contiguous
Read ahead sectors auto

# tail -n11 /etc/lvm/backup/raid
pvmove0 {
id = "2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v"
status = ["READ", "WRITE", "PVMOVE", "LOCKED"]
flags = []
allocation_policy = "contiguous"
segment_count = 0
}
}
}

The volume is locked (as shown from the backup information output) so
"lvremove --force raid/pvmove0" simply complains "Can't remove locked LV
pvmove0", but "pvmove --abort" (which would normally unlock this) does
nothing because no pvmove is in progress.

So the question (as in the subject) is how do I unlock and/or remove a
locked volume?

Thanks.
Derek.


<div>I recently decided to move a volume group off of a mixed device (SATA+USB) md raid mirror after encountering the &quot;bio too big&quot; bug (which apparently is likely to cause data corruption, but is classified as WONTFIX! See <a href="https://bugzilla.redhat.com/show_bu...;>https://bugzilla.redhat.com/show_bug.cgi?id=498162</a> or <a href="http://lmgtfy.com/?q=bio+too+big+wo...t;>http://lmgtfy.com/?q=bio+too+big+wontfix</a>).</div>
<div> </div><div>The sequence started to use was:</div><div> </div><div>1. Fail USB drive and remove from the raid mirror (mdadm).</div><div>2. Repartition USB drive (parted).</div><div>3. Create Physical Volume on USB drive and add to Volume Group (lvm pvcreate &amp; vgextend).</div>
<div>4. Move Volume Group off of raid mirror (lvm pvmove).</div><div>5. Remove raid mirror from Volume Group and stop if being a Physical Volume (lvm vgreduce &amp; pvremove).</div><div>6. Stop raid mirror (mdadm).</div><div>
7. Repartiton SATA drive (parted).</div><div>8. Create new SATA-based Physical Volume and add to Volume Group (lvm pvcreate &amp; vgextend).</div><div>9. Move volume group off USB-based Physical Volume (pvmove).</div><div>
It was at this point (after a few hours) that the sysem &#39;hung&#39; and was totally unresponsive. After powering down and rebooting, I attempted to abort the pvmove (pvmove --abort) but the system locked up again and I rebooted a second time. This time, the abort appeared to succeed, but when I started the pvmove againb I got a message about ignoring the locked volume &#39;pvmove0&#39;. I proceeded with the remaining step:</div>
<div> </div><div>10. Remove USB-based Physical Volume from the Volume Group and stop it being a Physical Volume (lvm vgreduce &amp; pvremove)</div><div> </div><div>The system appears to be running OK, but there is a zero-length, locked Logical Volume which I can&#39;t remove.</div>
<div> </div><div><font face="courier new,monospace"># lvs -a raid/pvmove0</font></div><div><font face="courier new,monospace">  LV        VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert</font></div><div><font face="courier new,monospace">  [pvmove0] raid p-C    0</font></div>
<div><font face="courier new,monospace"> </font></div><div><font face="courier new,monospace"># lvdisplay -a -v raid/pvmove0</font></div><div><font face="courier new,monospace">    Using logical volume(s) on command line</font></div>
<div><font face="courier new,monospace">  Logical volume </font></div><div><font face="courier new,monospace">  LV Name                /dev/raid/pvmove0</font></div><div><font face="courier new,monospace">  VG Name                raid</font></div>
<div><font face="courier new,monospace">  LV UUID                2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v</font></div><div><font face="courier new,monospace">  LV Write Access        read/write</font></div><div><font face="courier new,monospace">  LV Status              NOT available</font></div>
<div><font face="courier new,monospace">  LV Size                0</font></div><div><font face="courier new,monospace">  Current LE             0</font></div><div><font face="courier new,monospace">  Segments               0</font></div>
<div><font face="courier new,monospace">  Allocation             contiguous</font></div><div><font face="courier new,monospace">  Read ahead sectors     auto</font></div><div><font face="courier new,monospace"> </font></div>
<div><font face="courier new,monospace"># tail -n11 /etc/lvm/backup/raid</font></div><div><font face="courier new,monospace">                pvmove0 {</font></div><div><font face="courier new,monospace">                        id = &quot;2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v&quot;</font></div>
<div><font face="courier new,monospace">                        status = [&quot;READ&quot;, &quot;WRITE&quot;, &quot;PVMOVE&quot;, &quot;LOCKED&quot;]</font></div><div><font face="courier new,monospace">                        flags = []</font></div>
<div><font face="courier new,monospace">                        allocation_policy = &quot;contiguous&quot;</font></div><div><font face="courier new,monospace">                        segment_count = 0</font></div><div><font face="courier new,monospace">                }</font></div>
<div><font face="courier new,monospace">        }</font></div><div><font face="courier new,monospace">}</font></div><div> </div><div>The volume is locked (as shown from the backup information output) so &quot;lvremove --force raid/pvmove0&quot;  simply complains &quot;Can&#39;t remove locked LV pvmove0&quot;, but &quot;pvmove --abort&quot; (which would normally unlock this) does nothing because no pvmove is in progress.</div>
<div> </div><div>So the question (as in the subject) is how do I unlock and/or remove a locked volume?</div><div> </div><div>Thanks.</div><div>--</div><div>Derek.</div><div> </div>



To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/BANLkTi=cv0...h=WF_2caUw@mail.gmail.com
email Follow the discussionReplies 2 repliesReplies Make a reply

Replies

#1 Derek Dongray
June 24th, 2011 - 07:00 pm ET | Report spam

OK. I decided this is probably impossible (or at least very difficult) since
no-one replied or even commented after over 12 hours, so I too the
alternative roure of creating a new Volume Group, copying and deleting (if
possible) all the Logical Volumes in the 'corrupt' VG, rebooting using the
new VG, then deleting the old VG and moving everything to the right Physical
Volumes.

Of course, I'd still like to know if a damaged pvmove0 (pvmove, locked)
volume can be unlocked and deleted when 'pvmove --abort' does not do the
job.

On 24 June 2011 11:28, Derek Dongray wrote:

I recently decided to move a volume group off of a mixed device (SATA+USB)
md raid mirror after encountering the "bio too big" bug (which apparently is
likely to cause data corruption, but is classified as WONTFIX! See
https://bugzilla.redhat.com/show_bug.cgi?idI8162 or
http://lmgtfy.com/?q=bio+too+big+wontfix).

The sequence started to use was:

1. Fail USB drive and remove from the raid mirror (mdadm).
2. Repartition USB drive (parted).
3. Create Physical Volume on USB drive and add to Volume Group (lvm
pvcreate & vgextend).
4. Move Volume Group off of raid mirror (lvm pvmove).
5. Remove raid mirror from Volume Group and stop if being a Physical
Volume (lvm vgreduce & pvremove).
6. Stop raid mirror (mdadm).
7. Repartiton SATA drive (parted).
8. Create new SATA-based Physical Volume and add to Volume Group (lvm
pvcreate & vgextend).
9. Move volume group off USB-based Physical Volume (pvmove).
It was at this point (after a few hours) that the sysem 'hung' and was
totally unresponsive. After powering down and rebooting, I attempted to
abort the pvmove (pvmove --abort) but the system locked up again and I
rebooted a second time. This time, the abort appeared to succeed, but when I
started the pvmove againb I got a message about ignoring the locked volume
'pvmove0'. I proceeded with the remaining step:

10. Remove USB-based Physical Volume from the Volume Group and stop it
being a Physical Volume (lvm vgreduce & pvremove)

The system appears to be running OK, but there is a zero-length, locked
Logical Volume which I can't remove.

# lvs -a raid/pvmove0
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
[pvmove0] raid p-C 0

# lvdisplay -a -v raid/pvmove0
Using logical volume(s) on command line
Logical volume
LV Name /dev/raid/pvmove0
VG Name raid
LV UUID 2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v
LV Write Access read/write
LV Status NOT available
LV Size 0
Current LE 0
Segments 0
Allocation contiguous
Read ahead sectors auto

# tail -n11 /etc/lvm/backup/raid
pvmove0 {
id = "2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v"
status = ["READ", "WRITE", "PVMOVE", "LOCKED"]
flags = []
allocation_policy = "contiguous"
segment_count = 0
}
}
}

The volume is locked (as shown from the backup information output) so
"lvremove --force raid/pvmove0" simply complains "Can't remove locked LV
pvmove0", but "pvmove --abort" (which would normally unlock this) does
nothing because no pvmove is in progress.

So the question (as in the subject) is how do I unlock and/or remove a
locked volume?

Thanks.
Derek.







Derek.


<div>OK. I decided this is probably impossible (or at least very difficult) since no-one replied or even commented after over 12 hours, so I too the alternative roure of creating a new Volume Group, copying and deleting (if possible) all the Logical Volumes in the &#39;corrupt&#39; VG, rebooting using the new VG, then deleting the old VG and moving everything to the right Physical Volumes.</div>
<div> </div><div>Of course, I&#39;d still like to know if a damaged pvmove0 (pvmove, locked) volume can be unlocked and deleted when &#39;pvmove --abort&#39; does not do the job.<br><br></div><div class="gmail_quote">On 24 June 2011 11:28, Derek Dongray <span dir="ltr">&lt;<a href="mailto:"></a>&gt;</span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div>I recently decided to move a volume group off of a mixed device (SATA+USB) md raid mirror after encountering the &quot;bio too big&quot; bug (which apparently is likely to cause data corruption, but is classified as WONTFIX! See <a href="https://bugzilla.redhat.com/show_bu...8162" target="_blank">https://bugzilla.redhat.com/show_bu...t; or <a href="http://lmgtfy.com/?q=bio+too+big+wontfix" target="_blank">http://lmgtfy.com/?q=bio+too+big+wontfix</a>).</div>

<div> </div><div>The sequence started to use was:</div><div> </div><div>1. Fail USB drive and remove from the raid mirror (mdadm).</div><div>2. Repartition USB drive (parted).</div><div>3. Create Physical Volume on USB drive and add to Volume Group (lvm pvcreate &amp; vgextend).</div>

<div>4. Move Volume Group off of raid mirror (lvm pvmove).</div><div>5. Remove raid mirror from Volume Group and stop if being a Physical Volume (lvm vgreduce &amp; pvremove).</div><div>6. Stop raid mirror (mdadm).</div>
<div>
7. Repartiton SATA drive (parted).</div><div>8. Create new SATA-based Physical Volume and add to Volume Group (lvm pvcreate &amp; vgextend).</div><div>9. Move volume group off USB-based Physical Volume (pvmove).</div><div>

It was at this point (after a few hours) that the sysem &#39;hung&#39; and was totally unresponsive. After powering down and rebooting, I attempted to abort the pvmove (pvmove --abort) but the system locked up again and I rebooted a second time. This time, the abort appeared to succeed, but when I started the pvmove againb I got a message about ignoring the locked volume &#39;pvmove0&#39;. I proceeded with the remaining step:</div>

<div> </div><div>10. Remove USB-based Physical Volume from the Volume Group and stop it being a Physical Volume (lvm vgreduce &amp; pvremove)</div><div> </div><div>The system appears to be running OK, but there is a zero-length, locked Logical Volume which I can&#39;t remove.</div>

<div> </div><div><font face="courier new,monospace"># lvs -a raid/pvmove0</font></div><div><font face="courier new,monospace">  LV        VG   Attr   LSize Origin Snap%  Move Log Copy%  Convert</font></div><div><font face="courier new,monospace">  [pvmove0] raid p-C    0</font></div>

<div><font face="courier new,monospace"> </font></div><div><font face="courier new,monospace"># lvdisplay -a -v raid/pvmove0</font></div><div><font face="courier new,monospace">    Using logical volume(s) on command line</font></div>

<div><font face="courier new,monospace">  Logical volume </font></div><div><font face="courier new,monospace">  LV Name                /dev/raid/pvmove0</font></div><div><font face="courier new,monospace">  VG Name                raid</font></div>

<div><font face="courier new,monospace">  LV UUID                2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v</font></div><div><font face="courier new,monospace">  LV Write Access        read/write</font></div><div><font face="courier new,monospace">  LV Status              NOT available</font></div>

<div><font face="courier new,monospace">  LV Size                0</font></div><div><font face="courier new,monospace">  Current LE             0</font></div><div><font face="courier new,monospace">  Segments               0</font></div>

<div><font face="courier new,monospace">  Allocation             contiguous</font></div><div><font face="courier new,monospace">  Read ahead sectors     auto</font></div><div><font face="courier new,monospace"> </font></div>

<div><font face="courier new,monospace"># tail -n11 /etc/lvm/backup/raid</font></div><div><font face="courier new,monospace">                pvmove0 {</font></div><div><font face="courier new,monospace">                        id = &quot;2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v&quot;</font></div>

<div><font face="courier new,monospace">                        status = [&quot;READ&quot;, &quot;WRITE&quot;, &quot;PVMOVE&quot;, &quot;LOCKED&quot;]</font></div><div><font face="courier new,monospace">                        flags = []</font></div>

<div><font face="courier new,monospace">                        allocation_policy = &quot;contiguous&quot;</font></div><div><font face="courier new,monospace">                        segment_count = 0</font></div><div><font face="courier new,monospace">                }</font></div>

<div><font face="courier new,monospace">        }</font></div><div><font face="courier new,monospace">}</font></div><div> </div><div>The volume is locked (as shown from the backup information output) so &quot;lvremove --force raid/pvmove0&quot;  simply complains &quot;Can&#39;t remove locked LV pvmove0&quot;, but &quot;pvmove --abort&quot; (which would normally unlock this) does nothing because no pvmove is in progress.</div>

<div> </div><div>So the question (as in the subject) is how do I unlock and/or remove a locked volume?</div><div> </div><div>Thanks.</div><div>--</div><div>Derek.</div><font color="#888888"><div> </div>
</font></blockquote></div><br><br clear="all"><br>-- <br>Derek.<br>



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Archive: http://lists.debian.org/BANLkTi=

Similar topics