Customizing persistent device names for an iSCSI disk
This document (3684654) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Desktop 10
Situation
Goal: to customize a persistent device name for an iSCSI disk, e.g. with customer device file ownership or permissions.
Resolution
With the default udev rules in place, an entry in /dev/disk/by-path/ and /dev/disk/by-id/ will have been created already. This entry can be found, either by searching that directory, or by running udevtest on the sysfs entry for the non-persistent device name, so if the disk is currently accessible as /dev/sdb, run
run_program: '/sbin/usb_id -x'
run_program: '/sbin/usb_id' returned with status 1
run_program: '/sbin/scsi_id -g -x -s /block/sdb -d /dev/.tmp-8-16'
run_program: '/sbin/scsi_id' (stdout) 'ID_VENDOR=IET'
run_program: '/sbin/scsi_id' (stdout) 'ID_MODEL=VIRTUAL-DISK'
run_program: '/sbin/scsi_id' (stdout) 'ID_REVISION=0'
run_program: '/sbin/scsi_id' (stdout)'ID_SERIAL=149455400000000000000000003000000410000000100d00f'
run_program: '/sbin/scsi_id' (stdout) 'ID_TYPE=disk'
run_program: '/sbin/scsi_id' (stdout) 'ID_BUS=scsi'
run_program: '/sbin/scsi_id' returned with status 0
udev_rules_get_name: add symlink'disk/by-id/scsi-149455400000000000000000003000000410000000100d00f'
run_program: '/sbin/path_id /block/sdb'
run_program: '/sbin/path_id' (stdout)'ID_PATH=ip-10.0.23.10:3260-iscsi-iqn.2007-05.com.suse:storage.disk2.sys1.test1'
run_program: '/sbin/path_id' returned with status 0
udev_rules_get_name: add symlink'disk/by-path/ip-10.0.23.10:3260-iscsi-iqn.2007-05.com.suse:storage.disk2.sys1.test1'
run_program: '/sbin/path_id /block/sdb'
run_program: '/sbin/path_id' (stdout)'ID_PATH=ip-10.0.23.10:3260-iscsi-iqn.2007-05.com.suse:storage.disk2.sys1.test1'
run_program: '/sbin/path_id' returned with status 0
udev_rules_get_name: add symlink'disk/by-path/ip-10.0.23.10:3260-iscsi-iqn.2007-05.com.suse:storage.disk2.sys1.test1'
run_program: '/sbin/vol_id --export /dev/.tmp-8-16'
run_program: '/sbin/vol_id' returned with status 4
run_program: '/sbin/edd_id --export /dev/.tmp-8-16'
run_program: '/sbin/edd_id' (stderr) 'no EDD signature '/dev/.tmp-8-16''
run_program: '/sbin/edd_id' returned with status 9
udev_rules_get_name: no node name set, will use kernel name 'sdb'
create_node: creating device node'/dev/sdb', major = '8', minor = '16', mode = '0660', uid = '0', gid = '100'
create_node: creating symlink'/dev/disk/by-id/scsi-149455400000000000000000003000000410000000100d00f' to '../../sdb'
create_node: creating symlink'/dev/disk/by-path/ip-10.0.23.10:3260-iscsi-iqn.2007-05.com.suse:storage.disk2.sys1.test1' to '../../sdb'
main: run:'socket:/org/freedesktop/hal/udev_event'
main: run:'socket:/org/kernel/udev/monitor'
Note how the udevtest output for a disk includes a number of characteristics through which the disk can be identified, for example a vendor name (ID_VENDOR) and a serial number (ID_SERIAL). These variables can be used to write a custom udev rule when the default link name, device permission, or device ownership are not suitable for your use.
E.g., by adding the following line to /etc/udev/rules.d/60-persistent-storage.rules:
When the udev rules are changed, you can immediately use udevtest to test them. To activate the changed settings, restart the iSCSI initiator setup by running
Please refer to the product documentation for more information about writing custom udev rules.
Additional Information
[1] To set up an iSCSI disk, refer to the product documentation (in particular, the chapterMass Storage over IP Networks—iSCSI) and other relevant documentation.
CODE9
The iSCSI and hotplug infrastructure in CODE9 products (SUSE Linux Enterprise Server 9, SUSE Linux Desktop 9, Open Enterprise Server 1 (Linux based)) was significantly different from that in CODE10.
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:3684654
- Creation Date: 15-Oct-2007
- Modified Date:05-Mar-2021
-
- SUSE Linux Enterprise Desktop
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com