<div dir="ltr"><div class="gmail_extra"><div>On Fri, May 31, 2013 at 3:55 PM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br></div><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, May 31, 2013 at 10:58:30AM +0800, Qiu Yu wrote:<br>
> Unfortunately, the standard 'disk' group permission only applies to<br>
> /dev/sdX device nodes, not to device mapper nodes created by LVM commands.<br>
<br>
</div>Actually, it depends on udev rules.  On my machine device mapper<br>
nodes very much are owned by the disk group:<br>
<br>
$ ll /dev/dm-*<br>
brw-rw----. 1 root disk 253,  0 May 15 13:26 /dev/dm-0<br>
brw-rw----. 1 root disk 253,  1 May 15 13:26 /dev/dm-1<br>
brw-rw----. 1 root disk 253, 10 May 24 13:54 /dev/dm-10<br>
brw-rw----. 1 root disk 253, 11 May 15 13:26 /dev/dm-11<br>
brw-rw----. 1 root root 253, 12 May 29 21:29 /dev/dm-12<br>
[etc]<br>
<br>
You can add udev rules to change the ownership.  See:<br>
<br>
<a href="https://wiki.archlinux.org/index.php/Udev" target="_blank">https://wiki.archlinux.org/index.php/Udev</a><br>
<div class="im"><br>
Rich.<br>
<br>
</div></blockquote><div><br></div><div style>Thanks Richard, you're right. I just find out myself few moments ago.</div><div style><br></div><div style>Actually I'm looking into an issue with OpenStack / Libvirt manipulating LVM as an image backend. When the logical volume is created, udev rules will set the ownership to root:disk. After libvirt actually starting an instance, device node ownership will change to qemu:qemu by libvirt. Then, if you stop an instance, the device node ownership will change back to root:root. Seems there's some inconsistency here.</div>

<div><br></div><div style>Anyway, it has nothing to do with the libguestfs. Thank you so much for your help and the information! :)</div><div><br></div><div>--</div><div style>Qiu Yu </div></div><br></div></div>