linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Surekha.PC" <surekhap@cisco.com>
To: linux-hotplug@vger.kernel.org
Subject: RE: udev naming for scsi disk partitions
Date: Fri, 07 Nov 2003 04:49:55 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-106818000515676@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-106792310406865@msgid-missing>


Hi Greg,

In sysfs the scsi device path looks as shown below.

The sysfs's "block" device path lists the block devices detected on the
system.
Here "sdc" is the iSCSI device and "sdc1" and "sdc2" are listed as 2
partitions on the iSCSI disk.

The device field below is pointing to the iSCSI host/bus/tgt/lun path.

#ls -l /sys/block/sdc
total 0
-r--r--r--    1 root     root         4096 Nov  7 08:25 dev
lrwxrwxrwx    1 root     root           35 Nov  7 08:25 device ->
../../devices/legacy/host6/6:0:69:0
drwxr-xr-x    3 root     root            0 Nov  7 08:25 queue
-r--r--r--    1 root     root         4096 Nov  7 08:25 range
drwxr-xr-x    2 root     root            0 Nov  7 08:25 sdc1
drwxr-xr-x    2 root     root            0 Nov  7 08:25 sdc2
-r--r--r--    1 root     root         4096 Nov  7 08:25 size
-r--r--r--    1 root     root         4096 Nov  7 08:25 stat

#ls -l /sys/block/sdc/sdc1:
total 0
-r--r--r--    1 root     root         4096 Nov  7 08:25 dev
-r--r--r--    1 root     root         4096 Nov  7 08:25 size
-r--r--r--    1 root     root         4096 Nov  7 08:25 start
-r--r--r--    1 root     root         4096 Nov  7 08:25 stat

#ls -l /sys/block/sdc/sdc2:
total 0
-r--r--r--    1 root     root         4096 Nov  7 08:25 dev
-r--r--r--    1 root     root         4096 Nov  7 08:25 size
-r--r--r--    1 root     root         4096 Nov  7 08:25 start
-r--r--r--    1 root     root         4096 Nov  7 08:25 stat

# ls -l /sys/devices/legacy/host6/6\:0\:69\:0/
total 0
-r--r--r--    1 root     root         4096 Nov  7 08:25 access_count
lrwxrwxrwx    1 root     root           21 Nov  7 08:25 block ->
../../../../block/sdc
--w-------    1 root     root         4096 Nov  7 08:25 delete
-rw-r--r--    1 root     root         4096 Nov  7 08:25 detach_state
-r--r--r--    1 root     root         4096 Nov  6 15:27 device_blocked
-r--r--r--    1 root     root         4096 Nov  6 15:27 model
-rw-r--r--    1 root     root         4096 Nov  6 15:27 online
drwxr-xr-x    2 root     root            0 Nov  6 15:27 power
-r--r--r--    1 root     root         4096 Nov  6 15:27 queue_depth
--w-------    1 root     root         4096 Nov  6 15:27 rescan
-r--r--r--    1 root     root         4096 Nov  6 15:27 rev
-r--r--r--    1 root     root         4096 Nov  6 15:27 scsi_level
-r--r--r--    1 root     root         4096 Nov  6 15:27 type
-r--r--r--    1 root     root         4096 Nov  6 15:27 vendor

Since sysfs is able to recognise the number of partitions on the iSCSI
device, and creates unique device name as "sdc1" and "sdc2" along with
its attributes, udev should be able to apply the persistent naming
convention on the partitions also.

I think the sysfs file "/sys/block/sdc/sdc1" should be ideal to use for
setting the LABEL rule as you have mentioned.

Thanks,
surekha



-----Original Message-----
From: Greg KH [mailto:greg@kroah.com] 
Sent: Friday, November 07, 2003 5:23 AM
To: Surekha.PC
Cc: linux-hotplug-devel@lists.sourceforge.net
Subject: Re: udev naming for scsi disk partitions


On Tue, Nov 04, 2003 at 10:45:55AM +0530, Surekha.PC wrote:
> 
> Hi all,
> 
>   My system is connected to iSCSI disks. With udev-005 pkg I am able 
> to see the device entries created in "/udev/sdc". I want to give a 
> unique and persistent naming scheme for iSCSI device.
> 
> I have specified the following entry in "/etc/udev/udev.config" for 
> naming the iSCSI device.
> 
> E.g:-
> NUMBER, BUS="scsi" ID="6:0:69:0" NAME="c6b0t69l0"

What does the whole path for the scsi device look like in sysfs?  I
think there's probably a bug in the NUMBER matchup that gets this wrong
right now (I only tested it with PCI devices, and need to get the
automated test framework up and running soon...)

> The iSCSI disk "sdc" has 2 partitions "sdc1" and "sdc2".
> 
> I am able to generate the name for "sdc" whereas "sdc1" and "sdc2" 
> entries remain as is.
> 
> My partitions should have the name like "c6b0t69l0s1" and 
> "c6b0t69l0s2".
> 
> How do I achieve this with udev?

This should work, but is there a better way to uniquely identify this
device in sysfs?  Any specific sysfs file for this device that would
make a LABEL rule an easier thing to do?

thanks,

greg k-h



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
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

  parent reply	other threads:[~2003-11-07  4:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04  5:27 udev naming for scsi disk partitions Surekha.PC
2003-11-04  7:13 ` Surekha.PC
2003-11-06 23:53 ` Greg KH
2003-11-07  4:49 ` Surekha.PC [this message]
2003-11-07  6:07 ` Greg KH
2003-11-07  6:35 ` Surekha.PC
2003-11-07 19:32 ` Greg KH
2003-11-10  9:59 ` Surekha.PC
2003-11-10 10:00 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-106818000515676@msgid-missing \
    --to=surekhap@cisco.com \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).