How to write dev rules if all parameters seem to be the same?












0















I have 3 USB SMS Modems, each having 2 (or 4) usb hubs inside The problem is that sometimes modem 1 mounts to /dev/ttyUSB0 and /dev/ttyUSB1 and other times it mounts to /dev/ttyUSB12 and /dev/ttyUSB13. I thought I would look into udevadm and see if I can find some parameter which I can use to write a udev rule. But it turns out that they all have everything the same.



Is there a way to have them mount to a static mount point instead of the kernel deciding where it should mount it?



Here are 2 modems that are on different physical units.



$ udevadm info --query=all --name=/dev/ttyUSB0

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16066645


And here is USB20



$ udevadm info --query=all --name=/dev/ttyUSB20

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
N: ttyUSB20
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB20
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:6.1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_6_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=20
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16225486









share|improve this question























  • Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

    – eblock
    Jan 31 at 7:44
















0















I have 3 USB SMS Modems, each having 2 (or 4) usb hubs inside The problem is that sometimes modem 1 mounts to /dev/ttyUSB0 and /dev/ttyUSB1 and other times it mounts to /dev/ttyUSB12 and /dev/ttyUSB13. I thought I would look into udevadm and see if I can find some parameter which I can use to write a udev rule. But it turns out that they all have everything the same.



Is there a way to have them mount to a static mount point instead of the kernel deciding where it should mount it?



Here are 2 modems that are on different physical units.



$ udevadm info --query=all --name=/dev/ttyUSB0

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16066645


And here is USB20



$ udevadm info --query=all --name=/dev/ttyUSB20

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
N: ttyUSB20
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB20
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:6.1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_6_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=20
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16225486









share|improve this question























  • Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

    – eblock
    Jan 31 at 7:44














0












0








0








I have 3 USB SMS Modems, each having 2 (or 4) usb hubs inside The problem is that sometimes modem 1 mounts to /dev/ttyUSB0 and /dev/ttyUSB1 and other times it mounts to /dev/ttyUSB12 and /dev/ttyUSB13. I thought I would look into udevadm and see if I can find some parameter which I can use to write a udev rule. But it turns out that they all have everything the same.



Is there a way to have them mount to a static mount point instead of the kernel deciding where it should mount it?



Here are 2 modems that are on different physical units.



$ udevadm info --query=all --name=/dev/ttyUSB0

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16066645


And here is USB20



$ udevadm info --query=all --name=/dev/ttyUSB20

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
N: ttyUSB20
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB20
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:6.1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_6_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=20
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16225486









share|improve this question














I have 3 USB SMS Modems, each having 2 (or 4) usb hubs inside The problem is that sometimes modem 1 mounts to /dev/ttyUSB0 and /dev/ttyUSB1 and other times it mounts to /dev/ttyUSB12 and /dev/ttyUSB13. I thought I would look into udevadm and see if I can find some parameter which I can use to write a udev rule. But it turns out that they all have everything the same.



Is there a way to have them mount to a static mount point instead of the kernel deciding where it should mount it?



Here are 2 modems that are on different physical units.



$ udevadm info --query=all --name=/dev/ttyUSB0

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
N: ttyUSB0
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-1/1-1:1.0/ttyUSB0/tty/ttyUSB0
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16066645


And here is USB20



$ udevadm info --query=all --name=/dev/ttyUSB20

P: /devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
N: ttyUSB20
S: serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
S: serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0
E: DEVLINKS=/dev/serial/by-path/pci-0000:02:01.0-usb-0:6.1:1.0-port0 /dev/serial/by-id/usb-FTDI_Quad_RS232-HS-if00-port0
E: DEVNAME=/dev/ttyUSB20
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:01.0/usb1/1-6/1-6.1/1-6.1:1.0/ttyUSB20/tty/ttyUSB20
E: ID_BUS=usb
E: ID_MODEL=Quad_RS232-HS
E: ID_MODEL_ENC=Quadx20RS232-HS
E: ID_MODEL_FROM_DATABASE=FT4232H Quad HS USB-UART/FIFO IC
E: ID_MODEL_ID=6011
E: ID_PATH=pci-0000:02:01.0-usb-0:6.1:1.0
E: ID_PATH_TAG=pci-0000_02_01_0-usb-0_6_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=EHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0800
E: ID_SERIAL=FTDI_Quad_RS232-HS
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=20
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=16225486






linux mount udev modem






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 30 at 8:01









LigaLiga

83




83













  • Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

    – eblock
    Jan 31 at 7:44



















  • Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

    – eblock
    Jan 31 at 7:44

















Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

– eblock
Jan 31 at 7:44





Maybe you could use the MINOR env variable, they differ (0 vs. 20). There's also the DEVPATH or ID_PATH that could be used to distinguish the devices.

– eblock
Jan 31 at 7:44










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497632%2fhow-to-write-dev-rules-if-all-parameters-seem-to-be-the-same%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497632%2fhow-to-write-dev-rules-if-all-parameters-seem-to-be-the-same%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to make a Squid Proxy server?

Is this a new Fibonacci Identity?

19世紀