[TriLUG] Error checking for dd?
Brian via TriLUG
trilug at trilug.org
Wed Dec 21 09:37:28 EST 2016
My money's on sync.
I've got some SD cards that have horrifying write speeds (< 5 MiB/sec).
Kernel caching can allow dd to finish with hundreds of kB waiting to
be written to the medium.
A handy trick I recently discovered is the command "watch", which can
show you the amount (in bytes) of cached write operations waiting. This
can be very helpful when wondering why sync or umount (which calls sync)
is seemingly hung.
watch grep -e Dirty: -e Writeback: /proc/meminfo
Courtesy of:
http://unix.stackexchange.com/questions/48235/can-i-watch-the-progress-of-a-sync-operation
HTH, YMMV, IANAL, IMHO, OMGWTFBBQ,
-Brian
On 12/20/2016 09:48 PM, Bill Farrow via TriLUG wrote:
> On Wed, Dec 21, 2016 at 10:50 AM, vikram sai balaji ulaganathan via
> TriLUG <trilug at trilug.org> wrote:
>> Md5 sum check.
>>
>> Also do you sync (command sync) after DD and before taking the SD card out.
>
> To sum that all up...
>
> FILENAME=disk-image-file
> FILESIZE=$(stat -c%s "$FILENAME")
>
> dd if=$FILENAME of=/dev/sdX bs=4K
> sync
> dd if=/dev/sdX bs=1 count=$FILESIZE | md5sum
> md5sum $FILENAME
>
More information about the TriLUG
mailing list