-
Notifications
You must be signed in to change notification settings - Fork 24
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
hctl mapping for SATA drives only #14
Comments
Not sure if this is the same as #9 . I am wondering that
If the map is correct and does not change, then we may change the
|
By the way, can you provide the outputs of |
I think it might be a good idea to instruct users to record serial number before installment, and configure the serial numbers in the script. Many models labels have their serial number printed on the label, it take only several minutes to record them and write into scripts, and solve the mapping problem once for ever. |
Yes, the order of disk to the (LED) number is correct.
As soon as I remove the USB DVD drive, the numbering is different.
I think that all connected devices on the SOC are numbered first and then all external chipsets (ASMedia...).
In my model, all sata disks are connected to an ASMedia controller:
That's a good idea - at least it would allow every user to define the appropriate configuration for all models in all variants. |
I just noticed that UGOS use the ata number to map the disk, and it seems to work better then hctl: # ATA Mapping
ls -ahl /sys/block | awk '{
if (match($0, /ata[0-9]+/)) {
ata = substr($0, RSTART, RLENGTH);
if (match($0, /[^\/]+$/)) {
basename = substr($0, RSTART, RLENGTH);
}
print basename, ata;
}
}'
# HCTL Mapping
lsblk -S -o name,hctl -x hctl @dieneuser Maybe this would work. Do you want to test it? (see this branch for the new script)
Good idea. It is definitely a better solution. I think we can add a config file about that. |
These are the results from your new script:
But something is wrong with the regex, the basename is not found. Here is the output from the ls command:
|
Sorry, forgot to remove the trailing slash: ls -ahl /sys/block | sed 's/\/$//' | awk '{
if (match($0, /ata[0-9]+/)) {
ata = substr($0, RSTART, RLENGTH);
if (match($0, /[^\/]+$/)) {
basename = substr($0, RSTART, RLENGTH);
}
print basename, ata;
}
}' |
Now the mapping looks very good. the mapping as one liner:
|
I see. I will merge the new PR and set ATA as the default mapping if it also works in other models. |
1. Add the config file /etc/ugreen-leds.conf for environment variables used in ugreen-diskiomon (see scripts/ugreen-leds.conf) 2. Make the blinking of netdev activities, colors of different disk states / NIC link speeds configurable 3. Add the check of zpool health 4. Add the check of gateway connectivity and the link speed of network device 5. Split the systemd service to ugreen-diskiomon.service and ugreen-netdevmon@<device name>.service 6. HCTL mapping will fail in some cases (hctl mapping for SATA drives only #14), UGOS uses ATA number to map disks to slots. I changed the default mapping to ATA, which can be shown by the following scripts:
I have a DXP4800 and am currently working on the mapping.
The script uses lsblk in line 98 for the mapping - unfortunately it does not take into account whether other drives are connected.
So I have also connected a USB drive for Unraid and a DVD ROM, which of course also receive hctl numbers starting at 0:0:0:0.
The result is then
My suggestion would be to extend the lsblk command in line 98 and really only extract the existing SATA drives:
The text was updated successfully, but these errors were encountered: