Running FreeBSD 6.0 here. I have a USB-attached floppy/CF/SD combo reader. On powerup it is detected and I get /dev/da0 as the CF slot: da0 at umass-sim0 bus 0 target 0 lun 0 da0: <OEI-USB CompactFlash 2.0> Removable Direct Access SCSI-0 device da0: 1.000MB/s transfers da0: Attempt to query device size failed: NOT READY, Medium not present da1 at umass-sim0 bus 0 target 0 lun 1 da1: <OEI-USB SM/MS/SD 2.0> Removable Direct Access SCSI-0 device da1: 1.000MB/s transfers da1: Attempt to query device size failed: NOT READY, Medium not present However, when I insert a CF card with normal partioning I need /dev/da0s1, and this is not present in the /dev filesystem because the partition table has not been read. # mount -t msdos /dev/da0s1 /mnt/cf mount_msdosfs: /dev/da0s1: No such file or directory Just reading the first block is not sufficient: # dd if=/dev/da0 of=/dev/null count=1 1+0 records in 1+0 records out 512 bytes transferred in 0.040984 secs (12493 bytes/sec) # mount -t msdos /dev/da0s1 /mnt/cf mount_msdosfs: /dev/da0s1: No such file or directory The only way I can see to *force* the superblock to be read is to attempt to mount the whole device as if it were unpartitioned. This is sufficient to cause the /dev/da0s1 entry to appear in the /dev filesystem. # mount /dev/da0 /mnt/cf mount: /dev/da0 on /mnt/cf: incorrect super block # mount -t msdos /dev/da0s1 /mnt/cf # At this point, everything works as expected. My question is: is there an easier or more direct way to cause the partition table of the CF card to be read and the /dev filesystem to update? Thanks, Brian Candler.
On Wed, Nov 16, 2005 at 10:12:00AM +0000, Brian Candler wrote:> Running FreeBSD 6.0 here. > > I have a USB-attached floppy/CF/SD combo reader. On powerup it is detected > and I get /dev/da0 as the CF slot: > > da0 at umass-sim0 bus 0 target 0 lun 0 > da0: <OEI-USB CompactFlash 2.0> Removable Direct Access SCSI-0 device > da0: 1.000MB/s transfers > da0: Attempt to query device size failed: NOT READY, Medium not present > da1 at umass-sim0 bus 0 target 0 lun 1 > da1: <OEI-USB SM/MS/SD 2.0> Removable Direct Access SCSI-0 device > da1: 1.000MB/s transfers > da1: Attempt to query device size failed: NOT READY, Medium not present > > However, when I insert a CF card with normal partioning I need /dev/da0s1, > and this is not present in the /dev filesystem because the partition table > has not been read.<snip>> The only way I can see to *force* the superblock to be read is to attempt to > mount the whole device as if it were unpartitioned. This is sufficient to > cause the /dev/da0s1 entry to appear in the /dev filesystem.<snip>> At this point, everything works as expected. > > My question is: is there an easier or more direct way to cause the partition > table of the CF card to be read and the /dev filesystem to update?Try 'camcontrol rescan all' (as root). Roland -- R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text. public key: http://www.xs4all.nl/~rsmith/pubkey.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 187 bytes Desc: not available Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20051116/6414f036/attachment.bin
Brian Candler <B.Candler@pobox.com> wrote: > However, when I insert a CF card with normal partioning I need /dev/da0s1, > and this is not present in the /dev filesystem because the partition table > has not been read. > > # mount -t msdos /dev/da0s1 /mnt/cf > mount_msdosfs: /dev/da0s1: No such file or directory > > Just reading the first block is not sufficient: > > # dd if=/dev/da0 of=/dev/null count=1 > 1+0 records in > 1+0 records out > 512 bytes transferred in 0.040984 secs (12493 bytes/sec) > # mount -t msdos /dev/da0s1 /mnt/cf > mount_msdosfs: /dev/da0s1: No such file or directory I think devfs is updated when a descriptor on the device which was opended for writing is closed. But you don't actually have to write anything. That means, the following command should do it: # dd if=/dev/null of=/dev/da0 count=0 Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Perl will consistently give you what you want, unless what you want is consistency." -- Larry Wall