Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to resurrect my (t)rusty 'ol router who's system disk (CF card) had failed (probably because I neglected to tune Ubuntu properly for this type of media), I wanted to use the opportunity to install 12.04 server using BTRFS for the entire CF card. BTRFS can supposedly be better tuned towards flash disks so I figured this would be a good idea. So I swapped the defective CF card with a new one and booted from the 12.04 server CD.

Although the installation went painfully slow ( > 3 hrs), I already read this is a known issue when using BTRFS on flash disks so I did not worry that much.

However, when the setup process was finally at the point where GRUB was going to be installed, I got the following error:

Unable to install GRUB in /dev/sda
Executing 'grub-install /dev/sda' failed.

This is a fatal error.

This is what I saw when I switched back to TTY4:

grub-installer: info: Installing grub on '/dev/sda'
grub-installer: info: grub-install supports --no-floppy
grub-installer: info: Running chroot /target grub-install --no-floppy --force "/dev/sda"
grub-installer: /usr/sbin/grub-setup: warn:
grub-installer: Your core.img is unusually large. It won't fit in the embedding area.
grub-installer: .
grub-installer: /usr/sbin/grub-setup: warn:
grub-installer: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However blocklists are UNRELIABLE and their use is discouraged.
grub-installer: .
grub-installer: /usr/sbin/grub-setup: error:
grub-installer: cannot read '/@/boot/grub/core.img' correctly
grub-installer: .
grub-installer: error: Running 'grub-install --no-floppy --force "/dev/sda"' failed.

I then tried to install GRUB to /dev/sda1 instead, which worked without errors. However, when I now boot the system, I get the infamous 'GRUB Error 17'.

So my obvious question is - how do I fix this? And is this a bug in the installer that I need to report? As you can imagine, I would prefer not to have to spend another 3 hours doing the entire installation again...

Edit: I took a quick look at the size of core.img, and it's 38284 bytes. If I understood correctly, GRUB wants to put this at the very first position on the disk, where a tiny amount of space should be available before the first partition. In my case this space is, if I interpreted the data of 'fdisk -l /dev/sda' correctly, only 63 x 512 = 32256 bytes in size... no wonder GRUB complains about core.img not fitting in!

But how can it be core.img is this large? Is it because of BTRFS? For example, the core.img of my laptop is only 26052 bytes (and it's not using BTRFS). How do I get it to fit, besides reformatting to something else than BTRFS?

Edit 2: Feeling courageous, I used gparted to move sda1 a little 'to the right', to enlarge the space before the first partition. After this, I booted the 12.04 server CD in resque + expert mode and tried to install GRUB again. This time I got a different error:

grub-installer: /usr/sbin/grub-probe: error:
grub-installer: cannot find a device for /boot/grub (is /dev mounted?)
grub-installer: .
grub-installer: error: Running 'grub-install --no-floppy --force "/dev/sda"' failed.

Now what?

share|improve this question

closed as off-topic by Braiam, Radu Rădeanu, waltinator, Eric Carvalho, Warren Hill May 7 '14 at 12:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This describes a problem that can't be reproduced that seemingly went away on its own or was only relevant to a very specific period of time. It's off-topic as it's unlikely to help future readers." – Braiam, Radu Rădeanu, waltinator, Eric Carvalho, Warren Hill
If this question can be reworded to fit the rules in the help center, please edit the question.

The current “optimum” offset for the first partition is 2048 sectors or 1 Mebibyte. How precisely are you trying to install GRUB from the CD? Can you use the bootloader on the CD, for example, to boot the installed system, then try to reinstall GRUB from it? – mirabilos Dec 6 '13 at 15:13
mirabilos, thanks for commenting. It's been well over a year since I ran into this problem. I'm not entirely sure how I eventually fixed the problem, but seeing that the system now uses ext2 I figure I gave up in the end and re-installed the whole thing using ext2 instead of btrfs. – iGadget Dec 10 '13 at 11:01

grub+btrfs module is too big for the free space in your MBR, see bug #1059827 - "Non trivial grub2 installs no longer fit in small embed areas".

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.