CF card and /dev filesystem entries

Brian Candler B.Candler at
Sun Nov 20 13:05:03 PST 2005

On Wed, Nov 16, 2005 at 05:57:12PM +0100, Roland Smith 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.
> <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).

No joy.

root at billdog brian# ls /dev/da0*
root at billdog brian# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
Re-scan of bus 2 was successful
Re-scan of bus 3 was successful
root at billdog brian# ls /dev/da0*

Another suggestion was:

> 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

Now, that does the job:

root at billdog brian# dd if=/dev/null of=/dev/da0 count=0
0+0 records in
0+0 records out
0 bytes transferred in 0.000028 secs (0 bytes/sec)
root at billdog brian# ls -l /dev/da0*
crw-r-----  1 root  operator    0, 107 Nov 20 21:00 /dev/da0
crw-r-----  1 root  operator    0, 115 Nov 20 21:00 /dev/da0s1
root at billdog brian# 

However, I'm not sure I actually *like* opening my CF card in such a way
that I would be likely to overwrite the partition table if I hit a wrong



More information about the freebsd-stable mailing list