Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello lq world. I would really like some help to sort some things out. My current goal is configuring the dedicated -OS indipendent- grub partition to chainload 3 linux and 1 windows OS. Before I begin shooting questions, here is all the important information :
============================= Boot Info Summary: ===============================
=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
the same hard drive for core.img. core.img is at this location and looks
in partition 80 for .
sda1: __________________________________________________________________________
File system: vfat
Boot sector type: Grub2 (v1.99)
Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda1
and looks at sector 80227016 of the same hard drive
for core.img. core.img is at this location and looks
in partition 80 for . No errors found in the Boot
Parameter Block.
Operating System:
Boot files: /boot/grub/grub.cfg
sda2: __________________________________________________________________________
File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
sda3: __________________________________________________________________________
File system: Extended Partition
Boot sector type: -
Boot sector info:
sda5: __________________________________________________________________________
File system: swap
Boot sector type: -
Boot sector info:
sda6: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System: Arch Linux ()
Boot files: /boot/grub/grub.cfg /etc/fstab
sda7: __________________________________________________________________________
File system: ext4
Boot sector type: Grub2 (v1.99)
Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda7
and looks at sector 127071512 of the same hard drive
for core.img. core.img is at this location and looks
in partition 130 for .
Operating System: Kali GNU/Linux Rolling
Boot files: /boot/grub/grub.cfg /etc/fstab
sda8: __________________________________________________________________________
File system: ext4
Boot sector type: -
Boot sector info:
Operating System:
Boot files:
sda9: __________________________________________________________________________
File system: ntfs
Boot sector type: Unknown
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files:
Code:
=========================== sda1/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -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="0"
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='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos6' --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
else
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
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/10_linux ###
menuentry 'Arch Linux' {
insmod part_msdos
insmod ext2
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
configfile /boot/grub/grub.cfg
}
menuentry "Kali" {
insmod part_msdos
insmod ext2
insmod chain
set root=(hd0,7)
chainloader +1
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### 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.
### 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:
=========================== sda6/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -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="0"
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='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos6' --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
else
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
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/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-98d05dfa-db15-4f1d-aaa9-f7d391ab89c2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos6' --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
else
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=98d05dfa-db15-4f1d-aaa9-f7d391ab89c2 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/amd-ucode.img /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-98d05dfa-db15-4f1d-aaa9-f7d391ab89c2' {
menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-98d05dfa-db15-4f1d-aaa9-f7d391ab89c2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos6' --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
else
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=98d05dfa-db15-4f1d-aaa9-f7d391ab89c2 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/amd-ucode.img /boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-98d05dfa-db15-4f1d-aaa9-f7d391ab89c2' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos6'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos6' --hint-bios=hd0,msdos6 --hint-efi=hd0,msdos6 --hint-baremetal=ahci0,msdos6 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
else
search --no-floppy --fs-uuid --set=root 98d05dfa-db15-4f1d-aaa9-f7d391ab89c2
fi
echo 'Loading Linux linux ...'
linux /boot/vmlinuz-linux root=UUID=98d05dfa-db15-4f1d-aaa9-f7d391ab89c2 rw quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux-fallback.img
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### 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.
### 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:
=========================== sda7/boot/grub/grub.cfg: ===========================
--------------------------------------------------------------------------------
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
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="0"
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='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f28e4012-1dff-418e-9804-917831dc7dce
else
search --no-floppy --fs-uuid --set=root f28e4012-1dff-418e-9804-917831dc7dce
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
set timeout=30
else
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=-1
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=-1
fi
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/05_debian_theme ###
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f28e4012-1dff-418e-9804-917831dc7dce
else
search --no-floppy --fs-uuid --set=root f28e4012-1dff-418e-9804-917831dc7dce
fi
insmod png
if background_image /usr/share/desktop-base/kali-theme/grub/grub-4x3.png; then
set color_normal=white/black
set color_highlight=black/white
else
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###
### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Kali GNU/Linux' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f28e4012-1dff-418e-9804-917831dc7dce' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f28e4012-1dff-418e-9804-917831dc7dce
else
search --no-floppy --fs-uuid --set=root f28e4012-1dff-418e-9804-917831dc7dce
fi
echo 'Loading Linux 4.18.0-kali2-amd64 ...'
linux /boot/vmlinuz-4.18.0-kali2-amd64 root=UUID=f28e4012-1dff-418e-9804-917831dc7dce ro initrd=/install/initrd.gz
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-kali2-amd64
}
submenu 'Advanced options for Kali GNU/Linux' $menuentry_id_option 'gnulinux-advanced-f28e4012-1dff-418e-9804-917831dc7dce' {
menuentry 'Kali GNU/Linux, with Linux 4.18.0-kali2-amd64' --class kali --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.18.0-kali2-amd64-advanced-f28e4012-1dff-418e-9804-917831dc7dce' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_msdos
insmod ext2
set root='hd0,msdos7'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos7 --hint-efi=hd0,msdos7 --hint-baremetal=ahci0,msdos7 f28e4012-1dff-418e-9804-917831dc7dce
else
search --no-floppy --fs-uuid --set=root f28e4012-1dff-418e-9804-917831dc7dce
fi
echo 'Loading Linux 4.18.0-kali2-amd64 ...'
linux /boot/vmlinuz-4.18.0-kali2-amd64 root=UUID=f28e4012-1dff-418e-9804-917831dc7dce ro initrd=/install/initrd.gz
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-4.18.0-kali2-amd64
}
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
### 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.
### 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 ###
As you see, I implement a configfile boot method to get into Arch as I was getting an 'invalid signature' error. In my journey the lesson I learned was that you cannot chainload if you have no Volume Boot Record. I cannot remember how I messed the grub installation in Arch, I was under the impression that everything was done, especially since everything is in it. So now all I have to do is install grub inside every root partition of any linux to implement a chainload method right? I proceeded with this in my mind so I pointed Kali to install grub into /dev/sda7 during the installation. Then with some trial and error I chainloaded grub and now it works! Next step was reconfiguring Kali's grub to get rid of the double entries in my submenu as Arch had its own. Accomplished implementing GRUB_DISABLE_OS_PROBER=true in /etc/default/grub. Now my menu is cleaner.
Question #1:Why does MBR look at partition 80 for core.img? What partition is this? Question #2:What is the best method to install grub in Arch and how do I install an already preconfigured version so that I will not have to manually edit again to get rid of prober,etc? Question #3:How can I read the contents of MBR's grub? Question #4:GRUB master is defaulting a 5 second delay. All I have inside the grub partition is grub.cfg,its modules,fonts,grubenv,locale and themes so there is no /etc/default settings to play with. Can I just remove all the code and add default grub settings functionality with custom entries inside it? How about theming it? Question #5:Supposing all is set, I will install Windows 7 at some point. What I know for sure is that I will lose MBR. Will a simple reinstall in /dev/sda from a live cd begin to point sda1 to bring it back to life? Then I assume all I have to do is chainload windows from sda1 and all is done, right? (Windows won't have the 100mb preserved partition as I always omit it.)
I am sorry for the long post and thank you in advance.
Question #1:Why does MBR look at partition 80 for core.img? What partition is this? Question #2:What is the best method to install grub in Arch and how do I install an already preconfigured version so that I will not have to manually edit again to get rid of prober,etc? Question #3:How can I read the contents of MBR's grub? Question #4:GRUB master is defaulting a 5 second delay. All I have inside the grub partition is grub.cfg,its modules,fonts,grubenv,locale and themes so there is no /etc/default settings to play with. Can I just remove all the code and add default grub settings functionality with custom entries inside it? How about theming it? Question #5:Supposing all is set, I will install Windows 7 at some point. What I know for sure is that I will lose MBR. Will a simple reinstall in /dev/sda from a live cd begin to point sda1 to bring it back to life? Then I assume all I have to do is chainload windows from sda1 and all is done, right? (Windows won't have the 100mb preserved partition as I always omit it.)
#5: You don't have to "lose MBR" if you don't depend on it in the first place. With Windows compatible boot code on MBR, the only disruption installing Windows will produce is a move of the boot flag that signals generic boot code which partition to jump to. That flag is easily relocated regardless what is currently booted. It's how I've been multibooting more than 2.5 decades.
#4: Have you considered placing a custom menu on your Grub master and loading kernels and initrds directly? All my kernels and initrds have symlinks, so the custom menu on the master Grub infrequently needs any updating. Chainloading from it here represents fallback modes, such as for using previous kernels. I update the symlinks manually at kernel update time for distros that don't provide them automatically. Automatically generated Grub stanzas are very rarely used here, whether with MBR (self-maintained menu.lst on sda[1,2,3]) or UEFI (custom.cfg on ESP).
#3: What do you mean by "read"?
#2: "Best" is subjective. Here, each distro gets it's bootloader limited to its / partition and os-prober disabled. Installers that don't provide either that option or an option for no bootloader at all get aborted. More I defer to others, since I've never used Arch.
#1: 80 represents the primary partition with the boot flag set. The MBR is a very small space. What grub can do with it is limited to locating code that enables proceeding further, which core.img contains.
Question #2:What is the best method to install grub in Arch and how do I install an already preconfigured version so that I will not have to manually edit again to get rid of prober,etc?
Perhaps the best way is to chroot into arch and install grub2 there with your current grub tools. Preconfigured version? Grub2 uses /etc/grub.d scripts. You could copy these and/or modify them as you wish to create the basis of your grub2 config.
Quote:
Originally Posted by gr00t
Question #4:GRUB master is defaulting a 5 second delay. All I have inside the grub partition is grub.cfg,its modules,fonts,grubenv,locale and themes so there is no /etc/default settings to play with. Can I just remove all the code and add default grub settings functionality with custom entries inside it? How about theming it?
Those settings are in the same place. Personally I can't stand grub2, especially after learning how to use it properly. I could advise you to use grub legacy as an easier solution to resolve what you want to do, and with a way easier way to configure and fix your grub if something goes wrong. And much better to use as a chainloader to 3 other grub's and 1x windows bootloader.
Quote:
Originally Posted by gr00t
Question #5:Supposing all is set, I will install Windows 7 at some point. What I know for sure is that I will lose MBR. Will a simple reinstall in /dev/sda from a live cd begin to point sda1 to bring it back to life? Then I assume all I have to do is chainload windows from sda1 and all is done, right? (Windows won't have the 100mb preserved partition as I always omit it.)
#5: You don't have to "lose MBR" if you don't depend on it in the first place. With Windows compatible boot code on MBR, the only disruption installing Windows will produce is a move of the boot flag that signals generic boot code which partition to jump to. That flag is easily relocated regardless what is currently booted. It's how I've been multibooting more than 2.5 decades.
So what you're saying is that Windows won't replace the current MBR boot code when installed but only move the flag bit and point to its own partition.
Quote:
Originally Posted by mrmazda
#4: Have you considered placing a custom menu on your Grub master and loading kernels and initrds directly? All my kernels and initrds have symlinks, so the custom menu on the master Grub infrequently needs any updating. Chainloading from it here represents fallback modes, such as for using previous kernels. I update the symlinks manually at kernel update time for distros that don't provide them automatically. Automatically generated Grub stanzas are very rarely used here, whether with MBR (self-maintained menu.lst on sda[1,2,3]) or UEFI (custom.cfg on ESP).
Of course I have considered a custom menu but direct booting is what I don't want to implement. I would probably have it setup already if I used this method as it is much more straightforward. I will most likely handle older kernels with submenus. To make this question more clear, is there a place where I can find how GRUB keys used by grub-mkconfig are translated? For example, 'GRUB_DEFAULT_TIMEOUT' can be translated to 'set timeout=x'. Here is an alpha version of the custom master grub:
Code:
## ========== MASTER GRUB CFG ========== ##
### DEVICE NAME CONVERSIONS ###
#
# Linux GRUB
#------------------------------
# /dev/fd0 (fd0)
# /dev/sda (hd0)
# /dev/sdb2 (hd1,2)
### MENU TIMEOUT ###
set timeout=60
### DEFAULT BOOT ENTRY ###
set default=1
### BEGIN MENU SETUP ###
font='/boot/grub/fonts/unicode.pf2'
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
# set locale_dir=/boot/grub/locale
# set lang=en_US
# insmod gettext
fi
terminal_output gfxterm
### Background ###
insmod png
background_image /boot/image.png
set menu_color_normal=white/black
set menu_color_highlight=black/white
set gfxpayload=1366x768
### END MENU SETUP ###
### ENTRY LIST ###
# Menu Entry Number ---> 0
menuentry "Windows" {
insmod ntfs
insmod chain
set root=(hd0,2)
chainloader +1
}
# Menu Entry Number ---> 1
menuentry "Arch" {
insmod ext2
insmod chain
set root=(hd0,6)
chainloader +1
}
# Menu Entry Number ---> 2
menuentry "Kali" {
insmod ext2
insmod chain
set root=(hd0,7)
chainloader +1
}
# Menu Entry Number ---> 3
menuentry "Bunsenlabs" {
insmod ext2
insmod chain
set root=(hd0,8)
chainloader +1
}
I'm still searching and reading .cfg codes and try to understand what is going on and what code I can omit so that I can have a very clear and fully functional cfg master. Is it possible to theme it using themes.txt like this one even though there is no grub-mkconfig to generate?
Quote:
Originally Posted by mrmazda
#3: What do you mean by "read"?
Nevermind this, my brain farted when I was posting and somehow I thought I also had grub inside MBR to read from. Heck, I even started from reading what MBR is, what its contents are and how the boot process works. On further analysis, I found this which shows how to decrypt and read MBR record.
Quote:
Originally Posted by zeebra
Perhaps the best way is to chroot into arch and install grub2 there with your current grub tools. Preconfigured version? Grub2 uses /etc/grub.d scripts. You could copy these and/or modify them as you wish to create the basis of your grub2 config.
Avoiding configuring grub.d scripts was that question all about. If I copy the preconfigured scripts from Kali and move them to Arch will it properly generate stuff? Can we at this point say that scripts can be used universally and are not bound to anything except grub-mkconfig itself?
Quote:
Originally Posted by zeebra
Those settings are in the same place. Personally I can't stand grub2, especially after learning how to use it properly. I could advise you to use grub legacy as an easier solution to resolve what you want to do, and with a way easier way to configure and fix your grub if something goes wrong. And much better to use as a chainloader to 3 other grub's and 1x windows bootloader.
It's funny because well, I didn't wake up one day and said "GRUB2 CHAINLOAD, I CHOOSE YOUUUU!". I was actually inspired by saikee, a guy from justlinux forums who used GRUB LEGACY to boot 145+ operating systems. I already know that if I went the legacy way it would be easier. I also never took it well when grub2 started being used. Yes, I was there before GRUB2 took over. But one has to overcome and adapt since legacy is left behind to rot in a dark forest. What convinced me is this:
GRUB 2 is available for several other types of system in addition to the PC BIOS systems supported by GRUB Legacy: PC EFI, PC coreboot, PowerPC, SPARC, and MIPS Lemote Yeeloong are all supported.
Many more file systems are supported, including but not limited to ext4, HFS+, and NTFS.
GRUB 2 can read files directly from LVM and RAID devices.
After all, gaining the knowledge of GRUB2 benefits me (and others apparently) in the future. Right now I'm left with this laptop but my future PC will be EFI capable, I plan on using encrypted partitions, ..
Question #4:GRUB master is defaulting a 5 second delay. All I have inside the grub partition is grub.cfg,its modules,fonts,grubenv,locale and themes so there is no /etc/default settings to play with
If no disto will make changes to the grub.cfg, then edit it directly. editing the grub.cfg directly becomes an issue whenever update-grub/grub-mkconfig is ran either manually or by an update as it will overwrite any edits that are done to grub.cfg.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.