Наши партнеры

Книги по Linux (с отзывами читателей)

Библиотека сайта rus-linux.net

USB Device Filesystem

The USB device filesystem is a dynamically generated filesystem, similar to the /proc filesystem. This filesystem can be mounted just about anywhere, however it is customarily mounted on /proc/bus/usb, which is an entry node created by the USB code, intended to be used as a mount point for this system. Mounting in other locations may break utilities.

You need to select "Preliminary USB Device Filesystem" to make this work. You also need to enable general /proc support, and to have it mounted (normally automatic).

To mount the filesystem, you need to be root. Use the mount command: mount -t usbdevfs none /proc/bus/usb. Note that the none keyword is arbitrary - you can use anything, and some people prefer to use usbdevfs, as it makes the mount output look better.

If you do not want to have to mount the filesystem everytime you reboot the system, you can add the following to /etc/fstab after the /proc entry:
none            /proc/bus/usb             usbdevfs        defaults   0   0
This has the same effect as the mount command.
After you have mounted the filesystem, the contents of /proc/bus/usb should look something like:
dr-xr-xr-x   1 root     root            0 Jan 26 10:40 001
-r--r--r--   1 root     root            0 Jan 26 10:40 devices
-r--r--r--   1 root     root            0 Jan 26 10:40 drivers
. You may have more than one numbered entry if your machine has more than one universal serial bus controller.

Full interpretation of the devices and drivers files is provided later in this guide, in the user's section. Use of the numbered entries is provided later in this guide, in the programmer's guide.