Is there a way in FreeBSD to ensure that, for example, a specific usb drive (or any device for that matter) is always configured as (for example) /dev/da1?
tunefs: /dev/da0s1d: failed to write superblock
Variables that can be used with the match statement
A partial list of variables and their possible values that can be used
together with the match statement.
Variable Description
bus Device name of parent bus.
cdev Device node path if one is created by the devfs(5) filesys-
tem.
cisproduct CIS-product.
cisvendor CIS-vendor.
class Device class.
device Device ID.
devclass Device Class (USB)
devsubclass Device Sub-class (USB)
device-name Name of attached/detached device.
endpoints Endpoint count (USB)
function Card functions.
interface Interface ID (USB)
intclass Interface Class (USB)
intprotocol Interface Protocol (USB)
intsubclass Interface Sub-class (USB)
manufacturer Manufacturer ID (pccard).
mode Peripheral mode (USB)
notify Match the value of the ``notify'' variable.
parent Parent device
port Hub port number (USB)
product Product ID (pccard/USB).
release Hardware revision (USB)
serial Serial Number (USB).
slot Card slot.
subvendor Sub-vendor ID.
subdevice Sub-device ID.
subsystem Matches a subsystem of a system, see below.
system Matches a system type, see below.
type Type of notification, see below.
vendor Vendor ID.
attach 100 {
device-name "ugen[0-9].[0-9]";
match "vendor" "0x04b8";
match "product" "0x010a";
action "usb_devaddr=`echo $device-name | sed 's#^ugen##'` && \
chown root:wheel /dev/usb/${usb_devaddr}.* && \
chmod 0660 /dev/usb/${usb_devaddr}.* && \
ln -s /dev/usb/${usb_devaddr} /dev/walkman";
};
I am not sure about the error (perhaps the filesystem is mounted?), but the labeling option is *capital* -L.ikbendeman said:I've tried using tunefs -l label /dev/device but I get the following:
Code:tunefs: /dev/da0s1d: failed to write superblock
Beastie said:I am not sure about the error (perhaps the filesystem is mounted?), but the labeling option is *capital* -L.
Read man pages very carefully. You will end up b0rking a system one day this way.
wblock said:Here's an example:
Code:attach 100 { device-name "ugen[0-9].[0-9]"; match "vendor" "0x04b8"; match "product" "0x010a"; action "usb_devaddr=`echo $device-name | sed 's#^ugen##'` && \ chown root:wheel /dev/usb/${usb_devaddr}.* && \ chmod 0660 /dev/usb/${usb_devaddr}.* && \ ln -s /dev/usb/${usb_devaddr} /dev/walkman"; };
(Untested, variation of one of my existing devices.) You'll have to change the vendor and product IDs for your device. And you need a detach entry to remove the link when you unplug the device.