$ udevinfo -a -p $(udevinfo -q path -n /dev/sdc)
http://linux.togaware.com/survivor/Using_UDEV.html http://www.linuxtopia.org/online_books/linux_beginner_books/debian_linux_desktop_survival_guide/Using_UDEV.shtml
Debian Packages: udev hotplug
A problem that plagued earlier versions of the GNU/Linux kernel was that each time a USB device (and other devices) was connected a different mount point would be assigned. This issue was addressed in the 2.6 kernels using udev with hotplug. With udev, naming rules (e.g., in /etc/udev/rules.d/local.rules) are used to provide stable names for use in /etc/fstab. Udev uses information exported by the kernel drivers to the sysfs filesystem (usually mounted on /sys) to identify specific devices and to then associate them with specific names in /dev.
The key to using udev is with the rules that are defined to identify and distinguish the different USB devices that may be connected. A tutorial for writing udev rules is available from http://www.reactivated.net/udevrules.php.
The first step is to identify the USB device in some way. The udevinfo command can be used to identify a device path, which can then be used to identify information about the device on that path. For example, to identify a specific Flash Memory device which is recognised in GNU/Linux as a SCSI device, connect the device and run the command:
$ udevinfo -a -p $(udevinfo -q path -n /dev/sdc)
The /dev/sdc path here is whatever the dmesg command identifies. Select some identifying piece of information, like the product identifier (the line that (each rule must be on a single line).
Subsections
Flash Memory
Camera
iPod
Card Reader
MP3 Player o iRiver H340 o iRiver ifp796
Ethernet Cards
Examples
Kernel 2.6 has begun the use of udev for handling devices for making those files in /dev that previous kernels just created permanently. udev creates these files as needed. Setting up udev so that when you plug in a palm and then have /dev/pilot as the assigned device is not difficult. I got the information on how to do this at http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimerMisc.html. I am using Debian Sarge with 2.6.8-2-386 kernel.
General procedure
Hook up the device and turn it on.
Get information specific to the device using udevinfo.
Write a line containing this information and your chosen name for the file in /dev in the file /etc/udev/rules.d/udev.rules (or 10-udev.rules or whatever it is on your system).
Create a mount point directory.
Write a line in /etc/fstab for the mount if appropriate.
[... Followed by detailed examples like Jump (thumb) drive...]
This article describes how to use persistent names for your block devices. This has been made possible by the introduction of udev and has some advantages over bus-based naming.
1 Why persistent naming? 2 Which name should I use? o 2.1 by-label o 2.2 by-uuid o 2.3 by-id and by-path 3 Enabling persistent naming o 3.1 In fstab o 3.2 In your boot manager
All your partitions that have one are listed in the /dev/disk/by-label directory.
kernel /boot/vmlinuz26 root=/dev/disk/by-label/root vga=0x318 ro
or
kernel /boot/vmlinuz26 root=/dev/disk/by-uuid/2d781b26-0285-421a-b9d0-d4a0d3b55680 vga=0x318 ro
Check the original wiki for all the prerequisites that have to be met.
documented on: 2007.01.04
Newsgroups: gmane.linux.debian.user Date: Sat, 1 Sep 2007
> I am having problems mounting one of my USB disks by > its UUID. Mounting the drive as /dev/sdx# works > flawlessly. As I am not sure how to approach the > problem, here is some of the stuff that I have tried: > > blkid correctly lists the disk and corresponding info. > /dev/disk/by-uuid does not list the UUID of the disk > vol_id /dev/sdx# gives the error message /dev/sdx#: > unknown volume type > vol_id --type vfat /dev/sdx# results in vfat: error > opening volume
what does 'ls -l /dev/disk/by-uuid/' and 'ls -l /dev/disk/by-id/' show? You can IIRC also use the by-id instead of by-uuid.
Kevin Mark @verizon.net
I had the same problem when adding a new SCSI disk.
I found that the device did show up in /dev/disk/by-id
tomviolin @tomhansen.com
What is UDEV?
Steps to Setting Up UDEV.
Kernel configuration.
Kernel-2.6.13 and greater configuration.
Pre 2.6.13 Kernel configuration.
Emerge Udev.
Setup Hotplug.
Sys folder.
Fstab mounting.
Update baselayout.
Edit the scripts.
Newer Baselayout ( >=1.11.13-r1 ).
Baselayout ( >=1.8.6.13-r1 <=1.11.13-r1).
Old Baselayout ( <1.8.6.13-r1 )
Console & Null devices.
Nvidia drivers.
Bootloader.
Rebooting Results.
Problem Devices.
Snippet of How to Write UDEV Rules.
Misc Devices: Palm Pilots, Flash Drive (Thumb, Pen,..)
Links
UDEV seems to replace DEVFS. Actualy, DEVFS is not really supported anymore.
Kernel 2.6 with udev support.
Just call
apt-get install udev gnome-volume-manager
Add sysfs in fstab
none /sys sysfs defaults 0 0
and mount it
mount /sys
Each device seems to be identified by a model and vendor. Here how to find out these values.
Plug in your USB device and get the device name:
tail -n 20 /var/log/message
You should find sda or sdb or something like this.
In the next steps, replace sda with what you have found before.
Call
udevinfo -q path -n /dev/sda udevinfo -a -p /sys/block/sda | grep BUS udevinfo -a -p /sys/block/sda | grep model udevinfo -a -p /sys/block/sda | grep vendor
You should find something like:
BUS="scsi" SYSFS{model}="..." SYSFS{vendor}="Apacer "
Add and entry in /etc/udev/udev.rules:
BUS="scsi", SYSFS{vendor}="Apacer ", NAME="apacer%n", SYMLINK="%k"
Create directory for script to be called (replace apacer with your vendor name)
mkdir /etc/dev.d/apacer-1
and copy the following script in /etc/dev.d/apacer-1/mount
#!/bin/sh if [ "$ACTION" == "add" ] then USER=`ps -elf | grep x-session-manager | cut -d " " -f 3 | head -n 1` su -c "mount /media/palmint-1" $USER fi
Create mountpoint:
mkdir /media/apacer-1
add following line in your /etc/fstab:
/dev/apacer-1 /media/apacer-1 auto user,noauto,noatime,sync,defaults
Hal-volume-manager can show a lot informations about your hardware, but I couldn't find a package providing it.
DEVFS is the old implementation of the dynamic device allocation. It has been replaced by UDEV.