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: 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: 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: 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: 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.