1

I'm hoping someone can answer my question because I'm in a pinch right now.

I already have a program on Python that validates the SSDs firmware info vs a Database info. So, if everything is ok, the program inserts info on another Database where all the validated SSDs are.

However that's not the problem here.

The method I used to make that program work visually is to get string from commands to make images match with the physical location of the drive, so the operator can know which drive is good or bad.

Say, the command:

readlink /sys/block/sd?

it's giving me this output:

../devices/pci0000:00/0000:00:1f.2/ata6/host5/target5:0:0/5:0:0:0/block/sda

From the output I take as reference the position of the ATA port. In this case it would be: ata6

This method is hardcoded so if the cable setup is mixed up it won't display the images properly.

Now, I have for my purposes an SSD Test Board, which is an 8 SATA port capable PCB that gives power to the drives so the can be read by a computer.

Initially, and even now the setup is limited to 5 drives per validation, the 6th port is reserved for the OS SSD.

What I have to do now is to get the mentioned pane to work with 8 USB-SATA bridges so can be used on all PCs but the prior command isn't helping me as before.

I run it and it gives me the following output:

../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/host94/target94:0:0/94:0:0:0/block/sdb
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.3/2-1.3.3:1.0/host100/target100:0:0/100:0:0:0/block/sdc

I cannot take usb2 as reference because it's the same for all and the host(m) where m it's a number, increases every time an SSD is plugged or unplugged.

What I would like to ask is:

  1. How can I unmount and mount the USB-SATA bridges so they could reset the host number to 0 or 1?
  2. Is there a better way to dinamically get the physical position match with the virtual position, say sd(n) matches with host(m)?
  3. What commands do I have to run in terminal to get a more precise approach to a physical-logical match?

EDIT: For reference, when I first connect the SATA-USB Bridges they start as mounted (even if there are no SSDs connected though) so the prior command gives me the following output:

../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.1/2-1.3.1:1.0/host103/target103:0:0/103:0:0:0/block/sdb
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.2/2-1.3.2:1.0/host104/target104:0:0/104:0:0:0/block/sdc
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.3/2-1.3.3:1.0/host105/target105:0:0/105:0:0:0/block/sdd
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.3/2-1.3.4/2-1.3.4:1.0/host106/target106:0:0/106:0:0:0/block/sde
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4.1/2-1.4.1:1.0/host107/target107:0:0/107:0:0:0/block/sdf
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4.2/2-1.4.2:1.0/host108/target108:0:0/108:0:0:0/block/sdg
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4.3/2-1.4.3:1.0/host109/target109:0:0/109:0:0:0/block/sdh
../devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4.4/2-1.4.4:1.0/host110/target110:0:0/110:0:0:0/block/sdi

They actually look like they are ordered but if I unplug and plug them again it would sometimes get the wrong order.

xedge
  • 51

0 Answers0