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 "bio too big" 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 & 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 & 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 & 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 '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:</div>
<div> </div><div>10. Remove USB-based Physical Volume from the Volume Group and stop it being a Physical Volume (lvm vgreduce & pvremove)</div><div> </div><div>The system appears to be running OK, but there is a zero-length, locked Logical Volume which I can'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 = "2aWJ0g-B5P8-6bAz-zKlk-f4dQ-nwn8-80n12v"</font></div>
<div><font face="courier new,monospace"> status = ["READ", "WRITE", "PVMOVE", "LOCKED"]</font></div><div><font face="courier new,monospace"> flags = []</font></div>
<div><font face="courier new,monospace"> allocation_policy = "contiguous"</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 "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.</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
Similar topics
- [gentoo-user] How do I remove a module from ENLIGHTENMENT_MODULES?
- How do I remove obsolete entries from the Notification Area Icons window?
- How do I remove a bad file??
- How do I remove GUI.exe
- how do I remove the person activation button prior to Windows loading
- How do I remove pleadings from a document in word.
Make your own search :
Tags
Create a new topic
Follow the discussion
2 replies
Make a reply
May 19th, 2013 - 3:21 AM ET
Join now


Replies