Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

My USB device keeps changing its number in its name /dev/ttyUSB?.

I have seen this and this, and tried to do the same with no luck.

gauthier@sobel:/etc/udev/rules.d $ udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB1)

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1/tty/ttyUSB1':

  looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/ttyUSB1':

Then I created a file /etc/udev/rules.d/50-udev.rules (it did not exist) and put this inside:

SUBSYSTEM=="usb-serial", KERNEL=="ttyUSB?", SYMLINK+="ttyUSBserial"

But did not get the symlink, even after udevadm trigger:

gauthier@sobel:/etc/udev/rules.d $ ls /dev|grep USB

How can I create a device name that does not change? What am I doing wrong with my rule?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

If I had read correctly, I would have noticed the differences between the attributes of the device (KERNEL, SUBSYSTEM) and that of the parent device (KERNEL**S**, SUBSYSTEM**S**).

Adding the 'S's in the rule worked!

On the way, I also noticed that udev created a persistent symlink in /dev/serial/by-id/usb-*, through its rules in /lib/udev/rules.d/60-persistent-serial.rules, which I could use instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.