This is a multi-part message in MIME format.
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...
Also check out man smartctl, you can get a wealth of info from drives.
me@srv1:~$ sudo smartctl -i /dev/sda
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.2.0-31-generic] (local build) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Device Model: LK0200GEYMR
Serial Number: BTHC549304ZT200TGN
LU WWN Device Id: 5 5cd2e4 04c1623ca
Firmware Version: 4IWTHPG1
User Capacity: 200,049,647,616 bytes [200 GB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
TRIM Command: Available, deterministic, zeroed
Device is: Not in smartctl database [for details use: -P showall] ATA Version is: ACS-2 T13/2015-D revision 3
SATA Version is: SATA 2.6, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Apr 9 23:12:12 2025 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
A SAS disk in my pool....
me@srv1:~$ sudo smartctl -i /dev/sdb
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.2.0-31-generic] (local build) Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SEAGATE
Product: ST4000NM0023 Revision: GS15
Compliance: SPC-4
User Capacity: 4,000,787,030,016 bytes [4.00 TB]
Logical block size: 512 bytes
LU is fully provisioned
Rotation Rate: 7200 rpm
Form Factor: 3.5 inches
Logical Unit id: 0x5000c500842f46db
Serial number: Z1Z9KGRF
Device type: disk
Transport protocol: SAS (SPL-3)
Local Time is: Wed Apr 9 23:12:18 2025 CDT
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Temperature Warning: Disabled or Not Supported
Umm... just now thought of it, this server is still on Ubuntu, I hardly
ever look at it it and tend to forget it didn't get Debian at the same
time everything else around here did., however I just now checked,
smartctl will work with the same commands on Debian Bookworm.
If you don't have smartctl, install the smartmontools package.
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
--
Titus Newswanger
Curtiss WI
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">On 4/9/25 22:42, Petric Frank wrote:<br>
</div>
<blockquote type="cite" cite="mid:2853397.BEx9A2HvPv@main">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Hello,</p>
<br>
<p
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Am
Donnerstag, 10. April 2025, 00:13:10 CEST schrieb Andy Smith:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
Hi,</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
On Wed, Apr 09, 2025 at 05:46:32PM +0200, Petric Frank wrote:</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> In this case i have to manually create a mapping from
pci-id (of the</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> controller) together with the "ata-x" to the sata
connection number</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> printed on the motherboard. Based on the mapping udev rules
are to be</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> created to get device entries driven by the cable ids.</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> </p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
> Due i am not firm with udev rules - any hint on these ?</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
You have yet to explain why block device serial numbers</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
(/dev/disk/by-id/) and filesystem UUIDs (/dev/disk/by-uuid/) are
not</p>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>
sufficient for your use case.</p>
<br>
<p
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">Ok.
Lets take an example - a NAS using screwless hdd hotplug trays.</p>
<br>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">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
?</p>
<br>
<p
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">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.</p>
<br>
</blockquote>
<p>I had the same problem. Here is what worked for me:</p>
<p>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.</p>
<p>You can list the drives:</p>
<p>me@srv1:~$ smartctl --scan<br>
</p>
<p>/dev/sda -d scsi # /dev/sda, SCSI device<br>
/dev/sdb -d scsi # /dev/sdb, SCSI device<br>
/dev/sdc -d scsi # /dev/sdc, SCSI device<br>
/dev/sdd -d scsi # /dev/sdd, SCSI device<br>
/dev/sde -d scsi # /dev/sde, SCSI device<br>
/dev/sdf -d scsi # /dev/sdf, SCSI device<br>
/dev/sdg -d scsi # /dev/sdg, SCSI device<br>
/dev/sdh -d scsi # /dev/sdh, SCSI device<br>
/dev/sdi -d scsi # /dev/sdi, SCSI device<br>
/dev/sdj -d scsi # /dev/sdj, SCSI device<br>
/dev/sdk -d scsi # /dev/sdk, SCSI device<br>
/dev/sdl -d scsi # /dev/sdl, SCSI device<br>
/dev/sdm -d scsi # /dev/sdm, SCSI device</p>
<p><br>
</p>
<p>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...</p>
<p>Also check out man smartctl, you can get a wealth of info from
drives.</p>
<p><br>
</p>
<p>me@srv1:~$ sudo smartctl -i /dev/sda<br>
</p>
<p>smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.2.0-31-generic]
(local build)<br>
Copyright (C) 2002-20, Bruce Allen, Christian Franke,
<a class="moz-txt-link-abbreviated" href="
http://www.smartmontools.org">www.smartmontools.org</a><br>
<br>
=== START OF INFORMATION SECTION ===<br>
Device Model: LK0200GEYMR<br>
Serial Number: BTHC549304ZT200TGN<br>
LU WWN Device Id: 5 5cd2e4 04c1623ca<br>
Firmware Version: 4IWTHPG1<br>
User Capacity: 200,049,647,616 bytes [200 GB]<br>
Sector Sizes: 512 bytes logical, 4096 bytes physical<br>
Rotation Rate: Solid State Device<br>
Form Factor: 2.5 inches<br>
TRIM Command: Available, deterministic, zeroed<br>
Device is: Not in smartctl database [for details use: -P
showall]<br>
ATA Version is: ACS-2 T13/2015-D revision 3<br>
SATA Version is: SATA 2.6, 6.0 Gb/s (current: 6.0 Gb/s)<br>
Local Time is: Wed Apr 9 23:12:12 2025 CDT<br>
SMART support is: Available - device has SMART capability.<br>
SMART support is: Enabled<br>
</p>
<p><br>
</p>
<p>A SAS disk in my pool....<br>
</p>
<p>me@srv1:~$ sudo smartctl -i /dev/sdb<br>
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.2.0-31-generic]
(local build)<br>
Copyright (C) 2002-20, Bruce Allen, Christian Franke,
<a class="moz-txt-link-abbreviated" href="
http://www.smartmontools.org">www.smartmontools.org</a><br>
<br>
=== START OF INFORMATION SECTION ===<br>
Vendor: SEAGATE<br>
Product: ST4000NM0023<br>
Revision: GS15<br>
Compliance: SPC-4<br>
User Capacity: 4,000,787,030,016 bytes [4.00 TB]<br>
Logical block size: 512 bytes<br>
LU is fully provisioned<br>
Rotation Rate: 7200 rpm<br>
Form Factor: 3.5 inches<br>
Logical Unit id: 0x5000c500842f46db<br>
Serial number: Z1Z9KGRF<br>
Device type: disk<br>
Transport protocol: SAS (SPL-3)<br>
Local Time is: Wed Apr 9 23:12:18 2025 CDT<br>
SMART support is: Available - device has SMART capability.<br>
SMART support is: Enabled<br>
Temperature Warning: Disabled or Not Supported</p>
<p>Umm... just now thought of it, this server is still on Ubuntu, I
hardly ever look at it it and tend to forget it didn't get Debian
at the same time everything else around here did., however I just
now checked, smartctl will work with the same commands on Debian
Bookworm.</p>
<p>If you don't have smartctl, install the smartmontools package.<br>
</p>
<blockquote type="cite" cite="mid:2853397.BEx9A2HvPv@main">
<p
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">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.</p>
<br>
<p style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">regards</p>
<p
style="margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">
Petric</p>
<br>
</blockquote>
<pre class="moz-signature" cols="72">--
Titus Newswanger
Curtiss WI</pre>
</body>
</html>
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)