Bug 20725

Summary: Raw floppy writes fail for partial bytes.
Product: Base System Reporter: mwm
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description mwm 2000-08-20 11:20:01 UTC
	It appears that partial block writes to a floppy disk are failing.
	This means that writing an arbitrary sized binary (like the second
	stage of the grub boot loader) to disk fails to write the last
	partial sector.

Fix: 

Well, I work around it by padding files - but that shouldn't
	be required.
How-To-Repeat: 
	Find a file smaller than a floppy that has a size that is *not* evenly
	divisible by 512 (making it an odd number is probably best; I did not
	try sizes smaller than 512 bytes), and try copying it to a floppy via
	either:
	
	cat TESTFILE > /dev/fd0
	dd if=TESTFILE of=/dev/fd0 bs=512

	and observe the error message. dd is more informative, as it
	shows that the last partial write is what failed.
Comment 1 Joerg Wunsch freebsd_committer freebsd_triage 2001-08-10 13:47:07 UTC
State Changed
From-To: open->closed

This is normal and expected behaviour for a `raw' device: all IO 
requests need to be multiples of the hardware block size (typically 
512 bytes, but can be larger iff the medium block size is larger, like 
for non-standard floppies, MO media, or CD-ROMs). 

Use a tool like tar or cpio when copying arbitrary stuff to raw 
devices.