Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Apr 2019 22:31:44 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: bhyve VM stopped to boot after moving virtio disks
Message-ID:  <20190420203144.GA3390@c720-r342378>
In-Reply-To: <b0d23ad4b9f442a1a7342306443b855407f0765c.camel@freebsd.org>
References:  <alpine.BSF.2.20.1904192255290.97274@puchar.net> <2006ff8da153bbe5e7f620da9260ee1518bd248f.camel@freebsd.org> <alpine.BSF.2.20.1904201729190.99712@puchar.net> <b0d23ad4b9f442a1a7342306443b855407f0765c.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
El día sábado, abril 20, 2019 a las 10:56:45a. m. -0600, Ian Lepore escribió:

> > no it wasn't. but dd doesn't truncate last block. checked - it got
> > copied 
> > till the end - i see second copy of GPT partition table that was
> > present 
> > in VM.
> > 
> 
> 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.

Writing to a plain file or char device, will write the last block in the
available size of bytes:

$ truss dd if=backupKDE-20190419.tgz of=/dev/null bs=8m
...
read(3,"\M^_\M^_\M^Wi\M-F\^?\n\M-J\M-%T"...,8388608) = 8388608 (0x800000)
write(4,"\M^_\M^_\M^Wi\M-F\^?\n\M-J\M-%T"...,8388608) = 8388608 (0x800000)
read(3,"%\M-b\M^Y!\M^Ud\M^B\\\M^BA \^^"...,8388608) = 8169189 (0x7ca6e5)
                                                      ^^^^^^^
read(3,0x8015cb065,8388608)			 = 0 (0x0)
write(4,"%\M-b\M^Y!\M^Ud\M^B\\\M^BA \^^"...,8169189) = 8169189 (0x7ca6e5)
                                                       ^^^^^^^
close(4)					 = 0 (0x0)
clock_getres(0x4,0x7fffffffe3c8)		 = 0 (0x0)
20+1 records in
20+1 records out
write(2,"20+1 records in\n20+1 records ou"...,33) = 33 (0x21)


	matthias
-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
N € I N zur EU!
"Gegen das EU-Europa der Banken, Konzerne und Kriegstreiber.
Für ein soziales und friedliches Europa der Völker." DKP



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190420203144.GA3390>