How to install Grub2 under several common scenarios
Posted
by
Huckle
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Huckle
Published on 2012-10-07T23:13:45Z
Indexed on
2012/10/08
3:48 UTC
Read the original article
Hit count: 877
I feel the community has long needed a clean guide on how to install Grub2 under a a few extremely common scenarios. I will accept answer as solved when it has one section per scenario and assumes nothing other than what is specified. Please add to the existing answer, wiki style, keeping to the original assumptions.
Rules:
1. You cannot, at any point in the answer, invoke Ubiquity (the Ubuntu installer).
2. I strongly recommend not using any automatic boor-repair tools as they're not very educational
Scenario 1: Non-booting Linux OS, No boot partition, Fix from Live CD
Setup:
/dev/sda1is formattedext*/dev/sda2is formattedlinux_swap/dev/sda1doesn't boot because MBR is scrambled and/boot/*was erased
Explain:
- How to boot to a Live CD / USB and restore Grub2 to the MBR and
/bootof/dev/sda1
Scenario 2: Non-booting Linux OS, Boot partition, Fix from Live CD
Setup:
/dev/sda1is formattedfat/dev/sda2is formattedext*/dev/sda3is formattedlinux_swap/dev/sda2doesn't boot because the MBR is scrambled and/dev/sda1was formatted
Explain:
- How to boot to a Live CD / USB and restore Grub2 to the MBR and
/dev/sda1and then update thefstabon/dev/sda2
Scenario 3: Install on to thumb drive, Booting various OSes, From Linux OS
Setup:
/dev/sdbis removable media/dev/sdb1is formattedfat/dev/sdb2is formattedext*/dev/sdb3is formattedfat- The MBR of
/dev/sdbis otherwise not initialized - You are executing from a Linux based OS installed on
/dev/sda
Explain:
- How to install Grub2 on to
/dev/sdb1, mark/dev/sdb1active, be able to chose between/dev/sdb2and/dev/sdb3on boot.
Scenario 4: (Bonus) Install on to thumb drive, Booting ISO, From Linux OS
Setup:
/dev/sdbis removable media/dev/sdb1is formattedfat/dev/sdb1contains/iso/live.iso/dev/sdb2is formattedext*/dev/sdb3is formattedfat- The MBR of
/dev/sdbis otherwise not initialized - You are executing from a Linux based OS installed on
/dev/sda
Explain:
- How to install Grub2 on to
/dev/sdb1, mark/dev/sdb1active, be able to chose between/dev/sdb2,/dev/sdb3, and/iso/live.isoon boot.
© Ask Ubuntu or respective owner