FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-08-2011, 10:36 PM
walt
 
Default A tiny titillating taste of grub2

About three years ago I spent a lot of time on the grub2 mailing list,
building grub2 from their svn repo, even submitting a patch or two to
get it working for the *BSD family.

Then I got old and tired and I settled on gentoo. I deleted all the
other OS's from my machines, including (especially) Windows -- so I no
longer need to multiboot five different OS's -- and so I lost interest
in the sexy new features of grub2.

Lately, though, I've been using multiple USB sticks, and having them
plugged in at boot-time can confuse legacy grub into booting from the
wrong disk, i.e. not booting at all. Very annoying.

So, I installed grub-1.98 and I've found that it *does* find partitions
by UUID, and even by LABEL, amongst multiple disks. Very nifty.

Not so fast, though. I don't know how to write a grub.conf file that
can tell grub2 how to do that automatically so I don't need to type
commands at the interactive grub2 command prompt.

That's where you testosterone-pumped youngsters (Dale? Volker? Alan?
Neil? Anyone?) can help fix this basically silly problem.

grub2 is enough different from legacy grub to make the learning curve
very steep -- but I'm only about half-way up the curve and I'm fading
fast. (I usually unplug the offending USB stick and reboot

If anyone here is interested enough to spend some real time and effort
on grub2, I can offer a few pointers, but I'm not willing to do the real
grunt work myself.

Hm, sunset. Off to bed
 
Old 01-08-2011, 11:24 PM
Volker Armin Hemmann
 
Default A tiny titillating taste of grub2

On Saturday 08 January 2011 15:36:49 walt wrote:
> About three years ago I spent a lot of time on the grub2 mailing list,
> building grub2 from their svn repo, even submitting a patch or two to
> get it working for the *BSD family.
>
> Then I got old and tired and I settled on gentoo. I deleted all the
> other OS's from my machines, including (especially) Windows -- so I no
> longer need to multiboot five different OS's -- and so I lost interest
> in the sexy new features of grub2.
>
> Lately, though, I've been using multiple USB sticks, and having them
> plugged in at boot-time can confuse legacy grub into booting from the
> wrong disk, i.e. not booting at all. Very annoying.
>
> So, I installed grub-1.98 and I've found that it *does* find partitions
> by UUID, and even by LABEL, amongst multiple disks. Very nifty.
>
> Not so fast, though. I don't know how to write a grub.conf file that
> can tell grub2 how to do that automatically so I don't need to type
> commands at the interactive grub2 command prompt.
>
> That's where you testosterone-pumped youngsters (Dale? Volker? Alan?
> Neil? Anyone?) can help fix this basically silly problem.
>
> grub2 is enough different from legacy grub to make the learning curve
> very steep -- but I'm only about half-way up the curve and I'm fading
> fast. (I usually unplug the offending USB stick and reboot
>
> If anyone here is interested enough to spend some real time and effort
> on grub2, I can offer a few pointers, but I'm not willing to do the real
> grunt work myself.
>
> Hm, sunset. Off to bed

a) never used grub2. Not interessted either. Seems to be infected by GNU.
Which means 'it doesn't matter that it needs 250mb.. but it got this nifty
feature'

b) never had a problem with grub booting the wrong disk just because some usb
sticks are inserted or esata drive turned on. And I have my bios read grub
from a different disk (sdb/c/d) then root (sda) (/boot is on a md raid1
partition, / is on a ssd..)

In conclusion: I am out of this. Sorry.
 
Old 01-08-2011, 11:44 PM
Dale
 
Default A tiny titillating taste of grub2

walt wrote:

About three years ago I spent a lot of time on the grub2 mailing list,
building grub2 from their svn repo, even submitting a patch or two to
get it working for the *BSD family.

Then I got old and tired and I settled on gentoo. I deleted all the
other OS's from my machines, including (especially) Windows -- so I no
longer need to multiboot five different OS's -- and so I lost interest
in the sexy new features of grub2.

Lately, though, I've been using multiple USB sticks, and having them
plugged in at boot-time can confuse legacy grub into booting from the
wrong disk, i.e. not booting at all. Very annoying.

So, I installed grub-1.98 and I've found that it *does* find partitions
by UUID, and even by LABEL, amongst multiple disks. Very nifty.

Not so fast, though. I don't know how to write a grub.conf file that
can tell grub2 how to do that automatically so I don't need to type
commands at the interactive grub2 command prompt.

That's where you testosterone-pumped youngsters (Dale? Volker? Alan?
Neil? Anyone?) can help fix this basically silly problem.

grub2 is enough different from legacy grub to make the learning curve
very steep -- but I'm only about half-way up the curve and I'm fading
fast. (I usually unplug the offending USB stick and reboot

If anyone here is interested enough to spend some real time and effort
on grub2, I can offer a few pointers, but I'm not willing to do the real
grunt work myself.

Hm, sunset. Off to bed




I have not tried grub2 yet but I did fine these:

https://help.ubuntu.com/community/Grub2

That has a lot of info on the grub2 conf file. It is called grub.cfg if
I read that correctly. There is a lot of info there. Seems a bit
complicated since I don't have it installed and can really follow what
they mean on things. This next one is a bit more basic tho:


http://en.gentoo-wiki.com/wiki/Grub2

This one seems to have a example and not quite so complicated.

http://grub.enbug.org/grub.cfg

Does those help any?

Dale

:-) :-)
 
Old 01-09-2011, 04:26 AM
Keith Dart
 
Default A tiny titillating taste of grub2

=== On Sat, 01/08, walt wrote: ===
> grub2 is enough different from legacy grub to make the learning curve
> very steep
===

I did get into grub2 recently, myself. It's hard to imagine anything
worse... It's supposed to be just a f***** bootloader, not an OS. It
needs a complete OS install just to configure it. Bah.

I found extlinux. Sweet simplicity. Works great, less filling. It's
what I use from now on.



-- Keith Dart

--

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
Keith Dart <keith@dartworks.biz>
public key: ID: 19017044
<http://www.dartworks.biz/>
================================================== ===================
 
Old 01-09-2011, 11:03 AM
Alan McKinnon
 
Default A tiny titillating taste of grub2

Apparently, though unproven, at 01:36 on Sunday 09 January 2011, walt did
opine thusly:

> About three years ago I spent a lot of time on the grub2 mailing list,
> building grub2 from their svn repo, even submitting a patch or two to
> get it working for the *BSD family.
>
> Then I got old and tired and I settled on gentoo. I deleted all the
> other OS's from my machines, including (especially) Windows -- so I no
> longer need to multiboot five different OS's -- and so I lost interest
> in the sexy new features of grub2.
>
> Lately, though, I've been using multiple USB sticks, and having them
> plugged in at boot-time can confuse legacy grub into booting from the
> wrong disk, i.e. not booting at all. Very annoying.
>
> So, I installed grub-1.98 and I've found that it *does* find partitions
> by UUID, and even by LABEL, amongst multiple disks. Very nifty.
>
> Not so fast, though. I don't know how to write a grub.conf file that
> can tell grub2 how to do that automatically so I don't need to type
> commands at the interactive grub2 command prompt.
>
> That's where you testosterone-pumped youngsters (Dale? Volker? Alan?
> Neil? Anyone?) can help fix this basically silly problem.

Might be worth learning how this new-fangled boot loader works.

Right now I'm having Hercules' own fight trying to get Android Donut[1] and
Froyo triple-booting on an Ubuntu 10.10 netbook. Ubuntu uses grub2 these days
and I think I want to keep that (makes updates easier that way - the Android
stuff is a manual update anyway).

Let's keep the thread open and add stuff as we find it.

[1] Yes, Android now runs on x86 :-) http://www.android-x86.org

[2] I'llet "testosterone-pumped" passed (I'm the BOFH at work) but I dunno
about "youngsters", this here fellow has grey in his beard. Actually he has a
grey beard with a few bits of brown in it :-)


>
> grub2 is enough different from legacy grub to make the learning curve
> very steep -- but I'm only about half-way up the curve and I'm fading
> fast. (I usually unplug the offending USB stick and reboot
>
> If anyone here is interested enough to spend some real time and effort
> on grub2, I can offer a few pointers, but I'm not willing to do the real
> grunt work myself.
>
> Hm, sunset. Off to bed

--
alan dot mckinnon at gmail dot com
 
Old 01-09-2011, 11:10 AM
Alan McKinnon
 
Default A tiny titillating taste of grub2

Apparently, though unproven, at 02:44 on Sunday 09 January 2011, Dale did
opine thusly:

> I have not tried grub2 yet but I did fine these:
>
> https://help.ubuntu.com/community/Grub2
>
> That has a lot of info on the grub2 conf file. It is called grub.cfg if
> I read that correctly. There is a lot of info there. Seems a bit
> complicated since I don't have it installed and can really follow what
> they mean on things. This next one is a bit more basic tho:
>
> http://en.gentoo-wiki.com/wiki/Grub2
>
> This one seems to have a example and not quite so complicated.
>
> http://grub.enbug.org/grub.cfg

I don't quite agree with Volker's viewpoint but don't totally disagree with
him either. grub2 has a whole whack of bloat all of it's own. Here's what
Ubuntu has on 10.10:

$ ls -al /boot/
total 17656
drwxr-xr-x 3 root root 4096 2011-01-08 21:37 .
drwxr-xr-x 22 root root 4096 2011-01-08 21:21 ..
-rw-r--r-- 1 root root 705861 2010-12-02 09:07 abi-2.6.35-24-generic
-rw-r--r-- 1 root root 128614 2010-12-02 09:07 config-2.6.35-24-generic
drwxr-xr-x 3 root root 4096 2011-01-08 21:21 grub
-rw-r--r-- 1 root root 10752449 2010-12-28 20:57 initrd.img-2.6.35-24-generic
-rw-r--r-- 1 root root 165084 2010-09-24 19:14 memtest86+.bin
-rw-r--r-- 1 root root 167264 2010-09-24 19:14 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 1831358 2010-12-02 09:07 System.map-2.6.35-24-generic
-rw-r--r-- 1 root root 1192 2010-12-02 09:10 vmcoreinfo-2.6.35-24-generic
-rw-r--r-- 1 root root 4294032 2010-12-02 09:07 vmlinuz-2.6.35-24-generic

$ du -sh /boot/
22M /boot/

Most of that is an 11M initrd and a 4.1M kernel.
What?? A fully modular kernel weighing in it 4.1M??

grub2 modules are 4.1M, not too bad, except by looking at filenames there iss
support in there for jpeg, intel 915, xfs, andrewfs, hfsplus, iso9660, jfs and
$DEITY knows what else. Including tar.

Methinks a modular build system is in order here. Why should I build support
for sparc when I know for a fact I'm building an x86 installer?


--
alan dot mckinnon at gmail dot com
 
Old 01-09-2011, 04:48 PM
Dale
 
Default A tiny titillating taste of grub2

Alan McKinnon wrote:

I don't quite agree with Volker's viewpoint but don't totally disagree with
him either. grub2 has a whole whack of bloat all of it's own. Here's what
Ubuntu has on 10.10:

$ ls -al /boot/
total 17656
drwxr-xr-x 3 root root 4096 2011-01-08 21:37 .
drwxr-xr-x 22 root root 4096 2011-01-08 21:21 ..
-rw-r--r-- 1 root root 705861 2010-12-02 09:07 abi-2.6.35-24-generic
-rw-r--r-- 1 root root 128614 2010-12-02 09:07 config-2.6.35-24-generic
drwxr-xr-x 3 root root 4096 2011-01-08 21:21 grub
-rw-r--r-- 1 root root 10752449 2010-12-28 20:57 initrd.img-2.6.35-24-generic
-rw-r--r-- 1 root root 165084 2010-09-24 19:14 memtest86+.bin
-rw-r--r-- 1 root root 167264 2010-09-24 19:14 memtest86+_multiboot.bin
-rw-r--r-- 1 root root 1831358 2010-12-02 09:07 System.map-2.6.35-24-generic
-rw-r--r-- 1 root root 1192 2010-12-02 09:10 vmcoreinfo-2.6.35-24-generic
-rw-r--r-- 1 root root 4294032 2010-12-02 09:07 vmlinuz-2.6.35-24-generic

$ du -sh /boot/
22M /boot/

Most of that is an 11M initrd and a 4.1M kernel.
What?? A fully modular kernel weighing in it 4.1M??

grub2 modules are 4.1M, not too bad, except by looking at filenames there iss
support in there for jpeg, intel 915, xfs, andrewfs, hfsplus, iso9660, jfs and
$DEITY knows what else. Including tar.

Methinks a modular build system is in order here. Why should I build support
for sparc when I know for a fact I'm building an x86 installer?




It seems grub2 is a whopper. Check this out:

root@fireball / # du -shc /boot/
13M /boot/
13M total
root@fireball / # ls -al /boot/bzImage-2.6.36-r*
-rw-r--r-- 1 root root 4201472 Dec 15 00:16 /boot/bzImage-2.6.36-r4-1
-rw-r--r-- 1 root root 4204768 Dec 19 23:11 /boot/bzImage-2.6.36-r4-2
-rw-r--r-- 1 root root 4207168 Jan 4 23:38 /boot/bzImage-2.6.36-r6-1
root@fireball / #

So, my /boot is 13Mbs and I have three kernels there plus copies of
their config files as well. Those are full blown ones since I don't use
modules. I guess grub2 may make some people have to grow their /boot
partition a bit for all that. I'm not planning to try grub2 for a bit
yet but from the looks of it, it's a good thing I made my /boot
partition 200Mbs. o_O


Why so much you reckon? I did a emerge -pv and it has to install three
more packages, in addition to the ones grub-static pulled in already.
Does grub2 wash dishes too? I need one of those if it does. lol


Dale

:-) :-)
 
Old 01-09-2011, 06:07 PM
walt
 
Default A tiny titillating taste of grub2

On 01/09/2011 04:10 AM, Alan McKinnon wrote:

Apparently, though unproven, at 02:44 on Sunday 09 January 2011, Dale did
opine thusly:


I have not tried grub2 yet but I did fine these:

https://help.ubuntu.com/community/Grub2
http://en.gentoo-wiki.com/wiki/Grub2
http://grub.enbug.org/grub.cfg


Thanks Dale, the ubuntu link may be what I need.


I don't quite agree with Volker's viewpoint but don't totally disagree with
him either. grub2 has a whole whack of bloat all of it's own.


Indeed it does, except for grub.info, which is not nearly complete.


Methinks a modular build system is in order here. Why should I build support
for sparc when I know for a fact I'm building an x86 installer?


Here is how I do that manually, FWIW. (I've not run the grub2 install scripts
because I haven't read them yet, which makes me nervous in a boot loader

$cd ~/src #in my home directory, so I don't need root
$tar -xvzf /usr/portage/distfiles/grub-1.98.tar.gz
$cd grub-1.98
$./configure --prefix=$HOME --disable-werror
$make all install

At this point grub2 has merely saved some files in your home directory, it
has *not* messed with your boot sector or touched legacy grub in any way.

$ls ~/bin/grub*
/home/wa1ter/bin/grub-bin2h /home/wa1ter/bin/grub-mkisofs
/home/wa1ter/bin/grub-editenv /home/wa1ter/bin/grub-mkpasswd-pbkdf2
/home/wa1ter/bin/grub-fstest /home/wa1ter/bin/grub-mkrelpath
/home/wa1ter/bin/grub-mkelfimage /home/wa1ter/bin/grub-mkrescue
/home/wa1ter/bin/grub-mkfont /home/wa1ter/bin/grub-script-check
/home/wa1ter/bin/grub-mkimage

$ls ~/lib/grub/i386-pc/
acpi.mod font.mod linux16.mod reboot.mod
affs.mod fs.lst lnxboot.img reiserfs.mod
afs.mod fshelp.mod loadenv.mod relocator.mod
<dozens more grub2 modules snipped for brevity>

That's where the bloat comes from, as you pointed out. There are tons
of those *.mod files you won't need, so the trick is to compile a list
of them you *do* need, and then feed the list to grub-mkimage as described
below.

NOTE: I can't recall exactly why but the ata* modules conflict with some
other modules, so *don't use them* unless you know what you are doing.

Create a list of all grub2 modules:

$ls ~/lib/grub/i386pc/*.mod > /tmp/modlist

Now edit that file and delete any modules you know you don't need, e.g.
I deleted reiserfs.mod and ntfs.mod and the raid*.mod because I don't
use those items. Don't touch anything you don't clearly recognize, but
*do* delete ata.mod and ata_pthru.mod.

Now it's time to build the grub2 binary executable:

$~/bin/grub-mkimage -o /tmp/grub2bin `cat /tmp/modlist`

Your file grub2bin is actually formatted as a tiny pseudo kernel, which
your legacy grub can boot using the usual grub sytax:

title try grub2
root (hdX,X)
kernel /tmp/grub2bin (or wherever else you want to put it. NOTE: so far
I've done nothing requiring root privileges

That menu item will start a grub2 running so you can experiment with
it all you want, but still use legacy grub to boot as you always do.
(You won't yet have a menu file for grub2, so you will see only the
usual grub command prompt instead of a menu.)

The grub2 shell is a bit different, so you might want to type "set" to
see what variables you can change, "ls" to see your disks, and of course
hit the tab key when you don't know what else to type.

Type "help search" for the real excitement.

A few more grub2 differences: the 'linux' command replaces 'kernel' to
load your (linux) kernel. 'multiboot' is used to load any true multiboot
kernel e.g. NetBSD. Not sure, but I think you still need to chainload
the Windows booter -- sadly, I can't test it anymore

One problem I encountered on my old amd32 machine is that I had to remove
the USB-related grub2 modules or grub2 would crash while probing for disks.
The newer amd64 machine works fine with the USB stuff included. Dunno why.

NOTE: if grub2 names your disks (ataN,N) instead of (hdN,N) that means
you are using the ata* grub2 modules -- I haven't figured out how to make
that configuration work yet.
 
Old 01-09-2011, 07:04 PM
Alan McKinnon
 
Default A tiny titillating taste of grub2

Apparently, though unproven, at 19:48 on Sunday 09 January 2011, Dale did
opine thusly:

> It seems grub2 is a whopper. Check this out:
>
> root@fireball / # du -shc boot
> 13M boot
> 13M total
> root@fireball / # ls -al /boot/bzImage-2.6.36-r*
> -rw-r--r-- 1 root root 4201472 Dec 15 00:16 /boot/bzImage-2.6.36-r4-1
> -rw-r--r-- 1 root root 4204768 Dec 19 23:11 /boot/bzImage-2.6.36-r4-2
> -rw-r--r-- 1 root root 4207168 Jan 4 23:38 /boot/bzImage-2.6.36-r6-1
> root@fireball / #
>
> So, my /boot is 13Mbs and I have three kernels there plus copies of
> their config files as well. Those are full blown ones since I don't use
> modules. I guess grub2 may make some people have to grow their /boot
> partition a bit for all that. I'm not planning to try grub2 for a bit
> yet but from the looks of it, it's a good thing I made my /boot
> partition 200Mbs. o_O
>
> Why so much you reckon? I did a emerge -pv and it has to install three
> more packages, in addition to the ones grub-static pulled in already.
> Does grub2 wash dishes too? I need one of those if it does. lol

It's trying to be an OS that's a bootloader as it's primary function.

Think back to the days of lilo. It obviously isn't an OS and doesn't
understand OS concepts - it loads an OS. When that step is done, then and only
then do OS concepts come into play. lilo doesn't even understand how to find a
file on a disk, that's why the lilo command had to be run to tell the
bootloader which sectors on disk it had to shove into memory.

This confused people. It annoyed even more people who often forgot to run lilo
before rebooting. So grub came along, it had the absolute minimum of OS-like
features to find and load a kernel file. It needed it's own syntax of defining
drive names, then would make it's way through the read-only fs it found there
to find the kernel. It supported a small number of file systems, just enough
so that a 50M partition would be usable on almost any platform.

grub2 now looks like GNU/grub (sarcasm intended). It's not a bootloader, it's
a puny OS with one extra feature - it can bootload!

It has support for jpeg, every fs under the sun, and the grub2 ebuild even has
a truetype USE flag.

Yes! Now my life is complete. I've been DYING for years to have a bootloader
that can properly display anti-aliased fonts for the entire 2 seconds it's on-
screen

--
alan dot mckinnon at gmail dot com
 
Old 01-09-2011, 07:27 PM
Volker Armin Hemmann
 
Default A tiny titillating taste of grub2

On Sunday 09 January 2011 22:04:44 Alan McKinnon wrote:
> Apparently, though unproven, at 19:48 on Sunday 09 January 2011, Dale did
>
> opine thusly:
> > It seems grub2 is a whopper. Check this out:
> >
> > root@fireball / # du -shc boot
> > 13M boot
> > 13M total
> > root@fireball / # ls -al /boot/bzImage-2.6.36-r*
> > -rw-r--r-- 1 root root 4201472 Dec 15 00:16 /boot/bzImage-2.6.36-r4-1
> > -rw-r--r-- 1 root root 4204768 Dec 19 23:11 /boot/bzImage-2.6.36-r4-2
> > -rw-r--r-- 1 root root 4207168 Jan 4 23:38 /boot/bzImage-2.6.36-r6-1
> > root@fireball / #
> >
> > So, my /boot is 13Mbs and I have three kernels there plus copies of
> > their config files as well. Those are full blown ones since I don't use
> > modules. I guess grub2 may make some people have to grow their /boot
> > partition a bit for all that. I'm not planning to try grub2 for a bit
> > yet but from the looks of it, it's a good thing I made my /boot
> > partition 200Mbs. o_O
> >
> > Why so much you reckon? I did a emerge -pv and it has to install three
> > more packages, in addition to the ones grub-static pulled in already.
> > Does grub2 wash dishes too? I need one of those if it does. lol
>
> It's trying to be an OS that's a bootloader as it's primary function.
>
> Think back to the days of lilo. It obviously isn't an OS and doesn't
> understand OS concepts - it loads an OS. When that step is done, then and
> only then do OS concepts come into play. lilo doesn't even understand how
> to find a file on a disk, that's why the lilo command had to be run to tell
> the bootloader which sectors on disk it had to shove into memory.
>
> This confused people. It annoyed even more people who often forgot to run
> lilo before rebooting. So grub came along, it had the absolute minimum of
> OS-like features to find and load a kernel file. It needed it's own syntax
> of defining drive names, then would make it's way through the read-only fs
> it found there to find the kernel. It supported a small number of file
> systems, just enough so that a 50M partition would be usable on almost any
> platform.
>
> grub2 now looks like GNU/grub (sarcasm intended). It's not a bootloader,
> it's a puny OS with one extra feature - it can bootload!
>
> It has support for jpeg, every fs under the sun, and the grub2 ebuild even
> has a truetype USE flag.
>
> Yes! Now my life is complete. I've been DYING for years to have a bootloader
> that can properly display anti-aliased fonts for the entire 2 seconds it's
> on- screen

and of course it uses a way to load the OS everybody else says is broken. GNU
ftw!
 

Thread Tools




All times are GMT. The time now is 11:53 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org