lliseil
December 17th, 2015, 04:15 PM
Hi, installing a dual boot Ubuntu Trusty and Mageia 5 GNOME on a brand new rig for an old man.
Note: As suggested by the dates on my profile I'm not an Ubuntu crack though I have a >ten years old GNU/Linux Xperience.
In short:
Decide in advance which Linux is to be in charge of the boot loader: Ubuntu (since LTS has the longer live support it should preferably be in charge of the bootloader management)
Partitionned the disks, MBR/msdos, logical volumes but for /boot
Installed Mageia 5 x86_64 from the Network ISO, Grub leagacy on the MBR, rebooted: all is fine.
Installed Ubuntu Gnome x86_64 from the Network ISO, rebooted, GRUB2 « do you wanna update Grub (installed) and replace it on the MBR? » yeap, rebooted: no OS entry will boot. a check shows the most borked grub.cfg of all times
Any attempt to update-grub2 resulted in a similarily borked, unusable bootloader; SuperGrub2Disk (Ubuntu = busybox, Mageia OK); from Mageia (os-prober and Grub2); and from chrooted Ubuntu (LVM related error on update-grub2)
Some details
If something's missing just say it please, I'll add ASAP (have running ssh access to the box)
Box and Partitions
------------------------------
It's a nice simple office station with a Pentium(R) CPU G3250, 4096 MB DDR3 RAM, and a MSI MS-7817.
120 GB SSD KINGSTON SV300S37A120G
+-------+-----------------------------------+-------+
| /boot | VG1 (lv_{mageia,ubuntu,home,swap} | libre |
+-------+-----------------------------------+-------+
500 GB Seagate Barracuda 7200.14
+-------+-------------------------------------------+----------+
| /sdb1 | VG2 (lv_data) | libre |
+-------+-------------------------------------------+----------+
blkid
/dev/sda1: LABEL="boot" UUID="c78bb5cd-a401-4cd2-aa32-69222d8c6876" TYPE="ext4" PARTUUID="ffc2da47-01"
/dev/sda2: UUID="MBob8w-JQaI-p9Li-bWxA-ypoM-bOV8-7XDV6J" TYPE="LVM2_member" PARTUUID="ffc2da47-02"
/dev/sdb1: LABEL="boot2" UUID="7727dafa-4b8f-4faf-b28a-fc236c576d21" TYPE="ext4" PARTUUID="7970ac30-01"
/dev/sdb2: UUID="mYYRMi-sOUq-89Dq-7TVo-mroS-oexp-s5btOv" TYPE="LVM2_member" PARTUUID="7970ac30-02"
/dev/mapper/vg_ssd-mandriva: UUID="8c0524c8-ca40-4766-9d6f-fa674f689898" TYPE="ext4"
/dev/mapper/vg_hdd-donnees: LABEL="donnees" UUID="e67fcf28-4946-40e9-bd58-9f10e77f949c" TYPE="ext4"
/dev/mapper/vg_hdd-swap: LABEL="swap" UUID="3d509caf-23f3-4640-ad24-19147cedd470" TYPE="swap"
/dev/mapper/vg_ssd-ubuntu: UUID="f6bcbea1-1f09-4a10-a1b4-12a6a8605c32" TYPE="ext4"
/dev/mapper/vg_ssd-home: LABEL="home" UUID="49ae653b-8c70-429c-b31c-c2d1fd03e1c1" TYPE="ext4"
OSes
---------------
100% default install. Only configured the users, S.M.A.R.T. monitoring and ssh.
Couldn't boot into Ubuntu but through a chroot
/boot/grub/menu.lst by Mageia 5
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,0)/gfxmenu
default 0
title linux
kernel (hd0,0)/vmlinuz BOOT_IMAGE=linux root=/dev/vg_ssd/mandriva splash quiet noiswmd
root (hd0,0)
initrd /initrd.img
title failsafe
kernel (hd0,0)/vmlinuz BOOT_IMAGE=failsafe root=/dev/vg_ssd/mandriva failsafe noiswmd
root (hd0,0)
initrd /initrd.img
/boot/grub/grub.cfg by Ubuntu 15.10 (full 700 lines availbale https://ptpb.pw/3RMs)
<SNIP>
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff
initrd /initrd-desktop.img
}
submenu 'Options avancées pour Ubuntu' $menuentry_id_option 'gnulinux-advanced-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
menuentry 'Ubuntu, avec Linux desktop' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-advanced-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
menuentry 'Ubuntu, with Linux desktop (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-init-upstart-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff init=/sbin/upstart
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
menuentry 'Ubuntu, with Linux desktop (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-recovery-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro recovery nomodeset
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
<SNIP>
Refs I (should have) used
--------------------------------
- https://help.ubuntu.com/community/DualBoot Unless I'm blind it lacks any information for dual booting Linuxes
- Mageia has a nice page on how to add another distro for an easy multi-booting choice (but it's Mageia driven) http://www.mageialinux-online.org/wiki/gestionnaire-d-amorcage-grub-et-multiboot
- Clear, seems I should have go like him: https://letchap.github.io/2013/04/03/dual-boot-lubuntu-mageia-2-lxde/
QUESTION
Any guess why did Ubuntu Grub2 produce this terrible grub.cfg
How would you handle this, preferably without a full reinstall of both OSes :-} THank you
Note: As suggested by the dates on my profile I'm not an Ubuntu crack though I have a >ten years old GNU/Linux Xperience.
In short:
Decide in advance which Linux is to be in charge of the boot loader: Ubuntu (since LTS has the longer live support it should preferably be in charge of the bootloader management)
Partitionned the disks, MBR/msdos, logical volumes but for /boot
Installed Mageia 5 x86_64 from the Network ISO, Grub leagacy on the MBR, rebooted: all is fine.
Installed Ubuntu Gnome x86_64 from the Network ISO, rebooted, GRUB2 « do you wanna update Grub (installed) and replace it on the MBR? » yeap, rebooted: no OS entry will boot. a check shows the most borked grub.cfg of all times
Any attempt to update-grub2 resulted in a similarily borked, unusable bootloader; SuperGrub2Disk (Ubuntu = busybox, Mageia OK); from Mageia (os-prober and Grub2); and from chrooted Ubuntu (LVM related error on update-grub2)
Some details
If something's missing just say it please, I'll add ASAP (have running ssh access to the box)
Box and Partitions
------------------------------
It's a nice simple office station with a Pentium(R) CPU G3250, 4096 MB DDR3 RAM, and a MSI MS-7817.
120 GB SSD KINGSTON SV300S37A120G
+-------+-----------------------------------+-------+
| /boot | VG1 (lv_{mageia,ubuntu,home,swap} | libre |
+-------+-----------------------------------+-------+
500 GB Seagate Barracuda 7200.14
+-------+-------------------------------------------+----------+
| /sdb1 | VG2 (lv_data) | libre |
+-------+-------------------------------------------+----------+
blkid
/dev/sda1: LABEL="boot" UUID="c78bb5cd-a401-4cd2-aa32-69222d8c6876" TYPE="ext4" PARTUUID="ffc2da47-01"
/dev/sda2: UUID="MBob8w-JQaI-p9Li-bWxA-ypoM-bOV8-7XDV6J" TYPE="LVM2_member" PARTUUID="ffc2da47-02"
/dev/sdb1: LABEL="boot2" UUID="7727dafa-4b8f-4faf-b28a-fc236c576d21" TYPE="ext4" PARTUUID="7970ac30-01"
/dev/sdb2: UUID="mYYRMi-sOUq-89Dq-7TVo-mroS-oexp-s5btOv" TYPE="LVM2_member" PARTUUID="7970ac30-02"
/dev/mapper/vg_ssd-mandriva: UUID="8c0524c8-ca40-4766-9d6f-fa674f689898" TYPE="ext4"
/dev/mapper/vg_hdd-donnees: LABEL="donnees" UUID="e67fcf28-4946-40e9-bd58-9f10e77f949c" TYPE="ext4"
/dev/mapper/vg_hdd-swap: LABEL="swap" UUID="3d509caf-23f3-4640-ad24-19147cedd470" TYPE="swap"
/dev/mapper/vg_ssd-ubuntu: UUID="f6bcbea1-1f09-4a10-a1b4-12a6a8605c32" TYPE="ext4"
/dev/mapper/vg_ssd-home: LABEL="home" UUID="49ae653b-8c70-429c-b31c-c2d1fd03e1c1" TYPE="ext4"
OSes
---------------
100% default install. Only configured the users, S.M.A.R.T. monitoring and ssh.
Couldn't boot into Ubuntu but through a chroot
/boot/grub/menu.lst by Mageia 5
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,0)/gfxmenu
default 0
title linux
kernel (hd0,0)/vmlinuz BOOT_IMAGE=linux root=/dev/vg_ssd/mandriva splash quiet noiswmd
root (hd0,0)
initrd /initrd.img
title failsafe
kernel (hd0,0)/vmlinuz BOOT_IMAGE=failsafe root=/dev/vg_ssd/mandriva failsafe noiswmd
root (hd0,0)
initrd /initrd.img
/boot/grub/grub.cfg by Ubuntu 15.10 (full 700 lines availbale https://ptpb.pw/3RMs)
<SNIP>
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
if [ "${1}" = "keep" ]; then
set vt_handoff=vt.handoff=7
else
set vt_handoff=
fi
}
if [ "${recordfail}" != 1 ]; then
if [ -e ${prefix}/gfxblacklist.txt ]; then
if hwmatch ${prefix}/gfxblacklist.txt 3; then
if [ ${match} = 0 ]; then
set linux_gfx_mode=keep
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=text
fi
else
set linux_gfx_mode=keep
fi
else
set linux_gfx_mode=text
fi
export linux_gfx_mode
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff
initrd /initrd-desktop.img
}
submenu 'Options avancées pour Ubuntu' $menuentry_id_option 'gnulinux-advanced-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
menuentry 'Ubuntu, avec Linux desktop' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-advanced-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
menuentry 'Ubuntu, with Linux desktop (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-init-upstart-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro splash quiet $vt_handoff init=/sbin/upstart
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
menuentry 'Ubuntu, with Linux desktop (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-desktop-recovery-f6bcbea1-1f09-4a10-a1b4-12a6a8605c32' {
recordfail
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1 --hint='hd1,msdos1' c78bb5cd-a401-4cd2-aa32-69222d8c6876
else
search --no-floppy --fs-uuid --set=root c78bb5cd-a401-4cd2-aa32-69222d8c6876
fi
echo 'Chargement de Linux desktop…'
linux /vmlinuz-desktop root=/dev/mapper/vg_ssd-ubuntu ro recovery nomodeset
echo 'Chargement du disque mémoire initial…'
initrd /initrd-desktop.img
}
<SNIP>
Refs I (should have) used
--------------------------------
- https://help.ubuntu.com/community/DualBoot Unless I'm blind it lacks any information for dual booting Linuxes
- Mageia has a nice page on how to add another distro for an easy multi-booting choice (but it's Mageia driven) http://www.mageialinux-online.org/wiki/gestionnaire-d-amorcage-grub-et-multiboot
- Clear, seems I should have go like him: https://letchap.github.io/2013/04/03/dual-boot-lubuntu-mageia-2-lxde/
QUESTION
Any guess why did Ubuntu Grub2 produce this terrible grub.cfg
How would you handle this, preferably without a full reinstall of both OSes :-} THank you