Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a UDEV database to fix USB PATA/SATA bridge contoller issues #746

Merged
merged 1 commit into from
Jul 28, 2020

Conversation

votdev
Copy link
Member

@votdev votdev commented Jun 24, 2020

Introduce a UDEV rules database which fixes the problem of some USB PATA/SATA bridge controllers that they do not pass on the serial number of the attached disks.

To workaround the problem the UDEV rules call the hdparm command for the processed device and adapt the UDEV environment variables that allows other UDEV rules to create correct and unique devicefiles for such devices.

Testing

After updating the UDEV rule you should execute the following commands to reload the rules and apply them.

# udevadm control --reload-rules
# udevadm test /sys/block/sdX
# udevadm info -a -p $(udevadm info -q path -n /dev/sdX)

The fields ID_SERIAL should look like USB-<SERIAL>-0:0 or similar and ID_SERIAL_SHORT should contain the serial number only. The most important part is DEVLINKS, it should now contain a devicefile like /dev/disk/by-id/USB-<SERIAL>-x:x.

References

https://forum.openmediavault.org/index.php?thread/32184-rpi4-quad-says-hat/
https://forum.openmediavault.org/index.php?thread/29145-device-identification-in-case-of-same-sn/
https://forum.openmediavault.org/index.php?thread/33217-omv-5-missing-sata-drives/

Signed-off-by: Volker Theile votdev@gmx.de

  • References issue
  • Includes tests for new functionality or reproducer for bug

KERNEL=="sd*", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="2338", SUBSYSTEMS=="usb", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB-%c", ENV{ID_SERIAL_SHORT}="%c"

# Orico
ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="0080", ATTRS{idProduct}=="a001", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="$env{ID_VENDOR}_$env{ID_MODEL}_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c", SYMLINK="disk/by-path/$env{ID_PATH}", SYMLINK+="disk/by-id/usb-$env{ID_SERIAL}"
Copy link
Member Author

@votdev votdev Jun 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should adapt this to the upper UDEV rules. Comments or concerns on this?

Suggested change
ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="0080", ATTRS{idProduct}=="a001", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="$env{ID_VENDOR}_$env{ID_MODEL}_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c", SYMLINK="disk/by-path/$env{ID_PATH}", SYMLINK+="disk/by-id/usb-$env{ID_SERIAL}"
KERNEL=="sd*", ATTRS{idVendor}=="0080", ATTRS{idProduct}=="a001", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB-%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c"

@votdev votdev force-pushed the udev_rules_devbyid_db branch 4 times, most recently from 9832b38 to 4ce0fa6 Compare June 25, 2020 15:57
@edaney
Copy link

edaney commented Jun 25, 2020

Following your message (https://forum.openmediavault.org/index.php?thread/33249-some-drives-do-not-appear/&postID=243855#post243855), I'll be happy to help you.
Just tell me what to do ?
Eric

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

Following your message (forum.openmediavault.org/index.php?thread/33249-some-drives-do-not-appear/&postID=243855#post243855), I'll be happy to help you.
Just tell me what to do ?
Eric

Thanks for helping. I've added the Testing section in the PR description. All you need to do is to create the files of this PR locally on your system (make sure /lib/udev/serial_id is executable) and reload UDEV. If the rule for your hardware is not available in the PR, then please create a rule for your hardware, test it and if it works post it here, so i can apply it to the pull request.

If you need help please post the output of udevadm info --query=all --name=/dev/sdX to get the required information.

@edaney
Copy link

edaney commented Jun 26, 2020

Hi,

I'm a little confused about what to do.

  1. I created the 2 files 99-openmediavault-dev-disk-by-id.rules and serial_id
  2. I executed "udevadm control --reload-rules" and reboot

Please find below the output for the command "udevadm info --query=all --name=/dev/sdc" (just a example with one disk - Orico 5 bay hardware).

What should I add to the file 99-openmediavault-dev-disk-by-id.rules ?

Thank you


P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37574669
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=External_USB3.0_DISK00_20170331000C3-0:0
E: ID_SERIAL_SHORT=20170331000C3
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: TAGS=:systemd:

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

Hi,

I'm a little confused about what to do.

1. I created the 2 files 99-openmediavault-dev-disk-by-id.rules and serial_id

2. I executed "udevadm control --reload-rules" and reboot

Please find below the output for the command "udevadm info --query=all --name=/dev/sdc" (just a example with one disk - Orico 5 bay hardware).

What should I add to the file 99-openmediavault-dev-disk-by-id.rules ?

Thank you

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37574669
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=External_USB3.0_DISK00_20170331000C3-0:0
E: ID_SERIAL_SHORT=20170331000C3
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: TAGS=:systemd:

You can confirm that ALL devices attached to this device bay have the serial number 20170331000C3?

Could you please tell me the exact product name, so we can add that to the database, too. Otherwise the UDEV rule is a little bit cryptic and nobody knows which hardware this rule belongs too.

If yes, please try this line.

# ORICO Aluminum Alloy 5 Bay USB3.0 to SATA HDD Enclosure with Raid Function (9558RU3)
# http://my.orico.cc/goods.php?id=4827
# JMicron JMS567 SATA 6Gb/s bridge
# https://devicehunt.com/search/type/usb/vendor/152D/device/0567
KERNEL=="sd*", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="0567", SUBSYSTEMS=="block", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB3.0_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c"

After that udevadm info --query=all --name=/dev/sdc should output

...
S: disk/by-id/USB3.0_<SERIAL>-0:0
E: ID_SERIAL=USB3.0_<SERIAL>-0:0
E: ID_SERIAL_SHORT=<SERIAL>
E: DEVLINKS=/dev/disk/by-id/USB3.0_<SERIAL>-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
...

where <SERIAL> is the output of /lib/udev/serial_id /dev/sdc.

@edaney
Copy link

edaney commented Jun 26, 2020

Thanks a lot ! It's seems to be ok. I confirm that all serial number are identical before the modification

The right model of hardware is http://my.orico.cc/goods.php?id=6659

Capture d’écran 2020-06-26 à 14 04 35

Below the output for sdc (in attached file the screenshot from OMV). The only difference is with "devlinks" section where we can't find the but only the old one. I don't know if it's important ?

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37312513
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=USB3.0_WFL0JCDS-0:0
E: ID_SERIAL_SHORT=WFL0JCDS
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: TAGS=:systemd:

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

Thanks a lot ! It's seems to be ok. I confirm that all serial number are identical before the modification

The right model of hardware is http://my.orico.cc/goods.php?id=6659

Capture d’écran 2020-06-26 à 14 04 35

Below the output for sdc (in attached file the screenshot from OMV). The only difference is with "devlinks" section where we can't find the but only the old one. I don't know if it's important ?

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37312513
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=USB3.0_WFL0JCDS-0:0
E: ID_SERIAL_SHORT=WFL0JCDS
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: TAGS=:systemd:

Looks like one step forward :-)

Could you try the UDEV rule below instead of the previous one, maybe this will create the correct devicefile.

KERNEL=="sd*", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="0567", SUBSYSTEMS=="block", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB3.0_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c", SYMLINK+="disk/by-id/$env{ID_SERIAL}"

An alternative:

ACTION=="add", SUBSYSTEM=="block", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="0567", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB3.0_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c", SYMLINK+="disk/by-id/$env{ID_SERIAL}"

@edaney
Copy link

edaney commented Jun 26, 2020

Great ! Now it seems to work with the 2 rules :

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
S: disk/by-id/USB3.0_WFL0JCDS-0:0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37503493
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=USB3.0_WFL0JCDS-0:0
E: ID_SERIAL_SHORT=WFL0JCDS
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0 /dev/disk/by-id/USB3.0_WFL0JCDS-0:0 /dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
E: TAGS=:systemd:

I have 2 Orico and now in OMV, now I can see 10 different drives with 10 serials (see screenshot).
I check if everything works fine

Capture d’écran 2020-06-26 à 14 27 19

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

Great ! Now it seems to work with the 2 rules :

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
S: disk/by-id/USB3.0_WFL0JCDS-0:0
S: disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=37503493
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=USB3.0_WFL0JCDS-0:0
E: ID_SERIAL_SHORT=WFL0JCDS
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0 /dev/disk/by-id/USB3.0_WFL0JCDS-0:0 /dev/disk/by-id/usb-External_USB3.0_DISK00_20170331000C3-0:0
E: TAGS=:systemd:

I have 2 Orico and now in OMV, now I can see 10 different drives with 10 serials (see screenshot).
I check if everything works fine

Capture d’écran 2020-06-26 à 14 27 19

I'm not happy with this, but after getting more familar with UDEV, i think this one should solve the problem:

ACTION=="add", SUBSYSTEM=="block", ENV{ID_VENDOR_ID}=="152d", ENV{ID_MODEL_ID}=="0567", PROGRAM="/lib/udev/serial_id %N", ENV{ID_SERIAL}="USB3.0_%c-$env{ID_INSTANCE}", ENV{ID_SERIAL_SHORT}="%c", SYMLINK="disk/by-path/$env{ID_PATH}", SYMLINK+="disk/by-id/$env{ID_SERIAL}"

@edaney
Copy link

edaney commented Jun 26, 2020

Made the change. Reboot and impossible to reboot (ssh ko and webapp ko). It's not the first time it happened and each time I have to reinstall from the begin ... Expect if you have a tip ?

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

Made the change. Reboot and impossible to reboot (ssh ko and webapp ko). It's not the first time it happened and each time I have to reinstall from the begin ... Expect if you have a tip ?

Without knowing an error i can not give any hint. Plug a monitor and watch the kernel output to get an overview what happens.

@edaney
Copy link

edaney commented Jun 26, 2020

ok thanks. I haven't any micro HDMI cable or moniteur right now (I'll buy one for the next problems). OK I'll reinstall and tell you what happen.

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

@edaney Could you please also run the command udevadm info -a -p $(udevadm info -q path -n /dev/sdc)? I'm interested in the SYSFS attributes.

@edaney
Copy link

edaney commented Jun 26, 2020

Ok, I restart all. Now with the last version of the rule I obtain

P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
N: sdc
L: 0
S: disk/by-id/USB3.0_WFL0JCDS-0:0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc
E: DEVNAME=/dev/sdc
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=32
E: SUBSYSTEM=block
E: USEC_INITIALIZED=99918963
E: ID_VENDOR=External
E: ID_VENDOR_ENC=External
E: ID_VENDOR_ID=152d
E: ID_MODEL=USB3.0_DISK00
E: ID_MODEL_ENC=USB3.0\x20DISK00\x20\x20\x20
E: ID_MODEL_ID=0567
E: ID_REVISION=5203
E: ID_SERIAL=USB3.0_WFL0JCDS-0:0
E: ID_SERIAL_SHORT=WFL0JCDS
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=usb-storage
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=edb7f0ce-d545-411c-9e1c-52e9f8625e32
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-id/USB3.0_WFL0JCDS-0:0 /dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-scsi-0:0:0:0
E: TAGS=:systemd:

@edaney
Copy link

edaney commented Jun 26, 2020

Following your request

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/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0/block/sdc':
KERNEL=="sdc"
SUBSYSTEM=="block"
DRIVER==""
ATTR{discard_alignment}=="0"
ATTR{stat}==" 746 0 51673 3199 0 0 0 0 0 3080 3080 0 0 0 0"
ATTR{inflight}==" 0 0"
ATTR{capability}=="50"
ATTR{events_async}==""
ATTR{events_poll_msecs}=="-1"
ATTR{size}=="3907029168"
ATTR{hidden}=="0"
ATTR{ext_range}=="256"
ATTR{ro}=="0"
ATTR{alignment_offset}=="0"
ATTR{range}=="16"
ATTR{removable}=="0"
ATTR{events}==""

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0/1:0:0:0':
KERNELS=="1:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{eh_timeout}=="10"
ATTRS{queue_type}=="none"
ATTRS{blacklist}=="FORCELUN"
ATTRS{timeout}=="30"
ATTRS{evt_soft_threshold_reached}=="0"
ATTRS{model}=="USB3.0 DISK00 "
ATTRS{iodone_cnt}=="0x34a"
ATTRS{inquiry}==""
ATTRS{ioerr_cnt}=="0x0"
ATTRS{type}=="0"
ATTRS{evt_inquiry_change_reported}=="0"
ATTRS{evt_capacity_change_reported}=="0"
ATTRS{state}=="running"
ATTRS{queue_depth}=="1"
ATTRS{evt_mode_parameter_change_reported}=="0"
ATTRS{evt_media_change}=="0"
ATTRS{vendor}=="External"
ATTRS{iocounterbits}=="32"
ATTRS{scsi_level}=="7"
ATTRS{device_blocked}=="0"
ATTRS{device_busy}=="0"
ATTRS{rev}=="5203"
ATTRS{iorequest_cnt}=="0x34a"
ATTRS{max_sectors}=="2048"
ATTRS{evt_lun_change_reported}=="0"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1/target1:0:0':
KERNELS=="target1:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0/host1':
KERNELS=="host1"
SUBSYSTEMS=="scsi"
DRIVERS==""

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2/2-1.2:1.0':
KERNELS=="2-1.2:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usb-storage"
ATTRS{authorized}=="1"
ATTRS{bInterfaceClass}=="08"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bNumEndpoints}=="02"
ATTRS{bInterfaceProtocol}=="50"
ATTRS{supports_autosuspend}=="1"
ATTRS{bInterfaceSubClass}=="06"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1/2-1.2':
KERNELS=="2-1.2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{devspec}==" (null)"
ATTRS{tx_lanes}=="1"
ATTRS{devpath}=="1.2"
ATTRS{idProduct}=="0567"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{maxchild}=="0"
ATTRS{bDeviceClass}=="00"
ATTRS{serial}=="20170331000C3"
ATTRS{bDeviceSubClass}=="00"
ATTRS{idVendor}=="152d"
ATTRS{busnum}=="2"
ATTRS{bmAttributes}=="c0"
ATTRS{removable}=="unknown"
ATTRS{ltm_capable}=="no"
ATTRS{bMaxPower}=="8mA"
ATTRS{bMaxPacketSize0}=="9"
ATTRS{bcdDevice}=="5203"
ATTRS{product}=="External USB 3.0"
ATTRS{bConfigurationValue}=="1"
ATTRS{version}==" 3.00"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{urbnum}=="12281"
ATTRS{authorized}=="1"
ATTRS{speed}=="5000"
ATTRS{manufacturer}=="JMicron"
ATTRS{devnum}=="5"
ATTRS{rx_lanes}=="1"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bNumConfigurations}=="1"
ATTRS{removable}=="unknown"
ATTRS{busnum}=="2"
ATTRS{configuration}==""
ATTRS{manufacturer}=="GenesysLogic"
ATTRS{maxchild}=="4"
ATTRS{devnum}=="2"
ATTRS{ltm_capable}=="no"
ATTRS{devpath}=="1"
ATTRS{idProduct}=="0626"
ATTRS{quirks}=="0x0"
ATTRS{rx_lanes}=="1"
ATTRS{bDeviceProtocol}=="03"
ATTRS{devspec}==" (null)"
ATTRS{tx_lanes}=="1"
ATTRS{bcdDevice}=="0654"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="9"
ATTRS{bNumInterfaces}==" 1"
ATTRS{authorized}=="1"
ATTRS{urbnum}=="457"
ATTRS{speed}=="5000"
ATTRS{idVendor}=="05e3"
ATTRS{version}==" 3.10"
ATTRS{bDeviceClass}=="09"
ATTRS{bMaxPower}=="0mA"
ATTRS{bDeviceSubClass}=="00"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{product}=="USB3.1 Hub"
ATTRS{bmAttributes}=="e0"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bNumConfigurations}=="1"
ATTRS{devpath}=="0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bDeviceClass}=="09"
ATTRS{devspec}==" (null)"
ATTRS{bDeviceProtocol}=="03"
ATTRS{bMaxPower}=="0mA"
ATTRS{bcdDevice}=="0419"
ATTRS{ltm_capable}=="yes"
ATTRS{version}==" 3.00"
ATTRS{rx_lanes}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{devnum}=="1"
ATTRS{authorized}=="1"
ATTRS{idProduct}=="0003"
ATTRS{bmAttributes}=="e0"
ATTRS{manufacturer}=="Linux 4.19.118-v7l+ xhci-hcd"
ATTRS{quirks}=="0x0"
ATTRS{authorized_default}=="1"
ATTRS{bConfigurationValue}=="1"
ATTRS{removable}=="unknown"
ATTRS{speed}=="5000"
ATTRS{urbnum}=="48"
ATTRS{serial}=="0000:01:00.0"
ATTRS{interface_authorized_default}=="1"
ATTRS{product}=="xHCI Host Controller"
ATTRS{configuration}==""
ATTRS{maxchild}=="4"
ATTRS{tx_lanes}=="1"
ATTRS{bMaxPacketSize0}=="9"
ATTRS{busnum}=="2"
ATTRS{idVendor}=="1d6b"
ATTRS{bDeviceSubClass}=="00"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0':
KERNELS=="0000:01:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{current_link_width}=="1"
ATTRS{local_cpus}=="f"
ATTRS{vendor}=="0x1106"
ATTRS{dma_mask_bits}=="64"
ATTRS{current_link_speed}=="5 GT/s"
ATTRS{max_link_speed}=="5 GT/s"
ATTRS{class}=="0x0c0330"
ATTRS{devspec}==""
ATTRS{msi_bus}=="1"
ATTRS{subsystem_vendor}=="0x1106"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{local_cpulist}=="0-3"
ATTRS{revision}=="0x01"
ATTRS{subsystem_device}=="0x3483"
ATTRS{driver_override}=="(null)"
ATTRS{irq}=="53"
ATTRS{enable}=="1"
ATTRS{ari_enabled}=="0"
ATTRS{max_link_width}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{device}=="0x3483"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0':
KERNELS=="0000:00:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="pcieport"
ATTRS{max_link_width}=="1"
ATTRS{class}=="0x060400"
ATTRS{ari_enabled}=="0"
ATTRS{devspec}==""
ATTRS{device}=="0x2711"
ATTRS{irq}=="52"
ATTRS{local_cpulist}=="0-3"
ATTRS{dma_mask_bits}=="32"
ATTRS{revision}=="0x10"
ATTRS{subsystem_vendor}=="0x0000"
ATTRS{aer_rootport_total_err_fatal}=="0"
ATTRS{broken_parity_status}=="0"
ATTRS{local_cpus}=="f"
ATTRS{secondary_bus_number}=="1"
ATTRS{msi_bus}=="1"
ATTRS{vendor}=="0x14e4"
ATTRS{max_link_speed}=="5 GT/s"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{current_link_width}=="1"
ATTRS{driver_override}=="(null)"
ATTRS{subsystem_device}=="0x0000"
ATTRS{aer_rootport_total_err_nonfatal}=="0"
ATTRS{enable}=="1"
ATTRS{aer_rootport_total_err_cor}=="0"
ATTRS{subordinate_bus_number}=="1"
ATTRS{current_link_speed}=="5 GT/s"

looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""

looking at parent device '//devices/platform/scb/fd500000.pcie':
KERNELS=="fd500000.pcie"
SUBSYSTEMS=="platform"
DRIVERS=="brcm-pcie"
ATTRS{driver_override}=="(null)"

looking at parent device '//devices/platform/scb':
KERNELS=="scb"
SUBSYSTEMS=="platform"
DRIVERS==""
ATTRS{driver_override}=="(null)"

looking at parent device '//devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""

@votdev votdev force-pushed the udev_rules_devbyid_db branch from 4ce0fa6 to c4836e4 Compare June 26, 2020 15:49
@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

@edaney Thx for your help. I've modified the UDEV rule for your enclosure the last time (i changed the SERIAL_ID content which results in a different devicefile path), see https://github.com/openmediavault/openmediavault/pull/746/files#diff-157fc15a796c208867b2ea9a55c34b1aR57. Could you please use the whole /etc/udev/rules.d/99-openmediavault-dev-disk-by-id.rules from this PR and test it finally on your system?

@edaney
Copy link

edaney commented Jun 26, 2020

I have some troubles with drives mounting and I don't know why ... At each reboot it's maybe different ...
Capture d’écran 2020-06-26 à 18 14 36

@edaney
Copy link

edaney commented Jun 26, 2020

New reboot
Capture d’écran 2020-06-26 à 18 16 29

@edaney
Copy link

edaney commented Jun 26, 2020

Not stable at all ...
Capture d’écran 2020-06-26 à 18 20 38

@edaney
Copy link

edaney commented Jun 26, 2020

New reboot and it's ok. I do nothing .. only reboot
Capture d’écran 2020-06-26 à 18 22 48

@edaney
Copy link

edaney commented Jun 26, 2020

Unable to create a union FS. Only 1 data disk D2
Capture d’écran 2020-06-26 à 18 24 05

@votdev
Copy link
Member Author

votdev commented Jun 26, 2020

I have some troubles with drives mounting and I don't know why ... At each reboot it's maybe different ...

Does this also happen with the rule we discussed in this thread, too?

@edaney
Copy link

edaney commented Jun 27, 2020

Yes. During the test, I checked only if the serial were corrects. After that, I checked the entire system and saw many errors.
I rollbacked to a fresh new system (with only one Orico), without any modifications and now it works again

@LanceMcCarthy
Copy link

LanceMcCarthy commented Jun 28, 2020

Do we need to still run the test commands after updating to get the new rules applied? Or am I jumping the gun and this isn't in the new update, in which case I'd like to help.

Here's my setup:

FIG1.
image

Error

However, I encountered errors during the --export part of the script:

Starting 'ata_id --export /dev/sdb'
Process 'ata_id --export /dev/sdb' failed with exit code 2.

Please see the full output here https://gist.github.com/LanceMcCarthy/4a6e66d4f8e2cdf1d1b4b301fd1d2cba

Second Attempt

I attempted it again on the other 3 drives, and then rebooted, but still see the placeholder serial numbers:

image

At least the drive labels are holding up, the file systems with calls out are from the JMicron array:

image

Next Steps

What else can I do to help? Please note that I can't try the "wipe and start over" suggestion mentioned in the originating forum thread. Any suggestions here should be consumer-ready.

@votdev
Copy link
Member Author

votdev commented Jun 29, 2020

Do we need to still run the test commands after updating to get the new rules applied? Or am I jumping the gun and this isn't in the new update, in which case I'd like to help.

Here's my setup:

FIG1.
image

Error

However, I encountered errors during the --export part of the script:

Starting 'ata_id --export /dev/sdb'
Process 'ata_id --export /dev/sdb' failed with exit code 2.

Please see the full output here gist.github.com/LanceMcCarthy/4a6e66d4f8e2cdf1d1b4b301fd1d2cba

Second Attempt

I attempted it again on the other 3 drives, and then rebooted, but still see the placeholder serial numbers:

image

At least the drive labels are holding up, the file systems with calls out are from the JMicron array:

image

Next Steps

According to your attached command output the file 99-openmediavault-dev-disk-by-id.rules is not applied, so my question is did you have installed it already? Note, this file is not included in any release till now, this is a draft PR only.

If you install and modify the UDEV rules file you need to tell UDEV that it must reload the rules via udevadm control --reload-rules.

However, I encountered errors during the --export part of the script:

Starting 'ata_id --export /dev/sdb'
Process 'ata_id --export /dev/sdb' failed with exit code 2.

This error is not caused by OMV because the rules we are discussing here are not loaded. Additionally the rules discussed here are not using the ata_id command.

What else can I do to help? Please note that I can't try the "wipe and start over" suggestion mentioned in the originating forum thread. Any suggestions here should be consumer-ready.

As told, this is a draft PR, so any discussion here requires some UDEV knowledge.

@LanceMcCarthy
Copy link

LanceMcCarthy commented Jun 29, 2020

Thanks for the prompt reply @votdev. Let me get right to your questions.

According to your attached command output the file 99-openmediavault-dev-disk-by-id.rules is not applied, so my question is did you have installed it already? Note, this file is not included in any release till now, this is a draft PR only.

If you install and modify the UDEV rules file you need to tell UDEV that it must reload the rules via udevadm control --reload-rules.

Although my gist only shows the output from the udevadm test /sys/block/sdb command, I did follow your explicit Test instructions:

// Worked successfully
# udevadm control --reload-rules

// This is what generated the output I shared in the gist
# udevadm test /sys/block/sdb

// This doesn't work because step 2 was not successful
# udevadm info -a -p $(udevadm info -q path -n /dev/sdb)

This error is not caused by OMV because the rules we are discussing here are not loaded. Additionally the rules discussed here are not using the ata_id command.

Something in the rules had to have run the ata_id command, I didn't do that explicitly. Looking at the output again, it appears right after reading the rules:

// ~70 rules read before this line
Reading rules file: /lib/udev/rules.d/99-systemd.rules
Rules contain 393216 bytes tokens (32768 * 12 bytes), 29341 bytes strings
20669 strings (166843 bytes), 17982 de-duplicated (140190 bytes), 2688 trie nodes used

// First appearance of any problem
Invalid inotify descriptor.
Starting 'ata_id --export /dev/sdb'
Process 'ata_id --export /dev/sdb' failed with exit code 2.

As told, this is a draft PR, so any discussion here requires some UDEV knowledge.

My apologies on my misunderstanding that these changes were in the latest update. I went to the Release Notes page and saw the blog post (https://www.openmediavault.org/?p=2734) next to it. I will wait for the PR merge and try again then. Thank you for working on this, it will be nice to have drive metadata again :)

Contributing

In the meantime, if there's something I can to help contribute my system's controller ID to the database, let me know. This is the device I am using https://www.amazon.com/gp/product/B07MQCDVJ2/

@votdev
Copy link
Member Author

votdev commented Jun 30, 2020

Taken from https://forum.openmediavault.org/index.php?thread/33217-omv-5-missing-sata-drives/&postID=244305#post244305

https://shop.allnetchina.cn/products/quad-sata-hat-case-for-raspberry-pi-4?_pos=4&_sid=8298cd20c&_ss=r

pi@piNAS:~ $ sudo udevadm info --query=all --name=/dev/sda
P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
N: sda
L: 0
S: disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:2:1.0-scsi-0:0:0:0
S: disk/by-id/usb-ACASIS_Go_To_Final_Lap_1234567890123-0:0
S: disk/by-label/SDA2Tpictures
S: disk/by-uuid/cc08740f-b9db-460f-a89e-9d5fb4b334bd
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-2/2-2:1.0/host0/target0:0:0/0:0:0:0/block/sda
E: DEVNAME=/dev/sda
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=0
E: SUBSYSTEM=block
E: USEC_INITIALIZED=11738857
E: ID_VENDOR=ACASIS
E: ID_VENDOR_ENC=ACASIS\x20\x20
E: ID_VENDOR_ID=1058
E: ID_MODEL=Go_To_Final_Lap
E: ID_MODEL_ENC=Go\x20To\x20Final\x20Lap
E: ID_MODEL_ID=0a10
E: ID_REVISION=8034
E: ID_SERIAL=ACASIS_Go_To_Final_Lap_1234567890123-0:0
E: ID_SERIAL_SHORT=1234567890123
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:080662:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=uas
E: ID_PATH=platform-fd500000.pcie-pci-0000:01:00.0-usb-0:2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=platform-fd500000_pcie-pci-0000_01_00_0-usb-0_2_1_0-scsi-0_0_0_0
E: ID_FS_LABEL=SDA2Tpictures
E: ID_FS_LABEL_ENC=SDA2Tpictures
E: ID_FS_UUID=cc08740f-b9db-460f-a89e-9d5fb4b334bd
E: ID_FS_UUID_ENC=cc08740f-b9db-460f-a89e-9d5fb4b334bd
E: ID_FS_VERSION=1.0
E: ID_FS_TYPE=ext4
E: ID_FS_USAGE=filesystem
E: DEVLINKS=/dev/disk/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:2:1.0-scsi-0:0:0:0 /dev/disk/by-id/usb-ACASIS_Go_To_Final_Lap_1234567890123-0:0 /dev/disk/by-label/SDA2Tpictures /dev/disk/by-uuid/cc08740f-b9db-460f-a89e-9d5fb4b334bd
E: TAGS=:systemd: 

@votdev votdev force-pushed the udev_rules_devbyid_db branch 2 times, most recently from 2ef08ee to 0be7b21 Compare July 1, 2020 07:19
@tooomm
Copy link

tooomm commented Jul 23, 2020

Maybe I can help too, let me know in case you need more information.

I'm using this USB-to-SATA adapter to run a Samsung SSD:
Sabrent EC-SS31 "USB 3.1 (Type-A) to SSD / 2.5-Inch SATA Hard Drive Adapter"
https://www.sabrent.com/product/EC-SS31/usb-3-1-type-ssd-2-5-inch-sata-hard-drive-adapter

Currently, this is shown with no rules applied yet:
sabrent

Output of "udevadm info --query=all --name=/dev/sda"
P: /devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0/block/sda
N: sda
L: 0
S: disk/by-path/pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0
S: disk/by-id/usb-SABRENT_SABRENT_000000123AD2-0:0
E: DEVPATH=/devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0/block/sda
E: DEVNAME=/dev/sda
E: DEVTYPE=disk
E: MAJOR=8
E: MINOR=0
E: SUBSYSTEM=block
E: USEC_INITIALIZED=3427017
E: ID_VENDOR=SABRENT
E: ID_VENDOR_ENC=SABRENT
E: ID_VENDOR_ID=2109
E: ID_MODEL=SABRENT
E: ID_MODEL_ENC=SABRENT\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_MODEL_ID=0715
E: ID_REVISION=2210
E: ID_SERIAL=SABRENT_SABRENT_000000123AD2-0:0
E: ID_SERIAL_SHORT=000000123AD2
E: ID_TYPE=disk
E: ID_INSTANCE=0:0
E: ID_BUS=usb
E: ID_USB_INTERFACES=:080650:080662:
E: ID_USB_INTERFACE_NUM=00
E: ID_USB_DRIVER=uas
E: ID_PATH=pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0
E: ID_PATH_TAG=pci-0000_00_15_0-usb-0_2_1_0-scsi-0_0_0_0
E: ID_PART_TABLE_UUID=24551388-5c28-4a0d-ae74-38861756e6eb
E: ID_PART_TABLE_TYPE=gpt
E: DEVLINKS=/dev/disk/by-path/pci-0000:00:15.0-usb-0:2:1.0-scsi-0:0:0:0 /dev/disk/by-id/usb-SABRENT_SABRENT_000000123AD2-0:0
E: TAGS=:systemd:
Output of "udevadm info -a -p $(udevadm info -q path -n /dev/sda)"
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:15.0/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0/block/sda':
    KERNEL=="sda"
    SUBSYSTEM=="block"
    DRIVER==""
    ATTR{stat}=="   10059     3895   827570     3550     1861     1400   284505     3780        0    12032     1012        0        0        0        0      784     1398"
    ATTR{inflight}=="       0        0"
    ATTR{discard_alignment}=="0"
    ATTR{size}=="250069680"
    ATTR{events_async}==""
    ATTR{alignment_offset}=="0"
    ATTR{ro}=="0"
    ATTR{removable}=="0"
    ATTR{events}==""
    ATTR{hidden}=="0"
    ATTR{ext_range}=="256"
    ATTR{events_poll_msecs}=="-1"
    ATTR{range}=="16"
    ATTR{capability}=="50"

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host4/target4:0:0/4:0:0:0':
    KERNELS=="4:0:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS=="sd"
    ATTRS{dh_state}=="detached"
    ATTRS{evt_lun_change_reported}=="0"
    ATTRS{vpd_pg80}==""
    ATTRS{inquiry}==""
    ATTRS{state}=="running"
    ATTRS{vpd_pg83}==""
    ATTRS{iorequest_cnt}=="0x31c0"
    ATTRS{ioerr_cnt}=="0x3c"
    ATTRS{iodone_cnt}=="0x31c0"
    ATTRS{queue_depth}=="30"
    ATTRS{evt_capacity_change_reported}=="0"
    ATTRS{model}=="SABRENT         "
    ATTRS{vendor}=="        "
    ATTRS{evt_inquiry_change_reported}=="0"
    ATTRS{scsi_level}=="7"
    ATTRS{type}=="0"
    ATTRS{evt_media_change}=="0"
    ATTRS{device_blocked}=="0"
    ATTRS{vpd_pg0}==""
    ATTRS{device_busy}=="0"
    ATTRS{blacklist}==""
    ATTRS{eh_timeout}=="10"
    ATTRS{queue_type}=="simple"
    ATTRS{wwid}=="naa.50025385a018ae25"
    ATTRS{rev}=="2210"
    ATTRS{iocounterbits}=="32"
    ATTRS{evt_soft_threshold_reached}=="0"
    ATTRS{timeout}=="30"
    ATTRS{evt_mode_parameter_change_reported}=="0"

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host4/target4:0:0':
    KERNELS=="target4:0:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0/host4':
    KERNELS=="host4"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2/2-2/2-2:1.0':
    KERNELS=="2-2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="uas"
    ATTRS{bInterfaceProtocol}=="62"
    ATTRS{bAlternateSetting}==" 1"
    ATTRS{supports_autosuspend}=="0"
    ATTRS{bInterfaceClass}=="08"
    ATTRS{authorized}=="1"
    ATTRS{bNumEndpoints}=="04"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceSubClass}=="06"

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2/2-2':
    KERNELS=="2-2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{version}==" 3.10"
    ATTRS{urbnum}=="37421"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{rx_lanes}=="1"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{idVendor}=="2109"
    ATTRS{devnum}=="2"
    ATTRS{tx_lanes}=="1"
    ATTRS{bcdDevice}=="a000"
    ATTRS{ltm_capable}=="no"
    ATTRS{bMaxPacketSize0}=="9"
    ATTRS{configuration}==""
    ATTRS{authorized}=="1"
    ATTRS{product}=="SABRENT"
    ATTRS{devpath}=="2"
    ATTRS{idProduct}=="0715"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="removable"
    ATTRS{maxchild}=="0"
    ATTRS{serial}=="000000123AD2"
    ATTRS{bDeviceClass}=="00"
    ATTRS{busnum}=="2"
    ATTRS{bMaxPower}=="896mA"
    ATTRS{bmAttributes}=="80"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{speed}=="5000"
    ATTRS{manufacturer}=="SABRENT"

  looking at parent device '//devices/pci0000:00/0000:00:15.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized_default}=="1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{tx_lanes}=="1"
    ATTRS{configuration}==""
    ATTRS{bMaxPacketSize0}=="9"
    ATTRS{idVendor}=="1d6b"
    ATTRS{devpath}=="0"
    ATTRS{manufacturer}=="Linux 5.6.0-0.bpo.2-amd64 xhci-hcd"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{product}=="xHCI Host Controller"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{idProduct}=="0003"
    ATTRS{bcdDevice}=="0506"
    ATTRS{maxchild}=="7"
    ATTRS{busnum}=="2"
    ATTRS{version}==" 3.00"
    ATTRS{authorized}=="1"
    ATTRS{serial}=="0000:00:15.0"
    ATTRS{ltm_capable}=="yes"
    ATTRS{bmAttributes}=="e0"
    ATTRS{rx_lanes}=="1"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{urbnum}=="46"
    ATTRS{speed}=="5000"
    ATTRS{bDeviceClass}=="09"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{devnum}=="1"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bDeviceProtocol}=="03"
    ATTRS{removable}=="unknown"
    ATTRS{quirks}=="0x0"

  looking at parent device '//devices/pci0000:00/0000:00:15.0':
    KERNELS=="0000:00:15.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
    ATTRS{revision}=="0x03"
    ATTRS{consistent_dma_mask_bits}=="64"
    ATTRS{local_cpus}=="f"
    ATTRS{class}=="0x0c0330"
    ATTRS{ari_enabled}=="0"
    ATTRS{vendor}=="0x8086"
    ATTRS{enable}=="1"
    ATTRS{subsystem_vendor}=="0x1849"
    ATTRS{numa_node}=="-1"
    ATTRS{msi_bus}=="1"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{driver_override}=="(null)"
    ATTRS{irq}=="126"
    ATTRS{broken_parity_status}=="0"
    ATTRS{dma_mask_bits}=="64"
    ATTRS{subsystem_device}=="0x31a8"
    ATTRS{d3cold_allowed}=="1"
    ATTRS{device}=="0x31a8"

  looking at parent device '//devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

…ATA/SATA bridge controllers that they do not pass on the serial number of the attached disks.

Signed-off-by: Volker Theile <votdev@gmx.de>
@votdev votdev force-pushed the udev_rules_devbyid_db branch from 0be7b21 to 3ffa2d8 Compare July 28, 2020 16:05
@votdev votdev marked this pull request as ready for review July 28, 2020 16:06
@votdev votdev merged commit 6e124e9 into openmediavault:master Jul 28, 2020
@votdev votdev deleted the udev_rules_devbyid_db branch July 28, 2020 16:06
@votdev
Copy link
Member Author

votdev commented Jul 28, 2020

If you want to see your hardware integrated into OMV, please open a new tracker issue.

@openmediavault openmediavault locked as resolved and limited conversation to collaborators Jul 28, 2020
votdev added a commit that referenced this pull request Sep 5, 2020
Fixes: #746
Superseds: #803

Signed-off-by: mmazerolle
Co-authored-by: Volker Theile <votdev@gmx.de>
votdev added a commit that referenced this pull request Sep 5, 2020
Fixes: #746
Superseds: #803

Signed-off-by: mmazerolle
Co-authored-by: Volker Theile <votdev@gmx.de>
(cherry picked from commit 3023d4e)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants