help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Embedding core.img in an empty partition


From: Damien Robert
Subject: Embedding core.img in an empty partition
Date: Wed, 1 Aug 2012 02:40:50 -0700
User-agent: Mutt/1.5.20 (2009-06-14)

Hi all!

I have my /boot partition inside lvm and an old partition scheme where sda1
starts at the 63 sector. The newer version of grub2 with more reliable lvm
code management generates a core.img than does not fit in the 32ko gap
between the MBR and the first partition.

This is a well known problem, and the recommended solution is either to use
block list or to move around partitions. However I happen to have 2MO bits
of unused space at the end of the disk.

So what I would like to do is dd the core.img inside this space, and modify
boot.img to make it reads the sectors where I have put core.img rather than
sector 2. (Alternatively keep the original boot.img and put a lightweight
core.img in sectors 2-63 that read the true core.img at the end of the
disk).

With a gpt partition scheme, this is actually the recommended method: to
make a specific empty partition where core.img will be embedded, so my hope
is that there is a way to produce a boot.img that reads core.img at the end
of the disk rather than at sector 2 also for MBR installations.

With grub1, this would have been possible with the following command:
install (hd0,0)/boot/stage1 (hd0) (hd0)<stage2_sector>+<stage2_size> 0x8000 
(hd0,0)/grub.conf
Is there a way to do the same with grub2? (Yet another way to look at it
would be to use a blocklist, but controlling all the core.img blocks so
that they are put in the empty partition,  so there is no problem with
using blocklist since the blocks won't be moved).

Thanks in advance!

PS: by the way is there a way to ask for grub to test if the core.img will
fit in the embedding gap before it tries to install it? (other than the
cumbersome process of generating the core.img first, checking the size by
hand, then installing it manually)? Because as it is done now, it overwrote
my old core.img but could not fit the full new core.img, so I got an
unbootable system.

For the story I did that while at an airport while waiting for a flight to
give a talk at a conference, which was not the brightest idea :-) Luckily I
had a USB live key and still the older grub1.99 version in cache so I
managed to downgrade grub2 and come back to the old lvm code which gives a
core.img that fit in the 32k MBR gap, but still it would be nice if I could
upgrade to the newer version of grub2!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]