dd to floppies broken?

Dan Nelson dnelson at allantgroup.com
Thu Aug 21 11:43:00 PDT 2003


In the last episode (Aug 21), Brian Reichert said:
>   % ls -ln memtest86-*/precomp.bin
>   -rw-------  1 1001  1001  84480 Feb 28  2002 memtest86-2.9/precomp.bin
>   -rwx--x--x  1 1001  1001  84420 May 21  2002 memtest86-3.0/precomp.bin
> 
> When copying these to a floppy as root (using two different machines,
> and several floppes for testing:)
> 
>   # dd bs=8192 of=/dev/fd0 if=memtest86-2.9/precomp.bin
>   10+1 records in
>   10+1 records out
>   84480 bytes transferred in 3.775199 secs (22378 bytes/sec)
> 
>   # dd bs=8192 of=/dev/fd0 if=memtest86-3.0/precomp.bin 
>   dd: /dev/fd0: Invalid argument
>   10+1 records in
>   10+0 records out
>   81920 bytes transferred in 3.731600 secs (21953 bytes/sec)
> 
> Got any quick clues, or should I just file a PR now?  (I don't
> even know what to report, really...)

You can only write full blocks to raw devices.  The first file is
84480/512 = 165 disk blocks on the dot.  The second file is 164.8828125
blocks, and that last fragment is why the dd is failing.  Try adding
conv=osync to your dd line to tell it to pad the last block out.

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-hackers mailing list