static umass numbering

Bernd Walter ticso at cicely12.cicely.de
Tue Jan 18 03:18:01 PST 2005


On Tue, Jan 18, 2005 at 11:36:12AM +0100, Robert Blacquiere wrote:
> Hi folks,
> 
> I have got a couple of usb mass storage devices which work nicely with FreeBSD.
> But they are numbered chronological on insertion. I would like some sort of
> static numbering scheme for easing up for example automounting. 
> Now i use a hand script which take de base da[0-9]+ numbering as var but hate 
> this way of working. 
> 
> Does anybody know a more lazy way to do such thing?

Unfortunately there is no easy way.
Hardwiring as such is impossible with USB devices.

You can camcontrol -v to get a clue about which da* is part of which
umass* device.

With devinfo -v you get the serial number of each umass device (if your
devices have serial numbers) and the connection tree.

You can use devd to get an attach/detach notifications to setup
softlinks in /dev which point to the changing nodenames.
Unfortunately devd is started befor /usr is mounted so the tools you
can use in devd scripts are limited.
In case of automounting I would suggest you identify the device at
mount time instead of going the devd way.

This is with 5.3 and current - under FreeBSD 4 things are a bit more
complicated.

happy scripting...

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd at bwct.de                                  info at bwct.de



More information about the freebsd-mobile mailing list