Some troubles with grub with buster point release 10.8

Carsten Aulbert carsten.aulbert at
Thu Feb 11 10:17:59 CET 2021

On 11.02.21 09:53, Thomas Lange wrote:
>>>>>> On Thu, 11 Feb 2021 08:23:07 +0100, Carsten Aulbert <carsten.aulbert at> said:
>      > I assume udevadm would return any of the valid device links and by-path
>      > is always set, thus:
>      > get_stable_devname() {
>      >      _DEV="$1"
> This does not work, because the order of links returned by udevadm
> changes with every call.

That's what I wanted to do but I "optimized" the function too much and 
it does not work anymore...

Thus, second try (not sure if I use the array correctly, but it seems to 
work on my test boxes, bonus point attempt to use BASIC style line 
numbers as index numbers to leave room for further possibilities ;-)):

get_stable_devname() {

     declare -a _RES

     # prefer SCSI over ATA over WWN over path 

     for i in $(udevadm info -r --query=symlink "$_DEV")
         if [[ "$i" =~ /by-id/scsi ]]
         elif [[ "$i" =~ /by-id/ata ]]
         elif [[ "$i" =~ /by-id/wwn ]]
         elif [[ "$i" =~ /by-path/ ]]

     echo "${_RES[@]::1}"

get_stable_devname /dev/sda


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5178 bytes
Desc: S/MIME Cryptographic Signature
URL: <>

More information about the linux-fai mailing list