Re: Identify disks for setup-storage

Thomas Lange <[email protected]>
Newsgroups gmane.linux.debian.fai
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.