Re: Identify disks for setup-storage
Thank you all - I have managed to get a hold on my disks, much in the described way. Cheers Thomas On 09/01/2023 22.22, andrew bezella wrote: On Sun, 2023-01-08 at 11:26 +0100, Thomas Lange wrote: 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: we use a similar strategy inspired by a 2013 discussion[1]. with batches of homogeneously-built hosts we can use the information in `/dev/disk/by-path` to walk through a known disk layout in our preferred order (see attached). hth, andy 1. https://lists.uni-koeln.de/pipermail/linux-fai/2013-November/010229.html -- Thomas Roth Department: Informationstechnologie Location: SB3 2.291 GSI Helmholtzzentrum für Schwerionenforschung GmbH Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.de Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528 Managing Directors / Geschäftsführung: Professor Dr. Paolo Giubellino, Dr. Ulrich Breuer, Jörg Blaurock Chairman of the Supervisory Board / Vorsitzender des GSI-Aufsichtsrats: State Secretary / Staatssekretär Dr. Volkmar Dietz
Re: Identify disks for setup-storage
On Sun, 2023-01-08 at 11:26 +0100, Thomas Lange wrote: > 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: we use a similar strategy inspired by a 2013 discussion[1]. with batches of homogeneously-built hosts we can use the information in `/dev/disk/by-path` to walk through a known disk layout in our preferred order (see attached). hth, andy 1. https://lists.uni-koeln.de/pipermail/linux-fai/2013-November/010229.html -- andrew bezella internet archive 99-disklist.sh Description: application/shellscript
Re: Identify disks for setup-storage
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