Wednesday, May 30, 2012

Ubuntu 12.04: install Grub2 on a separated partition, not MBR

I am not talking about repairing Grub2 inside Ubuntu 12.04, I am talking about install Grub2 on a separated partition, not on Master Boot Record (MBR). The command line is simple, but not like what I used before:


option 1, not work:

testuser@pc:~$ sudo grub-install /dev/sda1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: will not proceed with blocklists.


option 2, not work:

testuser@pc:~$ sudo mount /dev/sda1 /mnt
testuser@pc:~$ sudo grub-install --boot-directory=/mnt/boot /dev/sda1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: will not proceed with blocklists.


option 3, not work:

testuser@pc:~$ sudo mount /dev/sda1 /mnt
testuser@pc:~$ sudo grub-install --force --boot-directory=/mnt/boot /dev/sda1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-setup: error: cannot read `/mnt/boot/grub/core.img' correctly.

option 4, works!

testuser@pc:~$ sudo grub-install --force /dev/sda1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea..
/usr/sbin/grub-setup: warn: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.

3 comments:

  1. However, blocklists are UNRELIABLE and their use is discouraged !!!
    I do sudo grub-install --force /dev/sdax since 2005 with GAG
    I'm doing this since 2005 without problem
    cordially

    ReplyDelete
  2. Hello Cheng, I have just loaded Ubuntu 12.04 o the same disk as Win 7. It immediately installed Grub2 on the MBR.
    Then I just used your solution and it immediately installed on a different partition. Good. Then I put back Win 7 on the MBR via bootrec /fixmbr. But after reboot Grub2 was again installed on the MBR!
    I want to put Windows bootloader back on the MBR. Please give me the solution.
    Thanks!

    ReplyDelete
    Replies
    1. That's the problem of Win 7. You can find many useful blogs of how to dual boot Win7 and Ubuntu 12.04.

      Delete