<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Linux_match_drive_labels_to_drive_slots</id>
	<title>Linux match drive labels to drive slots - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?action=history&amp;feed=atom&amp;title=Linux_match_drive_labels_to_drive_slots"/>
	<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Linux_match_drive_labels_to_drive_slots&amp;action=history"/>
	<updated>2026-05-04T21:35:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Linux_match_drive_labels_to_drive_slots&amp;diff=3239&amp;oldid=prev</id>
		<title>Michael: Created page with &quot;&lt;syntaxhighlight&gt; ls -l /sys/block/sd{a,b,c,d} lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sda -&gt; ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda lrwxrwxrwx 1...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.define-technology.com/mediawiki-1.35.0/index.php?title=Linux_match_drive_labels_to_drive_slots&amp;diff=3239&amp;oldid=prev"/>
		<updated>2013-08-21T09:54:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;syntaxhighlight&amp;gt; ls -l /sys/block/sd{a,b,c,d} lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sda -&amp;gt; ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda lrwxrwxrwx 1...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
ls -l /sys/block/sd{a,b,c,d}&lt;br /&gt;
lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sda -&amp;gt; ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda&lt;br /&gt;
lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sdb -&amp;gt; ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb&lt;br /&gt;
lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sdc -&amp;gt; ../devices/pci0000:00/0000:00:1f.2/host4/target4:0:0/4:0:0:0/block/sdc&lt;br /&gt;
lrwxrwxrwx 1 root root 0 Apr  9 01:24 /sys/block/sdd -&amp;gt; ../devices/pci0000:00/0000:00:1f.2/host5/target5:0:0/5:0:0:0/block/sdd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On PCI bus 1, PCI device 00:1f.2 is my SATA controller, a Intel Corporation 82801HB (ICH8) 4 port SATA AHCI Controller (rev 02). It provides 4 hosts to each of which I have attached a disk.&lt;br /&gt;
&lt;br /&gt;
To get that ID, Instead of looking into the target structure, we&amp;#039;re looking into the scsi_host structure. It has a directory for the host and in it a file unique_id. That&amp;#039;s the ID appended to ata.&lt;br /&gt;
&lt;br /&gt;
So for each of the hosts above I can display the ID like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
dirk@topo ~ $ for host in 0 1 4 5; do echo -n host${host}:; cat /sys/devices/pci0000:00/0000:00:1f.2/host${host}/scsi_host/host${host}/unique_id; done&lt;br /&gt;
host0:1&lt;br /&gt;
host1:2&lt;br /&gt;
host4:5&lt;br /&gt;
host5:6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Michael</name></author>
	</entry>
</feed>