19
19
# more details.
20
20
# ---------------------------------------------------------------------------
21
21
# Revision history:
22
- # 2018-08-20 : Embedded manpage
22
+ # 2018-08-20 : Embedded manpage, removed DSSD support
23
23
# 2018-04-06 : Add $PATH to support remote and scripted execution
24
24
# 2017-12-14 : Bugfix for import function
25
25
# 2017-10-04 : Bugfix for SCSI id's with whitespace (Linux TGTD)
@@ -416,7 +416,7 @@ createconf() {
416
416
# label type identifier
417
417
# where
418
418
# 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,
420
420
# mapper (scsi=entire SCSI disk, part=scsi disk partition, mapper=linux disk mapper device)
421
421
# label: scsi_id, scsi_id:partition, mapper_name, vol_id etc
422
422
#
@@ -429,8 +429,7 @@ createconf() {
429
429
# vol2 part 36000c298afa5c31b47fe76cbd1750937:1 # partition 1 of entire SCSI disk
430
430
# vol3 mapper mpathb # /dev/mapper/mpathb (multipath device)
431
431
# 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
434
433
# iorate/test1 mapper iops-vol1 # LV vol1 on VG iops, will be mapped as /dev/iorate/test1
435
434
# -----------------------------------------------
436
435
EOF
@@ -490,11 +489,6 @@ createdisk() {
490
489
awk -v m=" $dmname " ' $3==m {exit 1;}' /etc/asmtab || rc=10 die " Mapper device $dmname already exists in asmtab!"
491
490
echo " $label mapper $dmname " >> /etc/asmtab
492
491
;;
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
- ;;
498
492
scini) # device is EMC ScaleIO disk
499
493
oid=$( /bin/emc/scaleio/drv_cfg --query_block_device_id --block_device ${device} )
500
494
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() {
546
540
# with each run of the "asm" command.
547
541
# Direct edit the file /etc/asmtab instead.
548
542
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
562
543
cat << - EOF >> $WORKDIR /99-asm.rules
563
-
544
+
564
545
SUBSYSTEM!="block", GOTO="asmudev_end"
565
546
566
547
# Don't touch the bootdisk (/dev/${bootdisk:- notfound} )
@@ -605,7 +586,6 @@ scandisks() {
605
586
pppart) LINE=${LINE} ' , ENV{DEVTYPE}=="partition", KERNEL=="' ${ID%:* }${ID#*: } ' "' ;;
606
587
scsi) LINE=${LINE} ' , ENV{DEVTYPE}=="disk", KERNEL=="sd*", ENV{ID_SERIAL}=="' $ID ' "' ;;
607
588
ppath) LINE=${LINE} ' , ENV{DEVTYPE}=="disk", KERNEL=="' $ID ' "' ;;
608
- dssd) LINE=${LINE} ' , ENV{DSSD_OID}=="' $ID ' "' ;;
609
589
scini) LINE=${LINE} ' , KERNEL=="scini*", PROGRAM="/opt/emc/scaleio/sdc/bin/drv_cfg --query_block_device_id --block_device /dev/%k", RESULT=="' $ID ' " ' ;;
610
590
* ) echo " unknown asmudev volume type $TYPE " ; exit 10 ;;
611
591
esac
@@ -634,15 +614,13 @@ devinfo() {
634
614
devname=$( readlink -f /sys/dev/block/${major} \: ${minor} | awk -F/ ' {print $NF}' )
635
615
case $devtype in
636
616
sd) (( $minor % 16 == 0 )) && dtype=scsi || dtype=partition ;;
637
- dssd) dtype=dssd ;;
638
617
device-mapper) dtype=mapper ;;
639
618
* ) dtype=unknown ;;
640
619
esac
641
620
case $dtype in
642
621
scsi) name=$( lsscsi -k 2> /dev/null | awk -v D=/dev/$devname ' $NF==D {print $1}' ) ;;
643
622
partition) name=" part$(( min% 16 )) " ;;
644
623
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}' ) ;;
646
624
* ) name=" -" ;;
647
625
esac
648
626
blocks=$( cat /sys/dev/block/${major} \: ${minor} /size)
@@ -694,7 +672,7 @@ listdisks() {
694
672
major=$( cat /sys/block/$d /dev | cut -d: -f1)
695
673
dt=$( devtrans $major )
696
674
case $dt in
697
- sd|dssd| scini|power2) diskinfo $d ;;
675
+ sd|scini|power2) diskinfo $d ;;
698
676
esac
699
677
done
700
678
}
@@ -770,12 +748,11 @@ renamedisk() {
770
748
# ============================================================================
771
749
# Main section - parsing options etc
772
750
# ---------------------------------------------------------------------------
773
- while getopts " :hndt " OPT; do
751
+ while getopts " :ndt " OPT; do
774
752
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 ;;
779
756
esac
780
757
done
781
758
shift $( expr $OPTIND - 1)
@@ -786,6 +763,7 @@ createconf
786
763
checkuuid
787
764
788
765
case $ACTION in
766
+ none) listdisks ;;
789
767
rescan) rescan ;;
790
768
createdisk) createdisk " $@ " ;;
791
769
deletedisk) deletedisk " $@ " ;;
@@ -797,7 +775,6 @@ case $ACTION in
797
775
list) list ;;
798
776
bootdisk) bootdisk ;;
799
777
dump) cat $rulesfile ;;
800
- * ) usage ; exit 0 ;;
778
+ * ) die " Unknown action " ;;
801
779
esac
802
780
803
- rc=0
0 commit comments