From owner-freebsd-current@FreeBSD.ORG Sun Jul 1 20:31:30 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D908B16A468 for ; Sun, 1 Jul 2007 20:31:30 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id BECAC13C44B for ; Sun, 1 Jul 2007 20:31:30 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 27873 invoked from network); 1 Jul 2007 20:31:31 -0000 Received: from ppp-71-139-42-13.dsl.snfc21.pacbell.net (HELO ?10.0.5.18?) (nate-mail@71.139.42.13) by root.org with ESMTPA; 1 Jul 2007 20:31:31 -0000 Message-ID: <46880F1C.3020602@root.org> Date: Sun, 01 Jul 2007 13:31:24 -0700 From: Nate Lawson User-Agent: Thunderbird 2.0.0.4 (X11/20070617) MIME-Version: 1.0 To: Dmitry Morozovsky References: <46880400.70808@root.org> <20070702000903.L81781@woozle.rinet.ru> In-Reply-To: <20070702000903.L81781@woozle.rinet.ru> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: current Subject: Re: GEOM weirdness with SD flash reader? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jul 2007 20:31:30 -0000 Dmitry Morozovsky wrote: > On Sun, 1 Jul 2007, Nate Lawson wrote: > > NL> Simply trying to mount a FAT filesystem in an external USB SD flash > NL> reader. The reader works fine, no errors in dmesg. > NL> > NL> deenlo# fdisk da2 > NL> ******* Working on device /dev/da2 ******* > NL> parameters extracted from in-core disklabel are: > NL> cylinders=982 heads=64 sectors/track=32 (2048 blks/cyl) > NL> > NL> parameters to be used for BIOS calculations are: > NL> cylinders=982 heads=64 sectors/track=32 (2048 blks/cyl) > NL> > NL> Media sector size is 512 > NL> Warning: BIOS sector numbering starts with sector 1 > NL> Information from DOS bootblock is: > NL> The data for partition 1 is: > NL> sysid 6 (0x06),(Primary 'big' DOS (>= 32MB)) > NL> start 243, size 2011917 (982 Meg), flag 0 > NL> beg: cyl 0/ head 3/ sector 55; > NL> end: cyl 998/ head 3/ sector 3 > NL> The data for partition 2 is: > NL> > NL> The data for partition 3 is: > NL> > NL> The data for partition 4 is: > NL> > NL> deenlo# mount -t msdosfs /dev/da2s1 /mnt/dos > NL> mount_msdosfs: /dev/da2s1: No such file or directory > NL> deenlo# mount -t msdosfs /dev/da2 /mnt/dos > NL> mount_msdosfs: /dev/da2: Invalid argument > NL> deenlo# mount -t msdosfs /dev/da2s1 /mnt/dos > NL> [success] > NL> > NL> So I'm guessing GEOM had to decide to create /dev/da2s1 after I tried to > NL> mount /dev/da2 directly? Nothing else would create the da2s1 device. > NL> Once the device was created with make_dev(), repeated unmounts/mounts > NL> work fine. > > Do you insert your card after reader got initialized? I have internal reader in > my work machine, and have to use > > dd if=/dev/null of=/dev/daN count=0 > > to [re]initialize GEOM providers on newly inserted card... Yes, you're exactly right. However, shouldn't a read from a device trigger a re-taste if the media is removable? So the fdisk of da2 should have caused it to re-read the MBR and create /dev/da2s1. I think maybe there should be a flag set for devices with removable media that causes the device to be re-tasted on every mount request. Other ideas how to fix this? -- Nate