Identify disks for setup-storage

Thomas Lange lange at cs.uni-koeln.de
Sun Jan 8 11:26:36 CET 2023


Hi Thomas,

I use a script to reorder the variable $disklist, so setup-storage can
mostly use disk1, but I can define the order of the disk depending on
disk types or even the serial number of a disk. The script is class/99-disklist.sh:


#! /bin/bash

mydisks() {

    find $* -type l -printf "%f %l\n" | egrep -v '^md|-part|wwn-' | egrep ^ata | sed -e 's#.*/##g'| tr '\n' ' '
}

# This is really important, because we use shell globbing for creating the list of disks
cd /dev/disk/by-id || echo Cannot get disk information


case $HOSTNAME in
    server1) newlist=$(mydisks *WD3000FYYZ* *0F400HGN* ) ;;
    server2) newlist=$(mydisks *WDC_WD320* *ST31000* *SAMSUNG_HD502* ) ;;
    www5)    newlist=$(mydisks *_SSD_* *TOSHIBA* ) ;;
esac

if [ -n "$newlist" ]; then
    echo New disklist: $newlist
    echo disklist=\"$newlist\" >> $LOGDIR/additional.var
fi

-- 
viele Grüße Thomas


More information about the linux-fai mailing list