device_to_disk () {
echo "$1" | \
sed 's:\(/dev/[a-z]\+\).*:\1:'
}
device_to_disk /dev/mapper/vgubuntu-root
So device_to_disk() is doing what it is supposed to do and there was NO CHANGE to it (as it appears).
I guess using grub-install at /dev/vda was allowed before (instead of the LVM PV ?), so there wasn't a need to use /dev/mapper/vgubuntu-root as the argument for grub-installer.
It is either that OR the "/dev/mapper" section of this same script, related to:
case $prefix in
...
/dev/mapper)
disc_offered_devfs=...
...
couldn't deal with virtio disks on top of LVM (my next task here) as it should.
Simply using:
----
#!/bin/bash
device_to_disk () {
echo "$1" | \
sed 's:\(/dev/mapper/.*\+\|/dev/[a-z]\+\).*:\1:'
}
instead, keeps the same behavior for everything else AND fixes usage case where device is "/dev/mapper/XXXXX". This is ONE WAY of fixing this, BUT I guess the /dev/mapper section should also work for LVM w/ virtio disks, as stated in the script, so I'm investigating this.
Reproducer:
#!/bin/bash
device_to_disk () { [a-z]\+ \).*:\1: '
echo "$1" | \
sed 's:\(/dev/
}
device_to_disk /dev/mapper/ vgubuntu- root
So device_to_disk() is doing what it is supposed to do and there was NO CHANGE to it (as it appears).
I guess using grub-install at /dev/vda was allowed before (instead of the LVM PV ?), so there wasn't a need to use /dev/mapper/ vgubuntu- root as the argument for grub-installer.
It is either that OR the "/dev/mapper" section of this same script, related to:
case $prefix in offered_ devfs=. ..
...
/dev/mapper)
disc_
...
couldn't deal with virtio disks on top of LVM (my next task here) as it should.
Simply using:
----
#!/bin/bash
device_to_disk () { mapper/ .*\+\|/ dev/[a- z]\+\). *:\1:'
echo "$1" | \
sed 's:\(/dev/
}
device_to_disk /dev/mapper/ vgubuntu- root
device_to_disk /dev/something/else
$ ./temp.sh vgubuntu- root
/dev/mapper/
/dev/something
----
instead, keeps the same behavior for everything else AND fixes usage case where device is "/dev/mapper/ XXXXX". This is ONE WAY of fixing this, BUT I guess the /dev/mapper section should also work for LVM w/ virtio disks, as stated in the script, so I'm investigating this.