From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Surekha.PC" Date: Fri, 07 Nov 2003 04:49:55 +0000 Subject: RE: udev naming for scsi disk partitions Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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