J'ai plusieurs distributions Linux sur mon poste, et pilotée par un grub legacy (Maitre) installé à l'époque via Mageia 6, sur le disque sdd.
Chaque distribution disposant de son propre grub.
Le menu.lst suivant, me permettait d'accéder au grub de chaque distribution
Code : Tout sélectionner
gtimeout 3
color black/cyan yellow/cyan
gfxmenu (hd0,0)/gfxmenu
default 0
title ArchLinux
root (hd0,1)
kernel /boot/grub/i386-pc/core.img
title Mageia
root (hd0,2)
kernel /boot/grub2/i386-pc/core.img
Code : Tout sélectionner
(hd0) /dev/sdd
(hd1) /dev/sda
(hd2) /dev/sdb
(hd3) /dev/sdc
(hd4) /dev/sde
(hd5) /dev/sdj
Exemple de grub.cfg, généré à partir de Mageia :
Code : Tout sélectionner
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -f ${config_directory}/grubenv ]; then
load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd3,msdos3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos3 --hint-efi=hd3,msdos3 --hint-baremetal=ahci3,msdos3 fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98
else
search --no-floppy --fs-uuid --set=root fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=1024x768x32
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=fr_FR
insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
insmod gfxmenu
loadfont ($root)/grub2/themes/maggy/MageiaLogoBold-16.pf2
loadfont ($root)/grub2/themes/maggy/MageiaLogoBold-20.pf2
loadfont ($root)/grub2/themes/maggy/MageiaLogoBold-28.pf2
loadfont ($root)/grub2/themes/maggy/MageiaLogoRegular-20.pf2
insmod png
set theme=($root)/grub2/themes/maggy/theme.txt
export theme
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if [ -n "${GRUB2_PASSWORD}" ]; then
set superusers="root"
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi
### END /etc/grub.d/01_users ###
### BEGIN /etc/grub.d/08_fallback_counting ###
insmod increment
# Check if boot_counter exists and boot_success=0 to activate this behaviour.
if [ -n "${boot_counter}" -a "${boot_success}" = "0" ]; then
# if countdown has ended, choose to boot rollback deployment,
# i.e. default=1 on OSTree-based systems.
if [ "${boot_counter}" = "0" -o "${boot_counter}" = "-1" ]; then
set default=1
set boot_counter=-1
# otherwise decrement boot_counter
else
decrement boot_counter
fi
save_env boot_counter
fi
### END /etc/grub.d/08_fallback_counting ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Mageia' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-simple-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
savedefault
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-5.15.110-desktop-2.mga8 root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro splash quiet noiswmd resume=UUID=c7317d05-31b4-46f7-8b77-16ebfdce29a0 audit=0 vga=791
initrd /initrd-5.15.110-desktop-2.mga8.img
}
submenu 'Options avancées pour Mageia' $menuentry_id_option 'gnulinux-advanced-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
menuentry 'Mageia (5.15.110-desktop-2.mga8) 8' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.15.110-desktop-2.mga8-advanced-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
savedefault
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-5.15.110-desktop-2.mga8 root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro splash quiet noiswmd resume=UUID=c7317d05-31b4-46f7-8b77-16ebfdce29a0 audit=0 vga=791
initrd /initrd-5.15.110-desktop-2.mga8.img
}
menuentry 'Mageia (5.15.110-desktop-2.mga8) 8 (recovery mode)' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.15.110-desktop-2.mga8-recovery-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-5.15.110-desktop-2.mga8 root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro failsafe
initrd /initrd-5.15.110-desktop-2.mga8.img
}
menuentry 'Mageia (5.10.16-desktop-1.mga8) 8' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.10.16-desktop-1.mga8-advanced-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
savedefault
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-5.10.16-desktop-1.mga8 root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro splash quiet noiswmd resume=UUID=c7317d05-31b4-46f7-8b77-16ebfdce29a0 audit=0 vga=791
initrd /initrd-5.10.16-desktop-1.mga8.img
}
menuentry 'Mageia (5.10.16-desktop-1.mga8) 8 (recovery mode)' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-5.10.16-desktop-1.mga8-recovery-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-5.10.16-desktop-1.mga8 root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro failsafe
initrd /initrd-5.10.16-desktop-1.mga8.img
}
menuentry 'Mageia (desktop) 8' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-desktop-advanced-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
savedefault
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-desktop root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro splash quiet noiswmd resume=UUID=c7317d05-31b4-46f7-8b77-16ebfdce29a0 audit=0 vga=791
initrd /initrd-desktop.img
}
menuentry 'Mageia (desktop) 8 (recovery mode)' --class mageia --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-desktop-recovery-fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98' {
set gfxpayload=text
insmod gzio
insmod part_msdos
insmod ext2
set root='hd3,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos1 --hint-efi=hd3,msdos1 --hint-baremetal=ahci3,msdos1 b2734ce3-6bb4-49d7-bff3-be26ea499685
else
search --no-floppy --fs-uuid --set=root b2734ce3-6bb4-49d7-bff3-be26ea499685
fi
linux /vmlinuz-desktop root=UUID=fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98 ro failsafe
initrd /initrd-desktop.img
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/10_reset_boot_success ###
# Hiding the menu is ok if last boot was ok or if this is a first boot attempt to boot the entry
if [ "${boot_success}" = "1" -o "${boot_indeterminate}" = "1" ]; then
set menu_hide_ok=1
else
set menu_hide_ok=0
fi
# Reset boot_indeterminate after a successful boot
if [ "${boot_success}" = "1" ] ; then
set boot_indeterminate=0
# Avoid boot_indeterminate causing the menu to be hidden more than once
elif [ "${boot_indeterminate}" = "1" ]; then
set boot_indeterminate=2
fi
# Reset boot_success for current boot
set boot_success=0
save_env boot_success boot_indeterminate
### END /etc/grub.d/10_reset_boot_success ###
### BEGIN /etc/grub.d/12_menu_auto_hide ###
if [ x$feature_timeout_style = xy ] ; then
if [ "${menu_show_once}" ]; then
unset menu_show_once
save_env menu_show_once
set timeout_style=menu
set timeout=60
elif [ "${menu_auto_hide}" -a "${menu_hide_ok}" = "1" ]; then
set orig_timeout_style=${timeout_style}
set orig_timeout=${timeout}
if [ "${fastboot}" = "1" ]; then
# timeout_style=menu + timeout=0 avoids the countdown code keypress check
set timeout_style=menu
set timeout=0
else
set timeout_style=hidden
set timeout=1
fi
fi
fi
### END /etc/grub.d/12_menu_auto_hide ###
### BEGIN /etc/grub.d/14_menu_show_once ###
if [ x$feature_timeout_style = xy ]; then
if [ "${menu_show_once_timeout}" ]; then
set timeout_style=menu
set timeout="${menu_show_once_timeout}"
unset menu_show_once_timeout
save_env menu_show_once_timeout
fi
fi
### END /etc/grub.d/14_menu_show_once ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch Linux (sur /dev/sdd2)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-255cc3ba-164c-453f-9bda-39fea3003b62' {
savedefault
insmod part_msdos
insmod ext2
set root='hd3,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos2 --hint-efi=hd3,msdos2 --hint-baremetal=ahci3,msdos2 255cc3ba-164c-453f-9bda-39fea3003b62
else
search --no-floppy --fs-uuid --set=root 255cc3ba-164c-453f-9bda-39fea3003b62
fi
linux /boot/vmlinuz-linux root=UUID=255cc3ba-164c-453f-9bda-39fea3003b62 rw loglevel=3 quiet
initrd /boot/initramfs-linux.img
}
submenu 'Options avancées pour Arch Linux (sur /dev/sdd2)' $menuentry_id_option 'osprober-gnulinux-advanced-255cc3ba-164c-453f-9bda-39fea3003b62' {
menuentry 'Arch Linux, with Linux linux (sur /dev/sdd2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--255cc3ba-164c-453f-9bda-39fea3003b62' {
savedefault
insmod part_msdos
insmod ext2
set root='hd3,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos2 --hint-efi=hd3,msdos2 --hint-baremetal=ahci3,msdos2 255cc3ba-164c-453f-9bda-39fea3003b62
else
search --no-floppy --fs-uuid --set=root 255cc3ba-164c-453f-9bda-39fea3003b62
fi
linux /boot/vmlinuz-linux root=UUID=255cc3ba-164c-453f-9bda-39fea3003b62 rw loglevel=3 quiet
initrd /boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs) (sur /dev/sdd2)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-/boot/vmlinuz-linux--255cc3ba-164c-453f-9bda-39fea3003b62' {
savedefault
insmod part_msdos
insmod ext2
set root='hd3,msdos2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd3,msdos2 --hint-efi=hd3,msdos2 --hint-baremetal=ahci3,msdos2 255cc3ba-164c-453f-9bda-39fea3003b62
else
search --no-floppy --fs-uuid --set=root 255cc3ba-164c-453f-9bda-39fea3003b62
fi
linux /boot/vmlinuz-linux root=UUID=255cc3ba-164c-453f-9bda-39fea3003b62 rw loglevel=3 quiet
initrd /boot/initramfs-linux-fallback.img
}
}
# Other OS found, undo autohiding of menu unless menu_auto_hide=2
if [ "${orig_timeout_style}" -a "${menu_auto_hide}" != "2" ]; then
set timeout_style=${orig_timeout_style}
set timeout=${orig_timeout}
fi
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
#Archlinux
menuentry 'Archlinux' {
insmod chain
uuid=255cc3ba-164c-453f-9bda-39fea3003b62
set root='hd3,msdos2'
chainloader +1
}
menuentry 'Mageia' {
set root='hd3,msdos1'
chainloader +1
}
#Archlinux
menuentry 'Archlinux bis' {
insmod chain
search.fs_uuid 255cc3ba-164c-453f-9bda-39fea3003b62 --set root
chainloader +1
}
#Archlinux
menuentry 'Archlinux syntaxe 2' {
insmod chain
set root=255cc3ba-164c-453f-9bda-39fea3003b62
chainloader +1
}
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
Code : Tout sélectionner
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 298,1G 0 disk
├─sda1 8:1 0 1,5G 0 part [SWAP]
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 296,6G 0 part
└─VG_Data-LV_VBox 252:0 0 300G 0 lvm /media/VBox
sdb 8:16 0 298,1G 0 disk
├─sdb1 8:17 0 1,5G 0 part [SWAP]
├─sdb2 8:18 0 1K 0 part
└─sdb5 8:21 0 296,6G 0 part
├─VG_Data-LV_VBox 252:0 0 300G 0 lvm /media/VBox
├─VG_Data-LV_Repository 252:1 0 30G 0 lvm /media/Repository
└─VG_Data-LV_Shared 252:2 0 140G 0 lvm
sdc 8:32 0 232,9G 0 disk
├─sdc1 8:33 0 1,5G 0 part [SWAP]
├─sdc2 8:34 0 1K 0 part
└─sdc5 8:37 0 180G 0 part
sdd 8:48 0 111,8G 0 disk
├─sdd1 8:49 0 300M 0 part /boot
├─sdd2 8:50 0 20G 0 part
├─sdd3 8:51 0 20G 0 part /
├─sdd4 8:52 0 1K 0 part
└─sdd5 8:53 0 20G 0 part /home
sde 8:64 0 232,9G 0 disk
├─sde1 8:65 0 1K 0 part
├─sde5 8:69 0 1,5G 0 part [SWAP]
└─sde6 8:70 0 231,4G 0 part /media/Data
sr0 11:0 1 1024M 0 rom
Code : Tout sélectionner
/dev/sda1: UUID="c7317d05-31b4-46f7-8b77-16ebfdce29a0" TYPE="swap" PARTUUID="18119514-01"
/dev/sda5: UUID="TrZEr1-0qOv-d3WA-ke2b-qOUD-r39A-yQsX18" TYPE="LVM2_member" PARTUUID="18119514-05"
/dev/sdb1: UUID="3bc0af22-d5e6-4fb4-9e9e-eb0f52588615" TYPE="swap" PARTUUID="85aa2d93-01"
/dev/sdb5: UUID="QEtwU1-xq6p-6KBK-Ou4M-kMac-obLf-qi33BT" TYPE="LVM2_member" PARTUUID="85aa2d93-05"
/dev/sdc1: UUID="6b0e8922-486e-4ae4-9d93-80e70ab96d98" TYPE="swap" PARTUUID="00047ea5-01"
/dev/sdc5: LABEL="Backup" UUID="eef4127e-7b37-4286-a756-fd42b9706ef3" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="00047ea5-05"
/dev/sdd1: LABEL="BootMaster" UUID="b2734ce3-6bb4-49d7-bff3-be26ea499685" BLOCK_SIZE="1024" TYPE="ext4" PARTUUID="000bc70c-01"
/dev/sdd2: LABEL="ArchLinux" UUID="255cc3ba-164c-453f-9bda-39fea3003b62" BLOCK_SIZE="4096" TYPE="ext4" PTTYPE="dos" PARTUUID="000bc70c-02"
/dev/sdd3: LABEL="Mageia" UUID="fa7c1fcd-0cc9-4be3-8d03-8e3ca8910c98" BLOCK_SIZE="4096" TYPE="ext4" PTTYPE="dos" PARTUUID="000bc70c-03"
/dev/sdd5: LABEL="P_Home" UUID="690cdf3e-42b4-4188-abba-58f1fb75e309" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="000bc70c-05"
/dev/sde5: UUID="c0131012-bc72-49c6-8363-b378fa32d50c" TYPE="swap" PARTUUID="0b8a0b8a-05"
/dev/sde6: LABEL="Docs_Perso" UUID="ee1da535-b5ba-4188-9a10-d95d43047b01" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="0b8a0b8a-06"
/dev/mapper/VG_Data-LV_VBox: LABEL="VBox" UUID="827a1436-6ac9-47c0-b3a4-59cbfbeba2bf" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/VG_Data-LV_Repository: LABEL="Repository" UUID="7c861700-4888-418b-8b04-492db5f5152a" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/VG_Data-LV_Shared: LABEL="Shared" UUID="85bd9caa-ee01-4813-8395-87f369367716" BLOCK_SIZE="4096" TYPE="ext4"