consistent device name

consistent device name

Tzafrir Cohen tzafrir at cohens.org.il
Wed Jan 5 14:58:43 IST 2011


On Wed, Jan 05, 2011 at 02:25:39PM +0200, Erez D wrote:
> HI
> 
> I have 2 identical USB to Serial dongles
> 
> If I connect them to an XP box, i get assigned a COM port according to the
> usb port i connected to
> If I connect them to a Linux Box, i get assigned a ttyUSBn port according to
> the order i connected them
> 
> 
> as i am not always aware of the order i connect them, and it is not uniquly
> defined if the are both connected at boot time,
> I get the device name swapped every reboot.
> 
> 
> is there a way to assign a constant device name according to the USB port it
> is connected to and not via the order it is connected
> (under linux of course)

Use the symlinks under /dev/serial/by-id rather than /dev/ttyUSBn
directly.

Or figure out how they are generated from the udev rules, and make your own
custom constant device names. At first glance this is
/lib/udev/rules.d/60-persistent-serial.rules on my system.

-- 
Tzafrir Cohen         | tzafrir at jabber.org | VIM is
http://tzafrir.org.il |                    | a Mutt's
tzafrir at cohens.org.il |                    |  best
tzafrir at debian.org    |                    | friend



More information about the Linux-il mailing list