<div dir="ltr">These are not different LVM processes. The container process is using the LVM binary that the node itself has. We have achieved this by using scripts that point to the same lvm binary that is used by the node.<div><br></div><div>Configmap(~shell script) used for the same has the following contents where `/host` refers to the root directory of the node:</div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(204,120,50)">get_bin_path</span>: |<br>  #!/bin/sh<br>  bin_name=$1<br>  if [ -x /host/bin/which ]; then<br>    echo $(chroot /host /bin/which $bin_name | cut -d ' ' -f 1)<br>  elif [ -x /host/usr/bin/which ]; then<br>    echo $(chroot /host /usr/bin/which $bin_name | cut -d ' ' -f 1)<br>  else<br>    $(chroot /host which $bin_name | cut -d ' ' -f 1)<br>  fi</pre></div><div><pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(204,120,50)">lvcreate</span>: |<br>  #!/bin/sh<br>  path=$(/sbin/lvm-eg/get_bin_path "lvcreate")<br>  chroot /host $path "$@"</pre></div><div>Also, the above logs in the pastebin link have errors because the vg lock has not been acquired and hence creation commands will fail. Once the lock is acquired, the `strace -f` command gives the following output being stuck. Check out this link for full details -> <a href="https://pastebin.com/raw/DwQfdmr8">https://pastebin.com/raw/DwQfdmr8</a></div><div><br></div><div>P.S: We at OpenEBS are trying to provide lvm storage to cloud native workloads with the help of kubernetes CSI drivers and since all these drivers run as pods and help dynamic provisioning of kubernetes volumes(storage) for the application, the lvm commands needs to be run from inside the pod. Reference -> <a href="https://github.com/openebs/lvm-localpv">https://github.com/openebs/lvm-localpv</a></div><div><br></div><div>Regards</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 1 Jun 2022 at 13:06, Demi Marie Obenour <<a href="mailto:demi@invisiblethingslab.com">demi@invisiblethingslab.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Wed, Jun 01, 2022 at 12:20:32AM +0530, Abhishek Agarwal wrote:<br>
> Hi Roger. Thanks for your reply. I have rerun the command with `strace -f`<br>
> as you suggested. Here is the pastebin link containing the detailed output<br>
> of the command: <a href="https://pastebin.com/raw/VRuBbHBc" rel="noreferrer" target="_blank">https://pastebin.com/raw/VRuBbHBc</a><br>
<br>
Even if you can get LVM “working”, it is still likely to cause data<br>
corruption at some point, as there is no guarantee that different LVM<br>
processes in different namespaces will see each others’ locks.<br>
<br>
Why do you need to run LVM in a container?  What are you trying to<br>
accomplish?<br>
-- <br>
Sincerely,<br>
Demi Marie Obenour (she/her/hers)<br>
Invisible Things Lab<br>
_______________________________________________<br>
linux-lvm mailing list<br>
<a href="mailto:linux-lvm@redhat.com" target="_blank">linux-lvm@redhat.com</a><br>
<a href="https://listman.redhat.com/mailman/listinfo/linux-lvm" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/linux-lvm</a><br>
read the LVM HOW-TO at <a href="http://tldp.org/HOWTO/LVM-HOWTO/" rel="noreferrer" target="_blank">http://tldp.org/HOWTO/LVM-HOWTO/</a><br>
</blockquote></div>