bootdev=/dev/mapper after disk=$(device_to_disk bootfs)
since bootfs is bootfs=/dev/mapper/vgubuntu-root
and device_to_disk will remove last part from /dev/mapper/XXX.
so, device_to_disk() has cut "vgubuntu-root" from the string and that is how bootdev has become "/dev/mapper" only.
----
Testing with a SCSI disk, I got the exact same DEBUG output, BUT ...
I was able to see that the INITIAL value for:
grub-installer/bootdev WAS "/dev/sda"
but, after purging it with "debconf-set grub-installer/bootdev ''", I could NOT repopulate db variable again by executing only "grub-installer /target", DIFFERENTLY than when executing "grub-installer /target" in a /dev/vda based LVM, when it ALWAYS gets populated like described above (with /dev/mapper).
TODO:
discover why grub-installer/bootdev isn't populated back when re-executing "grub-installer /target" after purging the original (right after installation) value. Whenever bootdev defaults to /dev/mapper/XXXX, bootdev should be replaced with /dev/sdXXX or /dev/vdXXX, one of the LVM PV disks of under laying volume group (to confirm).
## SUMMARY OF THE ISSUE ##
After reading the grub-installer script, and following execution flow:
...
if [ "$found" = "0" ] && type lvdisplay >/dev/null 2>&1 && \ offered" )/control" ]); then
(lvdisplay "$disc_offered" | grep -q 'LV Name' 2>/dev/null || \
[ -e "$(dirname "$disc_
# Don't set frdev/frdisk here, otherwise you'll end up in different
# code paths below ...
frtype=lvm
fi
...
default_ bootdev_ os="$($ chroot $ROOT grub-mkdevicemap --no-floppy -m - | head -n1 | cut -f2)" bootdev_ os" ]; then bootdev= "$($chroot $ROOT readlink -f "$default_ bootdev_ os")" bootdev && [ "$RET" = '(hd0)' ]; then bootdev "$default_bootdev" bootdev= "(hd0)"
if [ "$default_
default_
if db_get grub-installer/
db_set grub-installer/
fi
else
default_
fi
DEBUG:
default_ bootdev_ os=/dev/ disk/by- id/lvm- pv-uuid- IKvzNq- IRE5-arLC- hSS1-jDU2- ZSKA-90lATY
and bootdev wasn't set to anything because it isn't '(hd0)'.
...
elif [ "$(device_to_disk "$cdsrc")" = "$default_bootdev" ] || \ bootdev seen $(device_ to_disk "$bootfs") bootdev "$disk"
([ -n "$hdsrc" ] && [ "$(device_to_disk "$hdsrc")" = "$default_bootdev" ]) || \
([ "$default_bootdev" = '(hd0)' ] && \
(([ -n "$cdfs" ] && [ "$cdfs" != "iso9660" ]) || \
[ "$hybrid" = true ])) || \
([ "$default_bootdev" != '(hd0)' ] && \
! partmap "$default_bootdev" >/dev/null && \
! grub_probe -t fs -d "$default_bootdev" >/dev/null); then
db_fget grub-installer/
if [ "$RET" != true ]; then
bootfs=$(findfs /boot)
[ "$bootfs" ] || bootfs="$(findfs /)"
disk=
db_set grub-installer/
state=2
fi
fi
DEBUG:
bootdev=/dev/mapper after disk=$( device_ to_disk bootfs) /dev/mapper/ vgubuntu- root
since bootfs is bootfs=
and device_to_disk will remove last part from /dev/mapper/XXX.
bootfs is /dev/mapper/ vgubuntu- root BECAUSE:
rootfs=$(findfs /)
bootfs=$(findfs /boot
[ -n "$bootfs" ] || bootfs="$rootfs"
so, device_to_disk() has cut "vgubuntu-root" from the string and that is how bootdev has become "/dev/mapper" only.
----
Testing with a SCSI disk, I got the exact same DEBUG output, BUT ...
I was able to see that the INITIAL value for:
grub-installer/ bootdev WAS "/dev/sda"
but, after purging it with "debconf-set grub-installer/ bootdev ''", I could NOT repopulate db variable again by executing only "grub-installer /target", DIFFERENTLY than when executing "grub-installer /target" in a /dev/vda based LVM, when it ALWAYS gets populated like described above (with /dev/mapper).
TODO:
discover why grub-installer/ bootdev isn't populated back when re-executing "grub-installer /target" after purging the original (right after installation) value. Whenever bootdev defaults to /dev/mapper/XXXX, bootdev should be replaced with /dev/sdXXX or /dev/vdXXX, one of the LVM PV disks of under laying volume group (to confirm).