Bug#561294: core.img is unusually large, grub-pc fails to install grub mbr
Thomas Fjellstrom
tfjellstrom at shaw.ca
Fri Dec 18 20:35:15 UTC 2009
On Fri December 18 2009, Felix Zielcke wrote:
> Am Donnerstag, den 17.12.2009, 14:30 -0700 schrieb Thomas Fjellstrom:
> > On Fri December 18 2009, Miguel Landaeta wrote:
> > > On Fri, Dec 18, 2009 at 4:08 PM, Thomas Fjellstrom
> >
> > <tfjellstrom at shaw.ca>
> >
> > wrote:
> > > > My core.img file is 31.13KB in size. Also the auto generated
> >
> > grub.conf
> >
> > > > seems to include a "raid" module that probably isn't needed? (it
> >
> > also
> >
> > > > includes mdraid and lvm) Is there a way I can remove it?
> > > >
> > > > And as I mentioned, I asked about this in the #grub channel on
> > > > irc.freenode.net and they seemed to hint at the fact that debian's
> >
> > grub
> >
> > > > package is known to make the driver modules larger in size that
> >
> > stock
> >
> > > > grub does.
> > >
> > > Ok, my core.img file was ~50KB so I had to repartition.
> > >
> > > In your case, you could use grub-mkimage to generate a new core.img,
> > > remove some unused modules and see if you image can fit.
> >
> > I'm not sure how to do that. I've run grub-mkimage and overwrote
> > core.img
> > which gets me to a 20KB file, and grub-install overwrites it with a
> > larger
> > 31KB file. Changing grub.cfg is impossible as update-grub overwrites
> > that
> > every time. I can't see a reliable way of configuring grub2.
>
> grub-install should only use the modules for core.img which are required
> to access /boot/grub.
> You can see the list with something like
> bash -x grub-install /dev/sda 2>&1 ¦ grep core.img
>
unexpectedly, this is what I get from that:
# bash -x grub-install /dev/sdf 2>&1 ¦ grep core.img
+ transform=s,x,x,
+ prefix=/usr
+ exec_prefix=/usr
+ sbindir=/usr/sbin
+ bindir=/usr/bin
+ libdir=/usr/lib
+ PACKAGE_NAME=GRUB
+ PACKAGE_TARNAME=grub
+ PACKAGE_VERSION=1.97+experimental
+ target_cpu=i386
+ platform=pc
+ font=/usr/share/grub/ascii.pf2
++ echo grub/i386-pc
++ sed s,x,x,
+ pkglibdir=/usr/lib/grub/i386-pc
++ echo grub-setup
++ sed s,x,x,
+ grub_setup=/usr/sbin/grub-setup
+ '[' i386-pc = i386-pc ']'
++ echo grub-mkimage
++ sed s,x,x,
+ grub_mkimage=/usr/bin/grub-mkimage
++ echo grub-mkdevicemap
++ sed s,x,x,
+ grub_mkdevicemap=/usr/sbin/grub-mkdevicemap
++ echo grub-probe
++ sed s,x,x,
+ grub_probe=/usr/sbin/grub-probe
++ echo grub-editenv
++ sed s,x,x,
+ grub_editenv=/usr/bin/grub-editenv
+ rootdir=
++ echo /boot/grub
++ sed s,x,x,
+ grub_prefix=/boot/grub
+ modules=
+ install_device=
+ no_floppy=
+ force_lba=
+ recheck=no
+ debug=no
+ '[' i386-pc = i386-pc ']'
+ disk_module=biosdisk
+ for option in '"$@"'
+ case "$option" in
+ test x '!=' x
+ install_device=/dev/sdf
+ for option in '"$@"'
+ case "$option" in
+ test x/dev/sdf '!=' x
+ echo 'More than one install_devices?'
More than one install_devices?
+ usage
+ cat
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.
-h, --help print this message and exit
-v, --version print the version information and exit
--modules=MODULES pre-load specified modules MODULES
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-setup=FILE use FILE as grub-setup
--grub-mkimage=FILE use FILE as grub-mkimage
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
--grub-probe=FILE use FILE as grub-probe
--no-floppy do not probe any floppy drive
--recheck probe a device map even if it already exists
--force install even if problems are detected
+ '[' i386-pc = i386-pc ']'
+ cat
--disk-module=MODULE disk module to use
+ '[' i386-pc = mips-yeeloong ']'
+ cat
INSTALL_DEVICE can be a GRUB device name or a system device filename.
grub-install copies GRUB images into the DIR/boot directory specified by
--root-directory, and uses grub-setup to install grub into the boot
sector.
Report bugs to <bug-grub at gnu.org>.
+ exit 1
Where as a plain:
# grub-install /dev/sdf
gives just:
/usr/sbin/grub-setup: warn: Your core.img is unusually large. It won't fit
in the embedding area.
/usr/sbin/grub-setup: error: Embedding is not possible, but this is required
when the root device is on a RAID array or LVM volume.
What is making grub-install think it needs to print out the help message
when run through bash -x ? And why isn't the 2>&1 working as it should?
--
Thomas Fjellstrom
tfjellstrom at shaw.ca
More information about the Pkg-grub-devel
mailing list