bhyve VM stopped to boot after moving virtio disks

Mark Millard marklmi at yahoo.com
Sat Apr 20 18:44:41 UTC 2019



On 2019-Apr-20, at 10:45, Igor Mozolevsky <igor at hybrid-lab.co.uk> wrote:

> On Sat, 20 Apr 2019 at 18:00, Ian Lepore wrote:
> 
> <snip>
>> dd absolutely will fail to copy the last block of the source if it
>> isn't exactly the blocksize and you didn't specify conv=sync, and it
>> will return a zero status when doing so.  It appears you've convinced
>> yourself otherwise, but for anyone else reading this thread, be aware:
>> conv=sync is required to copy the last part of the source if it's
>> smaller than the blocksize.
> 
> 
> Isn't that contrary to the POSIX Spec? Reading the manual [1], it is
> implied (from STDERR part of the main section) that dd will read and
> write partial blocks, cf. truncated blocks?..
> 
> 1. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html

Have you tried as Ian suggests to see if it made a difference?
Ian seems to be speaking FreeBSD, not necessarily POSIX. (I'm
talking actual FreeBSD behavior here, not necessarily documented
behavior.)

It turns out that https://www.freebsd.org/cgi/man.cgi?dd(1) does say:

     Normally, data resulting from input or conversion or both are aggregated
     into output blocks	of the specified size.	After the end of input is
     reached, any remaining output is written as a block.  This	means that the
     final output block	may be shorter than the	output block size.

where conv=sync is described as:

sync
     Pad every input block to the input buffer size. Spaces
     are used for pad bytes if a block oriented conversion
     value is specified, otherwise NUL bytes are used.

(So sync changes the overall input size when it adds pad bytes, at
least as documented.)

It appears to me that Ian's expectations of the actual behavior and
the FreeBSD documentation of such are not a match. Absent testing,
I'd bet on Ian, even if it means FreeBSD dd has a bug.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)



More information about the freebsd-hackers mailing list