|
|
(20 intermediate revisions by 5 users not shown) |
Line 1: |
Line 1: |
| = Grub2 =
| | #REDIRECT [[GRUB 2]] |
| | |
| Starting with Fedora 16, grub2 is used for new installs (upgrades still keep grub1).
| |
| | |
| = Tasks / Common issues =
| |
| | |
| == Adding Other operating systems to the grub2 menu ==
| |
| | |
| If you have other operating systems setup and wish to boot them via grub2:
| |
| | |
| <pre>
| |
| # yum install os-prober | |
| | |
| # grub2-mkconfig -o /boot/grub2/grub.cfg
| |
| </pre>
| |
| | |
| | |
| == Setting default entry ==
| |
| | |
| 1. edit /boot/grub2/grub.cfg, and change the line
| |
| | |
| <pre>
| |
| set default="0"
| |
| </pre>
| |
| | |
| to
| |
| <pre>
| |
| set default="5"
| |
| </pre>
| |
| | |
| == Encountering the dreaded Grub2 boot prompt ==
| |
| You would swear that drive should boot and everything is ok, but then you see the Grub2 Command Prompt what to do and how to recover
| |
| | |
| 1. List the drives which Grub2 saw
| |
| <pre>
| |
| grub2> ls
| |
| </pre>
| |
| | |
| 2. The output for a dos partition table /dev/sda with three partitons will look something like | |
| <pre>
| |
| (hd0) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
| |
| </pre>
| |
| | |
| 3. While the output for a gpt partition table /dev/sda with four partitions will look something like
| |
| <pre>
| |
| (hd0) (hd0,gpt4) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)
| |
| </pre>
| |
| | |
| 4. With this information you can now interrogate each partition of the drive and locate your vmlinuz and initramfs files
| |
| <pre>
| |
| ls (hd0,1)/
| |
| </pre>
| |
| Would list the files on /dev/sda1 and if it was the /boot would give you the full name of vmlnuz and initramfs
| |
| | |
| 5. Armed with the location and full name of vmlinuz and initramfs you can "bootstrap" boot your system
| |
| | |
| 5a. Declare your root partition first
| |
| <pre>
| |
| grub> set root=(hd0,3)
| |
| </pre>
| |
| | |
| 5b. Declare the kernel you want used
| |
| <pre>
| |
| grub> linux (hd0,1)/vmlinuz-3.0.0-1.fc16.i686 root=/dev/sda3 rhgb quiet selinux=0
| |
| # NOTE : add other kernel args if you have need of them
| |
| # NOTE : change the numbers to match your system
| |
| </pre>
| |
| | |
| 5c. Declare the initrd to use
| |
| <pre>
| |
| grub> initrd (hd0,1)/initramfs-3.0.0-1.fc16.i686.img
| |
| # NOTE : change the numbers to match your system
| |
| </pre>
| |
| | |
| 5d. Instruct Grub2 to now please boot the chosen files
| |
| <pre>
| |
| grub> boot
| |
| </pre>
| |
| | |
| 6. Now when your system boots open a terminal
| |
| | |
| 7. Issue the grub2-mkconfig command to re-create the grub.cfg file grub2 needed to boot your system
| |
| <pre>
| |
| grub2-mkconfig -o /boot/grub2/grub.cfg
| |
| </pre>
| |
| | |
| 8. Issue the grub2-install command to install grub2 to your hard drive and make use of your config
| |
| <pre>
| |
| grub2-install --boot-directory=/boot /dev/sda
| |
| # Note: your drive may have another device name check for it with mount command output
| |
| </pre>
| |
| | |
| == Other issues ==
| |
| | |
| '''Other grub2 issues''': it refuses to install on partition's boot sector (maybe can be forced?) and, !!! this is important !!!, it fails to install if for whatever reason your floppy controller is activated in BIOS and there's no drive connected or floppy disk inserted. The workaround is to run (post OS install) from rescue mode:
| |
| | |
| <pre>
| |
| grub2-install <target device> --no-floppy
| |
| </pre>
| |
| | |
| = Further Reading =
| |
| | |
| http://www.gnu.org/software/grub/manual/grub.html
| |
| | |
| http://fedoraproject.org/wiki/Features/Grub2
| |
| | |
| http://fedoraproject.org/wiki/Anaconda/Features/Grub2Migration
| |