From 1395daf8ee1f7a09acb880cf908e386c2b3b3827 Mon Sep 17 00:00:00 2001 From: Evan Felix Date: Wed, 19 May 2021 15:19:48 -0700 Subject: [PATCH 1/2] Setup for partitions by removing the partition numbers at the end of blkdev --- sasutils/cli/sas_sd_snic_alias.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sasutils/cli/sas_sd_snic_alias.py b/sasutils/cli/sas_sd_snic_alias.py index 5e22464..834e355 100755 --- a/sasutils/cli/sas_sd_snic_alias.py +++ b/sasutils/cli/sas_sd_snic_alias.py @@ -53,7 +53,7 @@ def sas_sd_snic_alias(blkdev): # Instantiate SASBlockDevice object from block device sysfs node # eg. /sys/block/sdx/device - blkdev = SASBlockDevice(sysfs.node('block').node(blkdev).node('device')) + blkdev = SASBlockDevice(sysfs.node('block').node(blkdev.rstrip('0123456789')).node('device')) sasdev = blkdev.end_device.sas_device if blkdev.array_device: From 7908cceea97adc3523ad58fe902e8ebee12b541b Mon Sep 17 00:00:00 2001 From: Evan Felix Date: Wed, 19 May 2021 15:22:27 -0700 Subject: [PATCH 2/2] modify udev example for partitions. --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0caf261..2477f6a 100644 --- a/README.rst +++ b/README.rst @@ -141,7 +141,9 @@ For example, add the following to your udev rules: .. code-block:: - KERNEL=="sd*", PROGRAM="/usr/bin/sas_sd_snic_alias %k", SYMLINK+="%c" + ENV{DEVTYPE}=="disk", KERNEL=="sd*", PROGRAM="/usr/bin/sas_sd_snic_alias %k", SYMLINK+="%c" + ENV{DEVTYPE}=="partition", KERNEL=="sd*", PROGRAM="/usr/bin/sas_sd_snic_alias %k", SYMLINK+="%cp%n" + This should generate udev aliases made of the device subenclosure nickname followed by the bay identifier. In the following case, *io1-jbod1-0* is the subenclosure nickname (here SIM 0 of JBOD #1).