Hello,
i want to map the sata hardware connections to fixed device names. This be done even the hdd on the cable is changed.
So - when i connect a hdd to sata port 4 i want to get (for example) /dev/sdd created even /dev/sda to /dev/sdc (respective no hdd connected to sata 1 ... sata 3 port).
Any idea on how to configure this.
Hello,
i want to map the sata hardware connections to fixed device names. This be done even the hdd on the cable is changed.
So - when i connect a hdd to sata port 4 i want to get (for example)
/dev/sdd created even /dev/sda to /dev/sdc (respective no hdd
connected to sata 1 ... sata 3 port).
On Wed, Apr 09, 2025 at 11:32:31AM +0200, Petric Frank wrote:
Hello,
i want to map the sata hardware connections to fixed device names. This be done even the hdd on the cable is changed.
So - when i connect a hdd to sata port 4 i want to get (for example) /dev/sdd created even /dev/sda to /dev/sdc (respective no hdd connected
to sata 1 ... sata 3 port).
Any idea on how to configure this.
Does /dev/disk/by-path fulfil your needs?
Hello,
Am Mittwoch, 9. April 2025, 11:35:27 CEST schrieb tomas@tuxteam.de:
On Wed, Apr 09, 2025 at 11:32:31AM +0200, Petric Frank wrote:
Hello,
i want to map the sata hardware connections to fixed device names. This be
done even the hdd on the cable is changed.
So - when i connect a hdd to sata port 4 i want to get (for example) /dev/sdd created even /dev/sda to /dev/sdc (respective no hdd connected to sata 1 ... sata 3 port).
Any idea on how to configure this.
Does /dev/disk/by-path fulfil your needs?
Not exactly. The names are like pci-0000-0b:00:0-ata-4 and pci-0000-0d:00:0-ata-1.
Can i simply match *ata-<number> and take the "<number>" as connector id on the
mainboard ?
Am Mittwoch, 9. April 2025, 11:35:27 CEST schrieb tomas@tuxteam.de:
Does /dev/disk/by-path fulfil your needs?
Not exactly. The names are like pci-0000-0b:00:0-ata-4 and >pci-0000-0d:00:0-ata-1.
Can i simply match *ata-<number> and take the "<number>" as connector id on the
mainboard ?
On Wed, Apr 09, 2025 at 01:41:21PM +0200, Petric Frank wrote:
Am Mittwoch, 9. April 2025, 11:35:27 CEST schrieb tomas@tuxteam.de:
Does /dev/disk/by-path fulfil your needs?
Not exactly. The names are like pci-0000-0b:00:0-ata-4 and >>pci-0000-0d:00:0-ata-1.
Yes, that's necessary to account for multiple sata controllers.
Can i simply match *ata-<number> and take the "<number>" as connector id on the
mainboard ?
No. The number is the sata device number on a particular controller.
They can overlap between controllers. E.g.:
pci-0000:2b:00.0-ata-1
pci-0000:2b:00.0-ata-2
pci-0000:2b:00.0-ata-3
pci-0000:2b:00.0-ata-4
pci-0000:2c:00.0-ata-1
pci-0000:2c:00.0-ata-6
That's from a server with 6 sata connectors and 2 m.2 sata slots. The
6 devices listed are all on sata connectors, and you can see that on
the second controller one is device 1 and one is device 6, with the 2
unused connectors and the m.2 slots using some combination of
2,3,4,5--they are clearly not numbered sequentially. On the
motherboard they're labeled SATA_[01234567] and M2_[12]. There's no >particular relationship between how things are laid out on the
motherboard and what they're connected to internally.
As someone else suggested, it's typically more useful to stick with >filesystem UUIDs and such rather than trying to map things physically.
On Wed, Apr 09, 2025 at 01:41:21PM +0200, Petric Frank wrote:
Am Mittwoch, 9. April 2025, 11:35:27 CEST schrieb tomas@tuxteam.de:
Does /dev/disk/by-path fulfil your needs?
Not exactly. The names are like pci-0000-0b:00:0-ata-4 and >pci-0000-0d:00:0-ata-1.
Yes, that's necessary to account for multiple sata controllers.
Can i simply match *ata-<number> and take the "<number>" as connector id on >the mainboard ?
No. The number is the sata device number on a particular controller.
They can overlap between controllers. E.g.:
pci-0000:2b:00.0-ata-1
pci-0000:2b:00.0-ata-2
pci-0000:2b:00.0-ata-3
pci-0000:2b:00.0-ata-4
pci-0000:2c:00.0-ata-1
pci-0000:2c:00.0-ata-6
That's from a server with 6 sata connectors and 2 m.2 sata slots. The 6 devices listed are all on sata connectors, and you can see that on the
second controller one is device 1 and one is device 6, with the 2 unused connectors and the m.2 slots using some combination of 2,3,4,5--they are clearly not numbered sequentially. On the motherboard they're labeled SATA_[01234567] and M2_[12]. There's no particular relationship between
how things are laid out on the motherboard and what they're connected to internally.
In this case i have to manually create a mapping from pci-id (of the controller) together with the "ata-x" to the sata connection number
printed on the motherboard. Based on the mapping udev rules are to be
created to get device entries driven by the cable ids.
Due i am not firm with udev rules - any hint on these ?
i want to map the sata hardware connections to fixed device names. This be done even the hdd on the cable is changed.
So - when i connect a hdd to sata port 4 i want to get (for example) /dev/sdd created even /dev/sda to /dev/sdc (respective no hdd connected to sata 1 ... sata 3 port).
Any idea on how to configure this.
Hi,
On Wed, Apr 09, 2025 at 05:46:32PM +0200, Petric Frank wrote:
In this case i have to manually create a mapping from pci-id (of the controller) together with the "ata-x" to the sata connection number
printed on the motherboard. Based on the mapping udev rules are to be created to get device entries driven by the cable ids.
Due i am not firm with udev rules - any hint on these ?
You have yet to explain why block device serial numbers
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/) are not sufficient for your use case.
Hello,
Am Donnerstag, 10. April 2025, 00:13:10 CEST schrieb Andy Smith:
Hi,
On Wed, Apr 09, 2025 at 05:46:32PM +0200, Petric Frank wrote:
In this case i have to manually create a mapping from pci-id (of the
controller) together with the "ata-x" to the sata connection number
printed on the motherboard. Based on the mapping udev rules are to be
created to get device entries driven by the cable ids.
Due i am not firm with udev rules - any hint on these ?
You have yet to explain why block device serial numbers
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/) are not
sufficient for your use case.
Ok. Lets take an example - a NAS using screwless hdd hotplug trays.
Each hdd has a slot to be accessed external (bay 1...6). If a hdd
fails how do you know in which bay you find the hdd which failed ?
Due the dynamic mapping of sata cable to device name is not fixed you
can't. You have (for example) to evaluate the other drives serial
number and match them with the ones on the hdds itself. The one which
is missing will be the one to be replaced.
But if you have a fixed relationship from /dev/sd[x] to the connector
on the mainboard (and as result on the hdd tray) this will be an easy
task.
regards
Petric
On 4/9/25 22:42, Petric Frank wrote:
Hello,
Am Donnerstag, 10. April 2025, 00:13:10 CEST schrieb Andy Smith:
Hi,
On Wed, Apr 09, 2025 at 05:46:32PM +0200, Petric Frank wrote:
In this case i have to manually create a mapping from pci-id (of the
controller) together with the "ata-x" to the sata connection number
printed on the motherboard. Based on the mapping udev rules are to be
created to get device entries driven by the cable ids.
Due i am not firm with udev rules - any hint on these ?
You have yet to explain why block device serial numbers
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/) are not
sufficient for your use case.
Ok. Lets take an example - a NAS using screwless hdd hotplug trays.
Each hdd has a slot to be accessed external (bay 1...6). If a hdd
fails how do you know in which bay you find the hdd which failed ?
Due the dynamic mapping of sata cable to device name is not fixed you can't. You have (for example) to evaluate the other drives serial
number and match them with the ones on the hdds itself. The one which
is missing will be the one to be replaced.
I had the same problem. Here is what worked for me:
First, during scheduled down-time, I pulled each HDD one at a time and
noted its serial number and position (slot number) on a chart. Now I can
use smartctl to view the relation of /dev/sdx - to - serial number.
Another thing I sometimes do is label the front of the HDD caddy with
HDD serial number, if it is possible to do so without blocking airflow
with the labels.
You can list the drives:
me@srv1:~$ smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device
/dev/sdf -d scsi # /dev/sdf, SCSI device
/dev/sdg -d scsi # /dev/sdg, SCSI device
/dev/sdh -d scsi # /dev/sdh, SCSI device
/dev/sdi -d scsi # /dev/sdi, SCSI device
/dev/sdj -d scsi # /dev/sdj, SCSI device
/dev/sdk -d scsi # /dev/sdk, SCSI device
/dev/sdl -d scsi # /dev/sdl, SCSI device
/dev/sdm -d scsi # /dev/sdm, SCSI device
If your RAID monitoring notices disc /dev/sda is broken, run the
following command to view among other things, serial number of sda. Then
I can confidently pull the HDD I previously marked with the same s.n. In
my case sda is currently this server's only boot disc...
Hello,
Am Donnerstag, 10. April 2025, 06:47:13 CEST schrieb Titus Newswanger:
On 4/9/25 22:42, Petric Frank wrote:
Hello,
Am Donnerstag, 10. April 2025, 00:13:10 CEST schrieb Andy Smith:
Hi,
On Wed, Apr 09, 2025 at 05:46:32PM +0200, Petric Frank wrote:
In this case i have to manually create a mapping from pci-id
(of the
controller) together with the "ata-x" to the sata connection
number
printed on the motherboard. Based on the mapping udev rules
are to be
created to get device entries driven by the cable ids.
Due i am not firm with udev rules - any hint on these ?
You have yet to explain why block device serial numbers
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/)
are not
sufficient for your use case.
Ok. Lets take an example - a NAS using screwless hdd hotplug
trays.
Each hdd has a slot to be accessed external (bay 1...6). If a hdd
fails how do you know in which bay you find the hdd which failed ?
Due the dynamic mapping of sata cable to device name is not fixed
you can't. You have (for example) to evaluate the other drives
serial number and match them with the ones on the hdds itself.
The one which is missing will be the one to be replaced.
I had the same problem. Here is what worked for me:
First, during scheduled down-time, I pulled each HDD one at a time
and noted its serial number and position (slot number) on a chart.
Now I can use smartctl to view the relation of /dev/sdx - to -
serial number. Another thing I sometimes do is label the front of
the HDD caddy with HDD serial number, if it is possible to do so
without blocking airflow with the labels.
You can list the drives:
me@srv1:~$ smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/sdb -d scsi # /dev/sdb, SCSI device
/dev/sdc -d scsi # /dev/sdc, SCSI device
/dev/sdd -d scsi # /dev/sdd, SCSI device
/dev/sde -d scsi # /dev/sde, SCSI device
/dev/sdf -d scsi # /dev/sdf, SCSI device
/dev/sdg -d scsi # /dev/sdg, SCSI device
/dev/sdh -d scsi # /dev/sdh, SCSI device
/dev/sdi -d scsi # /dev/sdi, SCSI device
/dev/sdj -d scsi # /dev/sdj, SCSI device
/dev/sdk -d scsi # /dev/sdk, SCSI device
/dev/sdl -d scsi # /dev/sdl, SCSI device
/dev/sdm -d scsi # /dev/sdm, SCSI device
If your RAID monitoring notices disc /dev/sda is broken, run the
following command to view among other things, serial number of sda.
Then I can confidently pull the HDD I previously marked with the
same s.n. In my case sda is currently this server's only boot
disc...
Similar thing i did up to now - document the serial number to map the
drive.
But too often i lost this docs and had to fall back to the manual
steps.
So if the sata connection directly maps to the device name i never
have to keep this info again. Also this would be easier for technical
"noobs" to identify and replace the drive.
regards
Petric
Serious disk enclosures have lights that can be turned on to indicate
which disk has failed.
debian-user@howorth.org.uk writes:
Serious disk enclosures have lights that can be turned on to indicate
which disk has failed.
Yes. I take it the actual question is, is there a DIY version of that?
This sort of thing is why I mostly do just mirroring.
Am Donnerstag, 10. April 2025, 00:13:10 CEST schrieb Andy Smith:
You have yet to explain why block device serial numbers
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/) are not sufficient for your use case.
Ok. Lets take an example - a NAS using screwless hdd hotplug trays.
Each hdd has a slot to be accessed external (bay 1...6). If a hdd
fails how do you know in which bay you find the hdd which failed ?
If you have a fixed relationship from /dev/sd[x] to the connector on
the mainboard (and as result on the hdd tray) this will be an easy
task.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 162:21:15 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,501 |