Device identification in case of same SN

  • It might not matter having two devices with the same S/N. The filesystem UUIDs will be unique.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Have two SATA to USB adapters (Orico 27UTS)
    Their SN and ID is the same,

    Two different devices with the same serial number ?( Curious


    Normally different disks have unique UUIDs. Did you have cloned the drives with a tool before?


    You should do a full wipe of both drives.

    OMV 3.0.99 (Gray style)
    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

  • Two different devices with the same serial number ?( Curious
    Normally different disks have unique UUIDs. Did you have cloned the drives with a tool before?


    You should do a full wipe of both drives.

    File systems are assigned unique UUIDs when they are initially formatted. This is not the OP's problem, and wiping the drives and reformatting will not change the serial numbers in the hardware. The identical serial numbers belong to the SATA to USB physical adapters, not the file systems on the plugged in and formatted disks.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Thanks for the clarification!

    You should do a full wipe of both drives.

    I was thinking rather of a complete wipe in the sense of which was called "low level format" in former times. Then the UUID should be removed too, I would assume.


    The identical serial numbers belong to the SATA to USB physical adapters, not the file systems on the plugged in and formatted disks.

    That would mean, that the drive and the USB-to-Sata-adapter is a bundle and shall not be changed later or mixed among each other, isn´t it?


    That would mean also, that the current problem of @andgi can only be solved with another adapter with a different serial number.


    Why are the serial numbers retrieved from the USB to SATA adapter and not directly from the drive? What is the technical reason?

    OMV 3.0.99 (Gray style)
    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

    Edited 3 times, last by cabrio_leo ().

  • Why are the serial numbers retrieved from the USB to SATA adapter and not directly from the drive? What is the technical reason?

    That It is about what I am interesting - is there a chance to apply setting for each device using other device IDs?


    OMV4 arm (raspberrypi)
    2x SATA to USB adapters Orico 27UTS - both have same S/N 201703310007F
    HDD#1 info from S.M.A.R.T: /dev/sda, Device model ST9500325AS, SN 5VE0BBG4, Firmare v 0002SPM1
    HDD#2 info from S.M.A.R.T: /dev/sdb, Device model ST9500420ASG, SN 5VJ05X5P, Firmare v0002SDM1

  • Hello!
    I solved this problem using udev rules to rewrite env variables with actual serial number value from hdparm.
    Cheap china devices always have unpredictable drawbacks in some special cases =(

    Bash: /usr/local/bin/orico-sn.sh
    #!/bin/sh
    SN=$(hdparm -I $1 | grep 'Serial\ Number' | awk -F ':' '{print $2}' | tr -d [:blank:])
    echo "ID_SERIAL_SHORT=${SN}"
    echo "ID_SERIAL=${ID_VENDOR}_${ID_MODEL}_${SN}-${ID_INSTANCE}"
    Bash: /usr/lib/udev/rules.d/99-orico.rules
    ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="0080", ATTRS{idProduct}=="a001", IMPORT{program}="/usr/local/bin/orico-sn.sh $devnode", SYMLINK="disk/by-path/$env{ID_PATH}", SYMLINK+="disk/by-id/usb-$env{ID_SERIAL}"
  • Hi,


    I'm having the exact same issue as you. Two drives, both with the same enclosure registering with the same serial number causing only one to be picked up at a time.


    I'm not super familiar with linux. I've created the scripts above, did chmod +x on the .sh, and created the udev and rules.d folder and placed the 99-orico.rules in that folder...but I'm not sure how to ensure the script gets ran. Can you give me some more detailed information on what to do next? I think I just don't have enough knowledge of linux to even know where to go from here.


    Thank you!!

  • I just wanted to update that I did find that I needed to update the idVendor and idProduct variables, but it still didn't work.


    I used the below page to make the updates

    https://linuxconfig.org/tutori…basic-udev-rules-in-linux


    I did the following:


    1. Use udevadm info \dev\sda to identify my device info
    2. "use udevadm info -a \dev\sda | grep idVendor" to get the vendor id. several results were returned, I compared them to the output above to see that it tied out to the vendor variable.
    3. "use udevadm info -a \dev/sda | grep idProduct" to get the product id. Several results were returned, the first result tied out to my model ID, I used that.
    4. Place the two values above into the rules script for idProduct and idVendor
    5. Reboot the pi.


    After doing this I'm still seeing the same serial number for the device.

  • Update 2: I fixed it finally.


    The path given above for the rules.d appears to be incorrect. It needs to be /lib/dev/rules.d, not /usr/lib/dev/rules.d. Once I moved the rules file there it was picked up and ran.

  • Update 2: I fixed it finally.


    The path given above for the rules.d appears to be incorrect. It needs to be /lib/dev/rules.d, not /usr/lib/dev/rules.d. Once I moved the rules file there it was picked up and ran.

    I am having the same problem with Sabrent HD enclosures. I believe I found the correct idVendor=152d and idProduct=1561 but still cannot get it to work. Can you share your files with the idVendor and idProduct filled in?

  • I don´t know if this commands are available in OMV for ARM CPUs but I used those commands to find out the VendorID and ProductID:

    lsusb

    In my case this was returned:

    Bus 002 Device 003: ID 174c:55aa ASMedia Technology Inc. ASMedia 2105 SATA bridge

                            |    |

                           VID  PID

    The first four bytes is IDVendor, the second one is IDProduct.


    Otherwise you can use dmesg | grep usb to get more information about USB devices.

    OMV 3.0.99 (Gray style)
    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

  • Thanks everyone.


    I'm pretty inexperienced but using the above I was able to get this working for both of my Sabrent Drives.

    Code: Bash: /usr/lib/udev/rules.d/99-orico.rules
    ACTION=="add", SUBSYSTEM=="block", ATTRS{idVendor}=="152d", ATTRS{idProduct}=="1561", IMPORT{program}="/usr/local/bin/orico-sn.sh $devnode", SYMLINK="disk/by-path/$env{ID_PATH}", SYMLINK+="disk/by-id/usb-$env{ID_SERIAL}"
  • Have two SATA to USB adapters (Orico 27UTS)
    Their SN and ID is the same, bc of that OVM apply setting to both HDD when editing on of that


    Is the way to apply unique ID for correct identification or need to change one of adapters with other brand?

    andgi Could you please run the command udevadm info --query=all --name=/dev/sdX for one of your disks and post the output here.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!