# This should probably be rewritten using udevadm or similar.
device_to_disk () {
echo "$1" | \
sed 's:\(/dev/\(cciss\|ida\|rs\)/c[0-9]d[0-9][0-9]*\|/dev/mmcblk[0-9]\|/dev/nvme[0-9][0-9]*n[0-9][0-9]*\|/dev/\(ad\|ada\|da\|vtbd\|x bd\)[0-9]\+\|/dev/[hms]d[0-9]\+\|/dev/[a-z]\+\).*:\1:'
}
The values for:
default_ bootdev= /dev/vda1 /dev/mapper/ vgubuntu- root
bootfs=
disk=/dev/mapper
in that code part. Which means, disk is wrong:
disk=$( device_ to_disk "$bootfs")
coming from:
# This should probably be rewritten using udevadm or similar. \(cciss\ |ida\|rs\ )/c[0-9] d[0-9][ 0-9]*\| /dev/mmcblk[ 0-9]\|/ dev/nvme[ 0-9][0- 9]*n[0- 9][0-9] *\|/dev/ \(ad\|ada\ |da\|vtbd\ |x bd\)[0- 9]\+\|/ dev/[hms] d[0-9]\ +\|/dev/ [a-z]\+ \).*:\1: '
device_to_disk () {
echo "$1" | \
sed 's:\(/dev/
}
I'll brb to fix this.