<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 21, 2017 at 3:55 AM, Pino Toscano <span dir="ltr"><<a href="mailto:ptoscano@redhat.com" target="_blank">ptoscano@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<span class="gmail-"><br>
On Monday, 20 November 2017 22:57:04 CET David Kaylor wrote:<br>
> I was trying out virt-builder and noticed that in some directories I<br>
> receive an error when the image is resized.<br>
><br>
> For example, if I run the following command from my home directory it works<br>
> fine:<br>
><br>
> virt-builder rhel-7.4 --size 10G --output test.img<br>
><br>
> If I run the same command from /tmp or /vms (my default libvirt pool), I<br>
> see the following in my verbose output:<br>
><br>
> virt-resize '--verbose' '--format' 'raw' '--output-format' 'raw' '--expand'<br>
> '/dev/sda3' '--unknown-filesystems' 'error' 'test.img' 'test.img'<br>
> command line: virt-resize --verbose --format raw --output-format raw<br>
> --expand /dev/sda3 --unknown-filesystems error test.img test.img<br>
> virt-resize: error: you cannot use the same disk image for input and output<br>
><br>
> Am I doing something wrong or is this possibly a bug? The host I am running<br>
> virt-builder on is Fedora 27.<br>
<br>
</span>The only thing it comes into my mind is that there is already a file<br>
called "test.img" in the directories where it fails.<br>
<br>
Can you please check that, and provide also a full log virt-builder<br>
with -v -x?<br>
<br>
Thanks,<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
Pino Toscano</font></span></blockquote></div><br>Thanks, Pino. Attached is the requested log. A few other observations:</div><div class="gmail_extra"><br></div><div class="gmail_extra">In most directories, I can run the command successfully whether a file of the same name is present or not.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Looking at the verbose output, it appears that a randomly-generated name in /var/tmp is used for the indisk. Example:</div><div class="gmail_extra"><br></div><div class="gmail_extra">virt-resize --verbose --format raw --output-format raw --expand /dev/sda3 --unknown-filesystems error /var/tmp/vbaf3053.img test.img<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">For directories where it fails, both the indisk and outdisk are the same:<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">virt-resize --verbose --format raw --output-format raw --expand /dev/sda3 --unknown-filesystems error test.img test.img<br></div><div><br></div></div><div class="gmail_extra">-David
</div></div>