Some troubles with grub with buster point release 10.8

Carsten Aulbert carsten.aulbert at aei.mpg.de
Thu Feb 11 08:23:07 CET 2021


Hi

On 10.02.21 19:59, Thomas Lange wrote:
> I think we want to match all real disks which can be identified by a
> name, model, serial number. Maybe also virtualized disks which have
> such an entry at by-id.

given that the `ata` bits came from my initial script and the fact that 
we mostly have SATA drives in our machines, I feel a bit of guilty ;-)

Would something like a "choice-priority" function fly instead?

I assume udevadm would return any of the valid device links and by-path 
is always set, thus:

get_stable_devname() {
     _DEV="$1"

     # prefer SCSI over ATA over WWN over path 

     RET=""
     for i in $(udevadm info -r --query=symlink "$_DEV")
     do
         if [[ "$i" =~ /by-id/scsi && -z "$RET" ]]
         then
             RET="$i"
         elif [[ "$i" =~ /by-id/ata && -z "$RET" ]]
         then
             RET="$i"
         elif [[ "$i" =~ /by-id/wwn && -z "$RET" ]]
         then
             RET="$i"
         elif [[ "$i" =~ /by-path/ && -z "$RET" ]]
         then
             RET="$i"
         fi
     done

     echo "$RET"
}

get_stable_devname /dev/sda

(or am I missing the point)?

Cheers

Carsten
-- 
Dr. Carsten Aulbert, Max Planck Institute for Gravitational Physics,
Callinstraße 38, 30167 Hannover, Germany, Phone +49 511 762 17185


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5178 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20210211/efd2cc49/attachment.p7s>


More information about the linux-fai mailing list