Skip to content

Commit fc6597d

Browse files
author
Bart Sjerps
committed
asm update
1 parent b870162 commit fc6597d

File tree

1 file changed

+11
-34
lines changed

1 file changed

+11
-34
lines changed

src/bin/asm

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# more details.
2020
# ---------------------------------------------------------------------------
2121
# Revision history:
22-
# 2018-08-20 : Embedded manpage
22+
# 2018-08-20 : Embedded manpage, removed DSSD support
2323
# 2018-04-06 : Add $PATH to support remote and scripted execution
2424
# 2017-12-14 : Bugfix for import function
2525
# 2017-10-04 : Bugfix for SCSI id's with whitespace (Linux TGTD)
@@ -416,7 +416,7 @@ createconf() {
416416
# label type identifier
417417
# where
418418
# label: diskstring/volume name (default diskstring is oracleasm and can be omitted)
419-
# type: one of scsi, part, part=scsi disk partition, ppath, dssd, scini,
419+
# type: one of scsi, part, part=scsi disk partition, ppath, scini,
420420
# mapper (scsi=entire SCSI disk, part=scsi disk partition, mapper=linux disk mapper device)
421421
# label: scsi_id, scsi_id:partition, mapper_name, vol_id etc
422422
#
@@ -429,8 +429,7 @@ createconf() {
429429
# vol2 part 36000c298afa5c31b47fe76cbd1750937:1 # partition 1 of entire SCSI disk
430430
# vol3 mapper mpathb # /dev/mapper/mpathb (multipath device)
431431
# vol4 ppath emcpowerx # /dev/emcpowerx (EMC Powerpath device)
432-
# vol5 dssd cca2a87a-6826-4424-a7dd-540cb3a0260b-000000000000003b # dssd volume
433-
# vol6 scini 6e85d4fe3b125edc-6f99ffeb00000000 # ScaleIO volume
432+
# vol5 scini 6e85d4fe3b125edc-6f99ffeb00000000 # ScaleIO volume
434433
# iorate/test1 mapper iops-vol1 # LV vol1 on VG iops, will be mapped as /dev/iorate/test1
435434
# -----------------------------------------------
436435
EOF
@@ -490,11 +489,6 @@ createdisk() {
490489
awk -v m="$dmname" '$3==m {exit 1;}' /etc/asmtab || rc=10 die "Mapper device $dmname already exists in asmtab!"
491490
echo "$label mapper $dmname" >> /etc/asmtab
492491
;;
493-
dssd) # device is EMC DSSD disk
494-
oid=$(cat /sys/block/${device##*/}/dssd_mp/oid)
495-
awk -v m="$oid" '$3==m {exit 1;}' /etc/asmtab || rc=10 die "DSSD device with ID $oid already exists in asmtab!"
496-
echo "$label dssd $oid" >> /etc/asmtab
497-
;;
498492
scini) # device is EMC ScaleIO disk
499493
oid=$(/bin/emc/scaleio/drv_cfg --query_block_device_id --block_device ${device})
500494
awk -v m="$oid" '$3==m {exit 1;}' /etc/asmtab || rc=10 die "ScaleIO device with ID $oid already exists in asmtab!"
@@ -546,21 +540,8 @@ scandisks() {
546540
# with each run of the "asm" command.
547541
# Direct edit the file /etc/asmtab instead.
548542
EOF
549-
550-
# Insert DSSD header if DSSD config lines detected
551-
# Note: old method (not working?)
552-
# SUBSYSTEM=="block" KERNEL=="dssd????*" IMPORT{program}="dssd_id %k %S"
553-
# SUBSYSTEM=="block" KERNEL=="dssd????*" IMPORT{program}="blkid -o udev -p $tempnode"
554-
# Also not working correctly:
555-
# SUBSYSTEM=="block" KERNEL=="dssd????*" IMPORT{program}="dssd_id -e \$tempnode"
556-
awk '$2=="dssd" { f=1 ; } END { exit !f ;}' /etc/asmtab && cat <<- EOF >> $WORKDIR/99-asm.rules
557-
558-
# Early detect DSSD OID - before 999-dssd-asm.rules is processed
559-
SUBSYSTEM=="block" KERNEL=="dssd????*" IMPORT{program}="dssd_id %k %S"
560-
SUBSYSTEM=="block" KERNEL=="dssd????*" IMPORT{program}="blkid -o udev -p \$tempnode"
561-
EOF
562543
cat <<- EOF >> $WORKDIR/99-asm.rules
563-
544+
564545
SUBSYSTEM!="block", GOTO="asmudev_end"
565546
566547
# Don't touch the bootdisk (/dev/${bootdisk:-notfound})
@@ -605,7 +586,6 @@ scandisks() {
605586
pppart) LINE=${LINE}', ENV{DEVTYPE}=="partition", KERNEL=="'${ID%:*}${ID#*:}'"' ;;
606587
scsi) LINE=${LINE}', ENV{DEVTYPE}=="disk", KERNEL=="sd*", ENV{ID_SERIAL}=="'$ID'"' ;;
607588
ppath) LINE=${LINE}', ENV{DEVTYPE}=="disk", KERNEL=="'$ID'"' ;;
608-
dssd) LINE=${LINE}', ENV{DSSD_OID}=="'$ID'"' ;;
609589
scini) LINE=${LINE}', KERNEL=="scini*", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="'$ID'" ' ;;
610590
*) echo "unknown asmudev volume type $TYPE" ; exit 10 ;;
611591
esac
@@ -634,15 +614,13 @@ devinfo() {
634614
devname=$(readlink -f /sys/dev/block/${major}\:${minor} | awk -F/ '{print $NF}')
635615
case $devtype in
636616
sd) (($minor%16==0)) && dtype=scsi || dtype=partition ;;
637-
dssd) dtype=dssd ;;
638617
device-mapper) dtype=mapper ;;
639618
*) dtype=unknown ;;
640619
esac
641620
case $dtype in
642621
scsi) name=$(lsscsi -k 2>/dev/null | awk -v D=/dev/$devname '$NF==D {print $1}') ;;
643622
partition) name="part$((min%16))" ;;
644623
mapper) name=$(dmsetup info -j "$major" -m "$minor" -c --noheadings -o name) ;;
645-
dssd) name=$(cat /sys/dev/block/${major}\:${minor}/dssd_mp/oid 2>/dev/null | awk -F- '{print $NF}') ;;
646624
*) name="-" ;;
647625
esac
648626
blocks=$(cat /sys/dev/block/${major}\:${minor}/size)
@@ -694,7 +672,7 @@ listdisks() {
694672
major=$(cat /sys/block/$d/dev | cut -d: -f1)
695673
dt=$(devtrans $major)
696674
case $dt in
697-
sd|dssd|scini|power2) diskinfo $d ;;
675+
sd|scini|power2) diskinfo $d ;;
698676
esac
699677
done
700678
}
@@ -770,12 +748,11 @@ renamedisk() {
770748
#============================================================================
771749
# Main section - parsing options etc
772750
# ---------------------------------------------------------------------------
773-
while getopts ":hndt" OPT; do
751+
while getopts ":ndt" OPT; do
774752
case "$OPT" in
775-
n) NOHEAD=Y ;;
776-
d) DEBUG=Y ;;
777-
t) SEPARATOR=T ; NOHEAD=Y ;;
778-
\?|h) usage >&2 ; exit 0 ;;
753+
n) NOHEAD=Y ;;
754+
d) DEBUG=Y ;;
755+
t) SEPARATOR=T ; NOHEAD=Y ;;
779756
esac
780757
done
781758
shift $(expr $OPTIND - 1)
@@ -786,6 +763,7 @@ createconf
786763
checkuuid
787764

788765
case $ACTION in
766+
none) listdisks ;;
789767
rescan) rescan ;;
790768
createdisk) createdisk "$@" ;;
791769
deletedisk) deletedisk "$@" ;;
@@ -797,7 +775,6 @@ case $ACTION in
797775
list) list ;;
798776
bootdisk) bootdisk ;;
799777
dump) cat $rulesfile ;;
800-
*) usage ; exit 0 ;;
778+
*) die "Unknown action" ;;
801779
esac
802780

803-
rc=0

0 commit comments

Comments
 (0)