Grub2
From Do you speak Drupalish? Featured Drupal wiki-like documentation
Contents
Info
- grub2- and tab to get all options
anaconda
- Find disk summary and bootloader
- Even ubuntu recommends only https://help.ubuntu.com/community/Grub2/Installing sda master boot
Boths disks
- from rescue mode
grub2-install --force /dev/sda4 https://www.centos.org/forums/viewtopic.php?f=48&t=53035don't try on partition, but full disk mbr
To install GRUB2 to the MBR: grub2-install /dev/sda Installing for i386-pc platform. Installation finished. No error reported. [root@localhost default]# grub2-install /dev/sdb Installing for i386-pc platform. Installation finished. No error reported. [root@localhost default]# grub2-install /dev/sdc Installing for i386-pc platform. Installation finished. No error reported. [root@localhost default]#
- http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
- I need to have those disks bootable - all of them ! https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1065987
- To install GRUB2 to a partition (not recommended):
- root #grub2-install /dev/sda1 via https://wiki.gentoo.org/wiki/GRUB2_Quick_Start
Installation finished. No error reported.
- This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running sudo update-grub after the install will ensure GRUB 2's menu is up-to-date.'' via https://help.ubuntu.com/community/Grub2/Installing
check grub2 is installed on all disks
dd bs=512 count=1 if=/dev/sda 2>/dev/null | strings dd bs=512 count=1 if=/dev/sdb 2>/dev/null | strings
- Disclaimer
- dd command is extremely dangerous . Should be used with caution . Use it at your own risk. Below command uses dd, is tested by me, and will not harm your system. Do not change the format of the command , the only thing you can change are the letters of the device eg: /dev/sda , /dev/sdb, /dev/sdc ...etc
- You can examine the first 512 bytes of the device with dd command through strings via http://askubuntu.com/questions/205273/how-to-find-out-where-the-grub-is-installed
For /dev/sda sudo dd bs=512 count=1 if=/dev/sda 2>/dev/null | strings The results in my device ZRr= `|f \|f1 GRUB Geom Hard Disk Read Error as you can see , GRUB is there.
- We see /dev/hda with * that shows that it's the bootable disk. http://help.ovh.com/RescueMode#link8
errors
grub2-install: warning: File system ‘ext2’ doesn't support embedding. grub2-install: error: embedding is not possible, but this is required for RAID and LVM install.
- You are getting the warning because you are installing grub to a partition instead of the MBR. This means grub can not be embedded in the unused space between the MBR and the first partition. Instead it has to have the list of blocks that /boot/grub/core.img resides in placed into the MBR. This setup is subject to being broken by things like defrag and so is not recommended, hence the warning. Since it is only a warning, you can ignore it. http://unix.stackexchange.com/questions/174206/warning-file-system-ext2-doesnt-support-embedding-but-my-system-isnt-emb
Manual configuration
- https://wiki.gentoo.org/wiki/GRUB2_Quick_Start#Manual_configuration
Users do not need to use grub2-mkconfig. The grub.cfg file can be edited manually as well.The main Grub 2 configuration file, normally located in the /boot/grub folder, is grub.cfg. It is the product of various scripts and should not normally be edited directly. https://help.ubuntu.com/community/Grub2
uname -r\
- check booting
- grub2-set-default "Red Hat Enterprise Linux Server (3.10.0-327.10.1.el7.x86_64) 7.2 (Maipo)"
from vi /boot/grub2/grub.cfg
- grub2-mkconfig -o /boot/grub2/grub.cfg
during boot
See also
- https://www.linux.com/learn/tutorials/776643-how-to-rescue-a-non-booting-grub-2-on-linux/
- https://wiki.centos.org/HowTos/Grub2
- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Making_Persistent_Changes_to_a_GRUB_2_Menu_Using_the_grubby_Tool.html
- Installed grub2 manually on a partition more
- In CentOS 7, things have changed a bit. When grub2 is installed on a GPT drive it requires an additional "bios_grub" partition.
- https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Terminal_Menu_Editing_During_Boot.html#sec-Booting_to_Rescue_Mode