grub-devel
[Top][All Lists]
Advanced

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

Re: grub core size


From: Felix Zielcke
Subject: Re: grub core size
Date: Tue, 22 Sep 2009 20:47:59 +0200

Am Dienstag, den 22.09.2009, 19:41 +0100 schrieb James Courtier-Dutton:
> Hi,
> 
> I am using grub 2.
> The stage 1 bit of grub, that stores itself in the partition table and
> the following sectors, seems to be quite large.
> I have a HP server system that only has 32 512-bytes sectors free
> before the first partition but the grub core does not fit in there. It
> seems to need more like 64 512-byte sectors.
> 
> Why does grub need so much space on that part of the hard disk ?
> My /boot/grub has been installed on an ext2 partition.
> 
> How difficult would it be to fit the stage 1 into 16384 bytes?
> USB sticks sometimes have similar problems.
> 
> How about two versions of the grub core, one that requires the rest of
> grub to be on an ext2/3 partition, and a larger one that can handle
> other options, e.g. lvm etc.
> Obviously, it is only worth trying that if the ext2 one can get into
> 16384 bytes or 32 sectors.
> 

The stage1 equivalent from GRUB Legacy in GRUB 2 would be boot.img which
is 512 bytes big.
What you probable mean is the size of core.img which usually gets embed
between MBR and first partition, like stage1_5 from GRUB Legacy.
core.img only contains the stuff which is needed to access your /boot
and is created in the grub-install script with the grub-mkimage line.
Just run it with `sh -x grub-install /dev/sda' and you see what modules
get included.
Well not all kernel.img gets also included and all necessary
dependencies of the modules.
And core.img is also compressed with LZMA to make it smaller.
The problem of the size is the actual code.
GRUB 2's kernel.img is for me 31K
You can get it smaller if you remove the rescue mode and other stuff you
personally don't need, but that's not a generic solution.


-- 
Felix Zielcke
Proud Debian Maintainer





reply via email to

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