multiple of sector size I/O restriction

Jean-Yves Lefort jylefort at FreeBSD.org
Sun Apr 23 16:30:54 UTC 2006


On Sun, 23 Apr 2006 18:10:50 +0200
"Poul-Henning Kamp" <phk at phk.freebsd.dk> wrote:

> In message <20060423175605.35a26523.jylefort at FreeBSD.org>, Jean-Yves Lefort wri
> tes:
> 
> >> >Which causes this:
> >> >
> >> >	# dd if=3D/dev/ad1 of=3Dtest bs=3D512 count=3D1
> >> >	1+0 records in
> >> >	1+0 records out
> >> >	512 bytes transferred in 1.889527 secs (271 bytes/sec)
> >> >
> >> >	# dd if=3D/dev/ad1 of=3Dtest bs=3D513 count=3D1
> >> >	dd: /dev/ad1: Invalid argument
> >> >	0+0 records in
> >> >	0+0 records out
> >> >	0 bytes transferred in 0.000254 secs (0 bytes/sec)
> >> >
> >> >Why this restriction?
> >> 
> >> That is how disks work.
> >
> >I should reformulate my question.
> >
> >I've found some linux code which reads from a raw cd device in
> >non-multiples of the sector size; I imagine that this code works on
> >linux. This leads me to think that it is possible to overcome the
> >hardware limitation by software means. Am I right?
> 
> Yes, the linux kernel does not give access to the raw disks, you
> always have to pass though their buffer cache.
> 
> FreeBSD does never give you access to the buffer cache but always
> sends you directly to the disk.
> 
> The userland application will have to read an integral number of
> sectors at their physical boundaries on FreeBSD.

Do you think it would be feasible (from a performance and/or
complexity standpoint) to add the necessary magic to GEOM so that the
restriction is lifted?

-- 
Jean-Yves Lefort

jylefort at FreeBSD.org
http://lefort.be.eu.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20060423/723e3090/attachment.pgp


More information about the freebsd-geom mailing list