-
Notifications
You must be signed in to change notification settings - Fork 493
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
Conversation
9f34e92
to
81c0d8f
Compare
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}" |
There was a problem hiding this comment.
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?
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" |
9832b38
to
4ce0fa6
Compare
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. |
Thanks for helping. I've added the If you need help please post the output of |
Hi, I'm a little confused about what to do.
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 |
You can confirm that ALL devices attached to this device bay have the serial number 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.
After that
where |
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 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 |
Looks like one step forward :-) Could you try the UDEV rule below instead of the previous one, maybe this will create the correct devicefile.
An alternative:
|
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 I have 2 Orico and now in OMV, now I can see 10 different drives with 10 serials (see screenshot). |
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. |
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. |
@edaney Could you please also run the command |
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 |
Following your request Udevadm info starts with the device specified by the devpath and then 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': 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': 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': 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': 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': 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': looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-1': looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2': looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0': looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0': looking at parent device '//devices/platform/scb/fd500000.pcie/pci0000:00': looking at parent device '//devices/platform/scb/fd500000.pcie': looking at parent device '//devices/platform/scb': looking at parent device '//devices/platform': |
4ce0fa6
to
c4836e4
Compare
@edaney Thx for your help. I've modified the UDEV rule for your enclosure the last time (i changed the |
Does this also happen with the rule we discussed in this thread, too? |
Yes. During the test, I checked only if the serial were corrects. After that, I checked the entire system and saw many errors. |
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: ErrorHowever, I encountered errors during the
Please see the full output here https://gist.github.com/LanceMcCarthy/4a6e66d4f8e2cdf1d1b4b301fd1d2cba Second AttemptI attempted it again on the other 3 drives, and then rebooted, but still see the placeholder serial numbers: At least the drive labels are holding up, the file systems with calls out are from the JMicron array: Next StepsWhat 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. |
According to your attached command output the file If you install and modify the UDEV rules file you need to tell UDEV that it must reload the rules via
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
As told, this is a draft PR, so any discussion here requires some UDEV knowledge. |
Thanks for the prompt reply @votdev. Let me get right to your questions.
Although my gist only shows the output from the
Something in the rules had to have run the
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 :) ContributingIn 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/ |
|
2ef08ee
to
0be7b21
Compare
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: Currently, this is shown with no rules applied yet: Output of "udevadm info --query=all --name=/dev/sda"
Output of "udevadm info -a -p $(udevadm info -q path -n /dev/sda)"
|
…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>
0be7b21
to
3ffa2d8
Compare
If you want to see your hardware integrated into OMV, please open a new tracker issue. |
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.
The fields
ID_SERIAL
should look likeUSB-<SERIAL>-0:0
or similar andID_SERIAL_SHORT
should contain the serial number only. The most important part isDEVLINKS
, 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