From mwm@mired.org  Sun Aug 20 03:15:55 2000
Return-Path: <mwm@mired.org>
Received: from guru.mired.org (zoom0-049.telepath.com [216.14.0.49])
	by hub.freebsd.org (Postfix) with SMTP id B1FCB37B43C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 20 Aug 2000 03:15:53 -0700 (PDT)
Received: (qmail 89077 invoked by uid 100); 20 Aug 2000 10:15:17 -0000
Message-Id: <20000820101517.89076.qmail@guru.mired.org>
Date: 20 Aug 2000 10:15:17 -0000
From: mwm@mired.org
Reply-To: mwm@mired.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: Raw floppy writes fail for partial bytes.
X-Send-Pr-Version: 3.2

>Number:         20725
>Category:       bin
>Synopsis:       Raw floppy writes fail for partial bytes.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 20 03:20:01 PDT 2000
>Closed-Date:    Fri Aug 10 14:47:07 MEST 2001
>Last-Modified:  Fri Aug 10 14:49:37 MEST 2001
>Originator:     Mike Meyer
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
Missionaria Phonibalonica
>Environment:

	-current updated and built as of Aug 19, ~ 3am PDT.

>Description:

	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.

>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.

>Fix:

	Well, I work around it by padding files - but that shouldn't
	be required.


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Fri Aug 10 14:47:07 MEST 2001 
State-Changed-Why:  
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. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=20725 
>Unformatted:
