<div dir="ltr">You need to deactivate all active LVs before trying to deactivate the VG.<br><br><span style="font-family: courier new,monospace;">lvchange -an /dev/vgelg/lvelg</span><br><br>- Noam<br><br><div class="gmail_quote">
2010/4/18 Tom Rosenfeld <span dir="ltr">&lt;<a href="mailto:trosen@bezeqint.net">trosen@bezeqint.net</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Hi Guys,<br><br>I am having troupe with an LVM volume. I umounted a disk and moved it to a new system. There I did pvscan and vgscan --mknodes<br>However I can do no further operations on the volume since LVM thinks it is still open. It did not even create the block devise even though lvdisplay show it exists.<br>


<br>I am looking for a way to force the volume closed, but have not had any luck.<br>See the output below.<br><br>Thanks,<br>-tom<br><br><br><br style="font-family: courier new,monospace;"><div style="margin-left: 40px;">


<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># vgchange -an vgelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Can&#39;t deactivate volume group &quot;vgelg&quot; with 1 open logical volume(s)</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;"># ls -l /dev/vgelg/lvelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ls: /dev/vgelg/lvelg: No such file or directory</span><br>


<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># vgdisplay  -v vgelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Using volume group(s) on command line</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">    Finding volume group &quot;vgelg&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  --- Volume group ---</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  VG Name               vgelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  System ID             </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Format                lvm2</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Metadata Areas        4</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Metadata Sequence No  7</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  VG Access             read/write</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  VG Status             resizable</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  MAX LV                0</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Cur LV                1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Open LV               1</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Max PV                0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Cur PV                4</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Act PV                4</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  VG Size               1.17 TB</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PE Size               4.00 MB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Total PE              307196</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Alloc PE / Size       281600 / 1.07 TB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Free  PE / Size       25596 / 99.98 GB</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  VG UUID               GPsU3q-4Kv3-oRUk-rgLc-MKcw-eeL9-dA0z6L</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  --- Logical volume ---</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  LV Name                /dev/vgelg/lvelg</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  VG Name                vgelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  LV UUID                fjgl50-jLY1-72NL-VH9z-L1hX-JUo8-fMtJAy</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  LV Write Access        read/write</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  LV Status              available</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  # open                 1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  LV Size                1.07 TB</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Current LE             281600</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Segments               1</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Allocation             inherit</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Read ahead sectors     32768</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Block device           253:4</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  --- Physical volumes ---</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV Name               /dev/sdk4     </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV UUID               zm8X2J-aT8Q-CV9u-YnyE-cghe-oQlH-pefMJv</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV Status             allocatable</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Total PE / Free PE    76799 / 6399</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV Name               /dev/sdk3     </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV UUID               P7gDOr-Z9d7-tBJz-Jq84-j3nj-c0gL-5I1RRT</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV Status             allocatable</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Total PE / Free PE    76799 / 6399</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV Name               /dev/sdk2     </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV UUID               eOqwcK-2SJI-xuIT-daBW-sLfZ-Tu18-eTZBgl</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV Status             allocatable</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Total PE / Free PE    76799 / 6399</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV Name               /dev/sdk1     </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  PV UUID               nDlr5E-4bCh-sAOh-NjDe-fYn2-73Kd-lnqLxr</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  PV Status             allocatable</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Total PE / Free PE    76799 / 6399</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">   </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># lvdisplay /dev/vgelg/lvelg -v</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">    Using logical volume(s) on command line</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  --- Logical volume ---</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  LV Name                /dev/vgelg/lvelg</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  VG Name                vgelg</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  LV UUID                fjgl50-jLY1-72NL-VH9z-L1hX-JUo8-fMtJAy</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  LV Write Access        read/write</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  LV Status              available</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  # open                 1</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  LV Size                1.07 TB</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Current LE             281600</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Segments               1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Allocation             inherit</span><br style="font-family: courier new,monospace;">


<span style="font-family: courier new,monospace;">  Read ahead sectors     32768</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Block device           253:4</span><br>


</div>   <br></div>
<br>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div><br></div>