From owner-freebsd-geom@FreeBSD.ORG Sun Apr 23 16:10:53 2006 Return-Path: X-Original-To: freebsd-geom@FreeBSD.org Delivered-To: freebsd-geom@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 253B816A404; Sun, 23 Apr 2006 16:10:53 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5F79243D6D; Sun, 23 Apr 2006 16:10:52 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 374561703F; Sun, 23 Apr 2006 16:10:51 +0000 (UTC) To: Jean-Yves Lefort From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 23 Apr 2006 17:56:05 +0200." <20060423175605.35a26523.jylefort@FreeBSD.org> Date: Sun, 23 Apr 2006 18:10:50 +0200 Message-ID: <889.1145808650@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-geom@FreeBSD.org Subject: Re: multiple of sector size I/O restriction X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Apr 2006 16:10:53 -0000 In message <20060423175605.35a26523.jylefort@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. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.