* Statically nameing a SCSI device
@ 2007-08-11 21:25 gerald.hotplug
2007-08-12 3:49 ` Greg KH
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: gerald.hotplug @ 2007-08-11 21:25 UTC (permalink / raw)
To: linux-hotplug
I know this was discussed recently here:
<http://sourceforge.net/mailarchive/forum.php?thread_nameÓd656c40708012110o29e111b4w707ee03afb0e71f2%40mail.gmail.com&forum_name=linux-hotplug-devel>
I wasn't on the list at the time so I'm starting a new thread.
I have a rather unique situation.
I have a machine with 20 drive bays. 16 SCSI-SCA and 4 SATA. The
architecture does not know about the SATA controller until the Linux
kernel takes over so they cannot be used as boot devices. They need to
stay at the "end of the device tree".
I would like to give them persistent names of /dev/sdw, /dev/sdx,
/dev/sdy, and /dev/sdz.
But, all of the programs that udev uses to get unique identifying
information about drives to use in naming rules seem to require that you
know the kernel name first. Why does nothing in udev seem to allow one to
use standard SCSI host,channel,device,lun nomenclature to query a device?
The 4 SATA bays will have drives in all of them long before I fill up 16
SCA bays. But, every time I add and SCA drive to the primary controller
all of the SATA drives have their kernel name shifted up one letter so I
can't use the kernel name to query the device for its serial number.
These drives are for data storage only but they will probably be formatted
using LVM so I can create one big mount point without having a symlink
farm growing so I need to keep stable /dev/sd'x' names for LVM to keep
track of them.
Anyone have any idea of what I can use to create a uniquely identifying
rule for each of these drives so that I can assign static /dev/sd'x' NAMES
to them at boot time even when the kernel name has changed?
Or, can anyone point me to documentation of a clear way to do this in
kernel space. Eg., to have the kernel always assign the same kernel name
to a device in a certain range (sdw, sdx, sdy, sdz) based on it's SCSI
loaction ID (4,0,0,0 -- 4,0,1,0 -- etc.)?
Thanks,
Gerald
P.S.
Wait a sec, I'm re-reading my message before posting and getting an idea
but I have too little udev experience to implement it.
Can I write a set of rules in a 20-local.rules file that will run
scsi_id -g -s /block/sd'x'
for every value of 'x' looking for
"SATA WDC WD2500YS-01 WD-WCANY1955037"
And then assigning NAME="sdw"
??
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
@ 2007-08-12 3:49 ` Greg KH
2007-08-12 5:50 ` Andrey Borzenkov
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Greg KH @ 2007-08-12 3:49 UTC (permalink / raw)
To: linux-hotplug
On Sat, Aug 11, 2007 at 04:25:34PM -0500, gerald.hotplug@sysmatrix.net wrote:
> I know this was discussed recently here:
> <http://sourceforge.net/mailarchive/forum.php?thread_nameÓd656c40708012110o29e111b4w707ee03afb0e71f2%40mail.gmail.com&forum_name=linux-hotplug-devel>
>
> I wasn't on the list at the time so I'm starting a new thread.
>
> I have a rather unique situation.
>
> I have a machine with 20 drive bays. 16 SCSI-SCA and 4 SATA. The
> architecture does not know about the SATA controller until the Linux
> kernel takes over so they cannot be used as boot devices. They need to
> stay at the "end of the device tree".
>
> I would like to give them persistent names of /dev/sdw, /dev/sdx,
> /dev/sdy, and /dev/sdz.
>
> But, all of the programs that udev uses to get unique identifying
> information about drives to use in naming rules seem to require that you
> know the kernel name first.
That's because the kernel always names the device first, and than passes
that information off to udev.
> Why does nothing in udev seem to allow one to use standard SCSI
> host,channel,device,lun nomenclature to query a device?
You can do that just fine if you want to, just look at the device chain
for the block device, the information is in there.
> The 4 SATA bays will have drives in all of them long before I fill up 16
> SCA bays. But, every time I add and SCA drive to the primary controller
> all of the SATA drives have their kernel name shifted up one letter so I
> can't use the kernel name to query the device for its serial number.
>
> These drives are for data storage only but they will probably be formatted
> using LVM so I can create one big mount point without having a symlink
> farm growing so I need to keep stable /dev/sd'x' names for LVM to keep
> track of them.
>
> Anyone have any idea of what I can use to create a uniquely identifying
> rule for each of these drives so that I can assign static /dev/sd'x' NAMES
> to them at boot time even when the kernel name has changed?
Just look at what gets created for you in /dev/disk/ The information
there should help you.
> Or, can anyone point me to documentation of a clear way to do this in
> kernel space. Eg., to have the kernel always assign the same kernel name
> to a device in a certain range (sdw, sdx, sdy, sdz) based on it's SCSI
> loaction ID (4,0,0,0 -- 4,0,1,0 -- etc.)?
>
> Thanks,
>
> Gerald
>
> P.S.
>
> Wait a sec, I'm re-reading my message before posting and getting an idea
> but I have too little udev experience to implement it.
>
> Can I write a set of rules in a 20-local.rules file that will run
>
> scsi_id -g -s /block/sd'x'
>
> for every value of 'x' looking for
>
> "SATA WDC WD2500YS-01 WD-WCANY1955037"
>
> And then assigning NAME="sdw"
Yes, you can do just that.
good luck,
greg k-h
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
2007-08-12 3:49 ` Greg KH
@ 2007-08-12 5:50 ` Andrey Borzenkov
2007-08-12 8:16 ` gerald.hotplug
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Andrey Borzenkov @ 2007-08-12 5:50 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 332 bytes --]
On Sunday 12 August 2007, gerald.hotplug@sysmatrix.net wrote:
> These drives are for data storage only but they will probably be formatted
> using LVM so I can create one big mount point without having a symlink
> farm growing so I need to keep stable /dev/sd'x' names for LVM to keep
> track of them.
>
what makes you believe so?
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
2007-08-12 3:49 ` Greg KH
2007-08-12 5:50 ` Andrey Borzenkov
@ 2007-08-12 8:16 ` gerald.hotplug
2007-08-12 12:24 ` Kay Sievers
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: gerald.hotplug @ 2007-08-12 8:16 UTC (permalink / raw)
To: linux-hotplug
> On Sunday 12 August 2007, gerald.hotplug@sysmatrix.net wrote:
>> These drives are for data storage only but they will probably be
>> formatted
>> using LVM so I can create one big mount point without having a symlink
>> farm growing so I need to keep stable /dev/sd'x' names for LVM to keep
>> track of them.
>>
>
> what makes you believe so?
Nothing at the moment. In setting up this "play system" (personal server
for mail, web, and multimedia) I suddenly find myself reading man pages
and tutorials for a lot more subsystems than my brain apparently has the
capacity to handle at one time.
Ive mixed up what requires which more than once in the last few days.
Now, that being said, it will be a lot easier for *ME* if I always know
exactly where the SATA drives are located in the plain-old /dev tree and
if I can call them /dev/sdw or /dev/sdz rather than
/dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037
I added this to my local.rules and udevtest says it works great for the
first drive I already have installed:
KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
KERNEL="sd*[!0-9]",
ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw"
As I add the other 3 drives I just need to add lines to identify their
serial numbers and set them at sdx, sdy, and sdz.
Thanks,
Gerald
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (2 preceding siblings ...)
2007-08-12 8:16 ` gerald.hotplug
@ 2007-08-12 12:24 ` Kay Sievers
2007-08-12 12:43 ` Andrey Borzenkov
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-08-12 12:24 UTC (permalink / raw)
To: linux-hotplug
On 8/12/07, gerald.hotplug@sysmatrix.net <gerald.hotplug@sysmatrix.net> wrote:
> > On Sunday 12 August 2007, gerald.hotplug@sysmatrix.net wrote:
> >> These drives are for data storage only but they will probably be
> >> formatted
> >> using LVM so I can create one big mount point without having a symlink
> >> farm growing so I need to keep stable /dev/sd'x' names for LVM to keep
> >> track of them.
> >
> > what makes you believe so?
>
> Nothing at the moment. In setting up this "play system" (personal server
> for mail, web, and multimedia) I suddenly find myself reading man pages
> and tutorials for a lot more subsystems than my brain apparently has the
> capacity to handle at one time.
>
> Ive mixed up what requires which more than once in the last few days.
>
> Now, that being said, it will be a lot easier for *ME* if I always know
> exactly where the SATA drives are located in the plain-old /dev tree and
> if I can call them /dev/sdw or /dev/sdz rather than
> /dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037
>
> I added this to my local.rules and udevtest says it works great for the
> first drive I already have installed:
>
> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
> KERNEL="sd*[!0-9]",
> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw"
>
> As I add the other 3 drives I just need to add lines to identify their
> serial numbers and set them at sdx, sdy, and sdz.
If you change the default name of the nodes, you will never find the
disk a possible error log from the kernel belongs to. You should only
use symlinks.
/dev/disk/* has probably all you need already without any custom rule.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (3 preceding siblings ...)
2007-08-12 12:24 ` Kay Sievers
@ 2007-08-12 12:43 ` Andrey Borzenkov
2007-08-12 13:00 ` Kay Sievers
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Andrey Borzenkov @ 2007-08-12 12:43 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1.1: Type: text/plain, Size: 280 bytes --]
On Sunday 12 August 2007, Kay Sievers wrote:
>
> If you change the default name of the nodes, you will never find the
> disk a possible error log from the kernel belongs to. You should only
> use symlinks.
>
So why providing this "shoot yourself in the foot" in the first place?
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 315 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 226 bytes --]
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (4 preceding siblings ...)
2007-08-12 12:43 ` Andrey Borzenkov
@ 2007-08-12 13:00 ` Kay Sievers
2007-08-12 15:46 ` Gerald V. Livingston II
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-08-12 13:00 UTC (permalink / raw)
To: linux-hotplug
On 8/12/07, Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> On Sunday 12 August 2007, Kay Sievers wrote:
> >
> > If you change the default name of the nodes, you will never find the
> > disk a possible error log from the kernel belongs to. You should only
> > use symlinks.
> >
>
> So why providing this "shoot yourself in the foot" in the first place?
Because you need to move stuff to subdirectories like "input/" "snd/",
want to rename network interfaces, have things like libusb device
nodes /dev/bus/usb/, and other stuff where it is appropriate to do
that.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (5 preceding siblings ...)
2007-08-12 13:00 ` Kay Sievers
@ 2007-08-12 15:46 ` Gerald V. Livingston II
2007-08-12 16:29 ` Kay Sievers
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Gerald V. Livingston II @ 2007-08-12 15:46 UTC (permalink / raw)
To: linux-hotplug
On Sun, August 12, 2007 7:24, Kay Sievers said:
> On 8/12/07, gerald.hotplug@sysmatrix.net <gerald.hotplug@sysmatrix.net>
> wrote:
>>
>> Now, that being said, it will be a lot easier for *ME* if I always know
>> exactly where the SATA drives are located in the plain-old /dev tree and
>> if I can call them /dev/sdw or /dev/sdz rather than
>> /dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037
>>
>> I added this to my local.rules and udevtest says it works great for the
>> first drive I already have installed:
>>
>> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
>> KERNEL="sd*[!0-9]",
>> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw"
>>
>> As I add the other 3 drives I just need to add lines to identify their
>> serial numbers and set them at sdx, sdy, and sdz.
>
> If you change the default name of the nodes, you will never find the
> disk a possible error log from the kernel belongs to. You should only
> use symlinks.
>
> /dev/disk/* has probably all you need already without any custom rule.
>
> Kay
So, better would be:
KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
KERNEL="sd*[!0-9]",
ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sdw"
The disks will all be the same model so the info in /dev/disk will be the
same except for a number or two. Too easy to mix them up if I'm looking
for something specific while moving hardware around.
Gerald
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (6 preceding siblings ...)
2007-08-12 15:46 ` Gerald V. Livingston II
@ 2007-08-12 16:29 ` Kay Sievers
2007-08-12 16:58 ` Gerald V. Livingston II
2007-08-15 22:16 ` Gerald V. Livingston II
9 siblings, 0 replies; 11+ messages in thread
From: Kay Sievers @ 2007-08-12 16:29 UTC (permalink / raw)
To: linux-hotplug
On 8/12/07, Gerald V. Livingston II <gerald.hotplug@sysmatrix.net> wrote:
> On Sun, August 12, 2007 7:24, Kay Sievers said:
>
> > On 8/12/07, gerald.hotplug@sysmatrix.net <gerald.hotplug@sysmatrix.net>
> > wrote:
> >>
> >> Now, that being said, it will be a lot easier for *ME* if I always know
> >> exactly where the SATA drives are located in the plain-old /dev tree and
> >> if I can call them /dev/sdw or /dev/sdz rather than
> >> /dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037
> >>
> >> I added this to my local.rules and udevtest says it works great for the
> >> first drive I already have installed:
> >>
> >> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
> >> KERNEL="sd*[!0-9]",
> >> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw"
> >>
> >> As I add the other 3 drives I just need to add lines to identify their
> >> serial numbers and set them at sdx, sdy, and sdz.
> >
> > If you change the default name of the nodes, you will never find the
> > disk a possible error log from the kernel belongs to. You should only
> > use symlinks.
> >
> > /dev/disk/* has probably all you need already without any custom rule.
>
> So, better would be:
>
> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
> KERNEL="sd*[!0-9]",
> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sdw"
Yes, symlinks are better in almost all cases. Still, make sure that
nobody will ever connect a whole bunch of USB sticks. :) And hope the
SCSI error handler will hang and repeated connect/disconnect of a
single block device will produce a real "sdw" device in the kernel.
It's a kind of a dangerous game to allocate names from the kernel
namespace.
> The disks will all be the same model so the info in /dev/disk will be the
> same except for a number or two. Too easy to mix them up if I'm looking
> for something specific while moving hardware around.
If you use rules later than 60-*.rules, ENV{ID_SERIAL} is already set
by udev's persistent rules, and there is no need to run scsi_id again.
Kay
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (7 preceding siblings ...)
2007-08-12 16:29 ` Kay Sievers
@ 2007-08-12 16:58 ` Gerald V. Livingston II
2007-08-15 22:16 ` Gerald V. Livingston II
9 siblings, 0 replies; 11+ messages in thread
From: Gerald V. Livingston II @ 2007-08-12 16:58 UTC (permalink / raw)
To: linux-hotplug
On Sun, August 12, 2007 11:29, Kay Sievers said:
> On 8/12/07, Gerald V. Livingston II <gerald.hotplug@sysmatrix.net> wrote:
>> On Sun, August 12, 2007 7:24, Kay Sievers said:
>>
>> > On 8/12/07, gerald.hotplug@sysmatrix.net
>> <gerald.hotplug@sysmatrix.net>
>> > wrote:
>> >>
>> >> Now, that being said, it will be a lot easier for *ME* if I always
>> know
>> >> exactly where the SATA drives are located in the plain-old /dev tree
>> and
>> >> if I can call them /dev/sdw or /dev/sdz rather than
>> >> /dev/disk/by-id/ata-WDC_WD2500YS-01S-WD-WCANY1955037
>> >>
>> >> I added this to my local.rules and udevtest says it works great for
>> the
>> >> first drive I already have installed:
>> >>
>> >> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
>> >> KERNEL="sd*[!0-9]",
>> >> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", NAME="sdw"
>> >>
>> >> As I add the other 3 drives I just need to add lines to identify
>> their
>> >> serial numbers and set them at sdx, sdy, and sdz.
>> >
>> > If you change the default name of the nodes, you will never find the
>> > disk a possible error log from the kernel belongs to. You should only
>> > use symlinks.
>> >
>> > /dev/disk/* has probably all you need already without any custom rule.
>>
>> So, better would be:
>>
>> KERNEL="sd*[!0-9]", IMPORT="/sbin/scsi_id -g -x $tempnode"
>> KERNEL="sd*[!0-9]",
>> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sdw"
>
> Yes, symlinks are better in almost all cases. Still, make sure that
> nobody will ever connect a whole bunch of USB sticks. :) And hope the
> SCSI error handler will hang and repeated connect/disconnect of a
> single block device will produce a real "sdw" device in the kernel.
> It's a kind of a dangerous game to allocate names from the kernel
> namespace.
>
>> The disks will all be the same model so the info in /dev/disk will be
>> the
>> same except for a number or two. Too easy to mix them up if I'm looking
>> for something specific while moving hardware around.
>
> If you use rules later than 60-*.rules, ENV{ID_SERIAL} is already set
> by udev's persistent rules, and there is no need to run scsi_id again.
>
> Kay
On my Debian system install persistent.rules runs at "z20" so I've moved
my SATA rules file to z22_my.sata.rules.
Since nothing on the SYSTEM (only my brain) seems to require /dev/sd"x" to
be static I've also changed the persistent symlinks to be more descriptive
for me. The z22_my.sata.rules file is currently a single line:
KERNEL="sd*[!0-9]",
ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sata1"
This is a Sun E450 Server class machine with hardware plugged into it that
Sun never intended when they built it in the '90s. I haven't decided if I
want to try getting a USB controller installed. ;-)
Gerald
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Statically nameing a SCSI device
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
` (8 preceding siblings ...)
2007-08-12 16:58 ` Gerald V. Livingston II
@ 2007-08-15 22:16 ` Gerald V. Livingston II
9 siblings, 0 replies; 11+ messages in thread
From: Gerald V. Livingston II @ 2007-08-15 22:16 UTC (permalink / raw)
To: linux-hotplug
On Sun, August 12, 2007 11:58, Gerald V. Livingston II said:
> On Sun, August 12, 2007 11:29, Kay Sievers said:
>> On 8/12/07, Gerald V. Livingston II <gerald.hotplug@sysmatrix.net>
>> wrote:
>>> The disks will all be the same model so the info in /dev/disk will be
>>> the
>>> same except for a number or two. Too easy to mix them up if I'm looking
>>> for something specific while moving hardware around.
>>
>> If you use rules later than 60-*.rules, ENV{ID_SERIAL} is already set
>> by udev's persistent rules, and there is no need to run scsi_id again.
>>
>> Kay
>
> On my Debian system install persistent.rules runs at "z20" so I've moved
> my SATA rules file to z22_my.sata.rules.
>
> Since nothing on the SYSTEM (only my brain) seems to require /dev/sd"x" to
> be static I've also changed the persistent symlinks to be more descriptive
> for me. The z22_my.sata.rules file is currently a single line:
>
> KERNEL="sd*[!0-9]",
> ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sata1"
>
This works great. Wherever the SATA drive end up in the chain it gets
linked as /dev/sata1.
But, my brain is missing something else. I am doing LVM on these disks but
not "whole device" LVM, so, I also need symlinks for /dev/sdd1 etc to be
created as /dev/sata1_1, /dev/sata1_2, etc.
Never mind, I got it. But I'll post this for the archives anyway:
My SATA rules file (which runs AFTER the stock "persistent.rules" file) is
now two line for the single drive I have installed. Other lines will be
added for each drive I install later to link them to sata2 etc.
KERNEL="sd*[!0-9]",
ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037", SYMLINK+="sata1"
KERNEL="sd*[0-9]",
ENV{ID_SERIAL}="SATA_WDC_WD2500YS-01_WD-WCANY1955037",
SYMLINK+="sata1_%n"
Gerald
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-08-15 22:16 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-11 21:25 Statically nameing a SCSI device gerald.hotplug
2007-08-12 3:49 ` Greg KH
2007-08-12 5:50 ` Andrey Borzenkov
2007-08-12 8:16 ` gerald.hotplug
2007-08-12 12:24 ` Kay Sievers
2007-08-12 12:43 ` Andrey Borzenkov
2007-08-12 13:00 ` Kay Sievers
2007-08-12 15:46 ` Gerald V. Livingston II
2007-08-12 16:29 ` Kay Sievers
2007-08-12 16:58 ` Gerald V. Livingston II
2007-08-15 22:16 ` Gerald V. Livingston II
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).