Discussion:
grub vs grub 2
james
2012-02-14 17:36:28 UTC
Permalink
Googling around, I get the impression
that 'grub' is now grub 2. Is that
correct?

In portage I see grub-static
(GRUB Legacy boot loader)
with version numbers that coincide with
"grub" (grub2 ?).

If grub2 has replaced "grub-1" what (gentoo)
version number did grub2 first take take?

What was the last (gentoo) version number for
grub 1 that was actually grub1 , or have I
confused these details?

I cannot seem to find these details in the release
notes or as part of the sourcecode. Any suggestions
on that would be keen.

James
Florian Philipp
2012-02-14 17:53:46 UTC
Permalink
Post by james
Googling around, I get the impression
that 'grub' is now grub 2. Is that
correct?
In portage I see grub-static
(GRUB Legacy boot loader)
with version numbers that coincide with
"grub" (grub2 ?).
If grub2 has replaced "grub-1" what (gentoo)
version number did grub2 first take take?
What was the last (gentoo) version number for
grub 1 that was actually grub1 , or have I
confused these details?
I cannot seem to find these details in the release
notes or as part of the sourcecode. Any suggestions
on that would be keen.
James
sys-boot/grub has two slots. The default slot 0 with version numbers
around 0.92-0.97 is grub-1 (or grub legacy). Slot 2 with version numbers
around 1.99 is grub-2. Because it is still in development hell, it has
not reached version 2.00.

IIRC, sys-boot/grub-static is mostly there for systems that cannot
compile grub, for example AMD64 no-multilib profiles.

Hope this helps,
Florian Philipp
LK
2012-02-14 18:08:09 UTC
Permalink
Post by Florian Philipp
Post by james
Googling around, I get the impression
that 'grub' is now grub 2. Is that
correct?
[...]
Because it is still in development hell, it has
not reached version 2.00.
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
m***@trausch.us
2012-02-14 18:24:07 UTC
Permalink
Post by LK
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
GRUB Legacy (that is, GRUB versions 0.xx) is still the default in
Gentoo. In order to use GRUB 2 (that is, GRUB version 1.99 in Portage)
you'll have to unmask sys-boot/grub-1.99-r2.

GRUB 2 is significantly more convenient and powerful and does not
require the nearly 80 patches that the legacy version does in order to
work properly on the system. It can also manage its own configuration
file using its new grub-mkconfig (grub2-mkconfig in Gentoo) program,
which supports the use of scripts/programs to generate grub.cfg entries
for booting the kernel and other operating systems.

However (at least on my primary workstation) Portage now always removes
grub:0 at depclean time, and always pulls it back in at "emerge -DNua
world" time. It's harmless, though inefficient, and I haven't figured
out how to prevent it from happening. I have even masked grub:0 and it
still pulls it in and installs it, despite being masked.

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
LK
2012-02-14 18:40:40 UTC
Permalink
Post by m***@trausch.us
Post by LK
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
GRUB Legacy (that is, GRUB versions 0.xx) is still the default in
Gentoo. In order to use GRUB 2 (that is, GRUB version 1.99 in Portage)
you'll have to unmask sys-boot/grub-1.99-r2.
The thing is, IMO grub0 is better / simplier.
Post by m***@trausch.us
GRUB 2 is significantly more convenient and powerful and does not
require the nearly 80 patches that the legacy version does in order to
work properly on the system. It can also manage its own configuration
file using its new grub-mkconfig (grub2-mkconfig in Gentoo) program,
which supports the use of scripts/programs to generate grub.cfg entries
for booting the kernel and other operating systems.
As you read above, I prefer grub0.* because it has config files, not
commands which will automize it. For ubuntu I can understand that,
but configuring boot is too simple to require automisation. When
now automatic script fails, is there a way to do it by hand? Ubuntu
disallows editing it by hand. Now I am confused by the 80 patches
for legacy grub =( afaik.

PS: If you know how to get rid of any background image, could you
say how?

THX + TIA.
Alecks Gates
2012-02-14 18:46:23 UTC
Permalink
Post by LK
Post by m***@trausch.us
Post by LK
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
GRUB Legacy (that is, GRUB versions 0.xx) is still the default in
Gentoo. In order to use GRUB 2 (that is, GRUB version 1.99 in Portage)
you'll have to unmask sys-boot/grub-1.99-r2.
The thing is, IMO grub0 is better / simplier.
Post by m***@trausch.us
GRUB 2 is significantly more convenient and powerful and does not
require the nearly 80 patches that the legacy version does in order to
work properly on the system. It can also manage its own configuration
file using its new grub-mkconfig (grub2-mkconfig in Gentoo) program,
which supports the use of scripts/programs to generate grub.cfg entries
for booting the kernel and other operating systems.
As you read above, I prefer grub0.* because it has config files, not
commands which will automize it. For ubuntu I can understand that,
but configuring boot is too simple to require automisation. When
now automatic script fails, is there a way to do it by hand? Ubuntu
disallows editing it by hand. Now I am confused by the 80 patches
for legacy grub =( afaik.
PS: If you know how to get rid of any background image, could you
say how?
THX + TIA.
Yes, you can edit the grub2 boot config files by hand, I do this myself in
Gentoo (and the last time I used Ubuntu you could still edit them, but that
was a while ago). You're not tied to the automation. I prefer grub2
config files, personally. Definitely not as "simple," of course, but that
hardly makes a difference to me.
m***@trausch.us
2012-02-14 18:52:23 UTC
Permalink
Post by LK
Post by m***@trausch.us
Post by LK
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
GRUB Legacy (that is, GRUB versions 0.xx) is still the default in
Gentoo. In order to use GRUB 2 (that is, GRUB version 1.99 in Portage)
you'll have to unmask sys-boot/grub-1.99-r2.
The thing is, IMO grub0 is better / simplier.
I disagree. GRUB Legacy is not the same in any two distributions
because every single distribution patches it differently because it
hasn't had core functionality updated in a very long time. It's pretty
much abandoned by upstream, as well.

I'm not saying that it is bad, but I _am_ saying that it has outlived
its usefulness.

GRUB 2 follows an entirely different architecture.
Post by LK
Post by m***@trausch.us
GRUB 2 is significantly more convenient and powerful and does not
require the nearly 80 patches that the legacy version does in order to
work properly on the system. It can also manage its own configuration
file using its new grub-mkconfig (grub2-mkconfig in Gentoo) program,
which supports the use of scripts/programs to generate grub.cfg entries
for booting the kernel and other operating systems.
As you read above, I prefer grub0.* because it has config files, not
commands which will automize it. For ubuntu I can understand that,
but configuring boot is too simple to require automisation. When
now automatic script fails, is there a way to do it by hand? Ubuntu
disallows editing it by hand. Now I am confused by the 80 patches
for legacy grub =( afaik.
Nothing requires you to use the scripts; they simply provide assistance.
If you want, you can absolutely manage your configuration file by hand.
Why you'd want to is beyond me, but it's a choice that you do in fact have.

I use them, because it simplifies my life and it means that I can easily
manage systems' boot loader configuration without having to resort to
forcing all the environments to use the same filenames and
layouts---compile kernel, install kernel, run "grub2-mkconfig -o
/boot/grub2/grub.cfg". Simple. I have too many systems to worry about
messing with configuration files by hand!

If you need to customize the process, you can add, remove, and re-order
scripts in /etc/grub.d. They are named like xx-name, where xx is a
number from 00 to 99.

Of course, if for some reason one of those scripts did break, you can
still boot your system by hand as you were able to do in GRUB Legacy,
with the added bonus that the GRUB 2 environment is much easier to work
in. It also supports partition schemes other than MBR, which is useful
since I use GPT on my systems. It can also natively boot 64-bit kernels
via Multiboot.
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
For GRUB Legacy? I'm sorry, but it has been long enough since I have
used it that I couldn't help; there is a configuration directive in the
menu.lst file that you should be able to delete that will get rid of it,
but I don't remember what it was called.
Post by LK
THX + TIA.
--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Michael Mol
2012-02-14 19:04:56 UTC
Permalink
Post by LK
Post by m***@trausch.us
Post by LK
BTW: So is grub0 still supported by gentoo / maintained by themselves?
Does that matter(it is boot, no network stuff) ?
GRUB Legacy (that is, GRUB versions 0.xx) is still the default in
Gentoo.  In order to use GRUB 2 (that is, GRUB version 1.99 in Portage)
you'll have to unmask sys-boot/grub-1.99-r2.
The thing is, IMO grub0 is better / simplier.
I disagree.  GRUB Legacy is not the same in any two distributions
because every single distribution patches it differently because it
hasn't had core functionality updated in a very long time.  It's pretty
much abandoned by upstream, as well.
I'm not saying that it is bad, but I _am_ saying that it has outlived
its usefulness.
GRUB 2 follows an entirely different architecture.
A detailed elaboration would be nice.

A contrasting migration guide, complete with the how's, where's and
why's would be awesome. (Once one's invested in understanding a tool,
a 1-2-3-itsmagic walkthrough is very discomforting.)
--
:wq
m***@trausch.us
2012-02-14 20:35:31 UTC
Permalink
Post by Michael Mol
A detailed elaboration would be nice.
A contrasting migration guide, complete with the how's, where's and
why's would be awesome. (Once one's invested in understanding a tool,
a 1-2-3-itsmagic walkthrough is very discomforting.)
While there are many different points that differ between the two, the
biggest are:

- Supported upstream.

- Can boot from GPT as well as MBR partition table types, regardless
of whether EFI is in use or not. Also supports the use of Apple
Partition Maps, BSD disk labels, and others through modules.

- Doesn't require patching to deal with modern situations; you can
download upstream source code and it will work, unlike GRUB Legacy.

- Can boot from virtually any filesystem you would want to use,
not just a small handful of them; includes ISO9660, UDF, Reiser,
btrfs, NTFS, ZFS, HFS and HFS+, among others.

- Supports selecting filesystems by UUID without distribution-specific
patches, for filesystem types that can be identified by UUIDs.

- Can be booted from BIOS or EFI on the PC, and no longer depends on
the existence of any particular type of firmware (no more probing
for BIOS boot drives, which can fail on many different systems).

This means that GRUB 2 doesn't have to be hand-installed on systems
GRUB Legacy couldn't figure out for whatever reason. And yes, there
were a good number of them, where LILO was the only choice due to
its use of block maps (another not-so-robust booting mechanism which
required significantly more maintenance than GRUB does).

- Can boot Linux, the BSDs, any Multiboot or Multiboot2 kernel, and
EFI applications.

- Supports El Torito natively on platforms that use it (e.g., BIOS)
to boot optical media, meaning that it is possible to use GRUB 2
boot anything that can be burned to an optical disk. This makes it
easier to work with testing environments burned to any form of
optical disk.

- Better code quality than GRUB Legacy, with more loose coupling
between components and making it possible for people to more easily
write GRUB modules than with GRUB Legacy. Additionally, nearly
anything that would have been a patch to GRUB Legacy can be written
as a module in GRUB 2, making it easier to share modules between
distributions. This also means it is *much* more portable.

- Can be run as an EFI application on modern systems using EFI, such
as Intel-based Macintosh systems, without requiring BIOS emulation.
It can also emulate an EFI environment for things which require it
in order to boot.

- Eliminates dependence on BIOS in order to determine available boot
devices. This empowers GRUB to be able to boot without firmware
assistance from many different mediums, including USB and PXE, even
without firmware support.

- Supports booting from Linux device-mapper and LVM2 configurations,
as well as encrypted partitions.

- Supports kernels > 16 MB in size without patches. This can happen
when you compile a purely static kernel and support a great deal of
options without putting them into modules. Not common, but does
happen.

Additionally, GRUB 2 standardizes (upstream) a number of things which
were developed independently by various distributions as patches for
GRUB Legacy. Gentoo's legacy GRUB is heavily patched,

The configuration file isn't terribly difficult to figure out, either;
as I've mentioned before, there is *absolutely* no requirement to use
grub2-mkconfig, it just makes life easier.

For example, here is the entry that boots my current kernel:

menuentry 'GNU/Linux, with Linux 3.2.5-gentoo' --class gnu-linux --class
gnu --class os {
load_video
insmod gzio
insmod part_gpt
insmod ext2
set root='(/dev/sda,gpt2)'
search --no-floppy --fs-uuid --set=root
3820beff-80b5-4d05-b989-3ab9265bc2a3
echo 'Loading Linux 3.2.5-gentoo ...'
linux /vmlinuz-3.2.5-gentoo root=/dev/sda3 ro

Adding an entry is no more complex as it was before; copy, paste, edit.
Simple. No commands necessary since GRUB reads the grub.cfg file from
the filesystem when it loads, and doesn't embed it anywhere.

(And yes, I have a separate /boot; reason being is that it is mounted -o
sync, that is, when it is mounted at all. At least on my primary
desktop system; /boot is actually on the root fs on most of my systems.)

There will be a day when GRUB Legacy won't be supported by distributions
at all. There's no need to maintain multiple bootloaders (and upstream
refuses to do so, reasonably), and many of the tricks, patches and
workarounds of old are no longer necessary with GRUB 2.

Also, it becomes possible to use the Linux kernel's long-existing
installation hook to automatically update the boot list when you "make
install modules_install" a new kernel image, making kernel installation
literally a single step after the build. Many different distributions
did this before by implementing scripts that do what grub2-mkconfig does
with GRUB 2, but for GRUB Legacy. Now, that's standard and upstream so
that there isn't fragmentation.

All told, GRUB 2 is *significantly* simpler, especially from the POV of
someone who installs, maintains and fixes systems for a living but also
from the POV of distribution packagers and maintainers.

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Michael Mol
2012-02-14 20:45:02 UTC
Permalink
Post by m***@trausch.us
Post by Michael Mol
A detailed elaboration would be nice.
A contrasting migration guide, complete with the how's, where's and
why's would be awesome. (Once one's invested in understanding a tool,
a 1-2-3-itsmagic walkthrough is very discomforting.)
While there are many different points that differ between the two, the
 - Supported upstream.
 - Can boot from GPT as well as MBR partition table types, regardless
   of whether EFI is in use or not.  Also supports the use of Apple
   Partition Maps, BSD disk labels, and others through modules.
 - Doesn't require patching to deal with modern situations; you can
   download upstream source code and it will work, unlike GRUB Legacy.
 - Can boot from virtually any filesystem you would want to use,
   not just a small handful of them; includes ISO9660, UDF, Reiser,
   btrfs, NTFS, ZFS, HFS and HFS+, among others.
 - Supports selecting filesystems by UUID without distribution-specific
   patches, for filesystem types that can be identified by UUIDs.
 - Can be booted from BIOS or EFI on the PC, and no longer depends on
   the existence of any particular type of firmware (no more probing
   for BIOS boot drives, which can fail on many different systems).
   This means that GRUB 2 doesn't have to be hand-installed on systems
   GRUB Legacy couldn't figure out for whatever reason.  And yes, there
   were a good number of them, where LILO was the only choice due to
   its use of block maps (another not-so-robust booting mechanism which
   required significantly more maintenance than GRUB does).
 - Can boot Linux, the BSDs, any Multiboot or Multiboot2 kernel, and
   EFI applications.
 - Supports El Torito natively on platforms that use it (e.g., BIOS)
   to boot optical media, meaning that it is possible to use GRUB 2
   boot anything that can be burned to an optical disk.  This makes it
   easier to work with testing environments burned to any form of
   optical disk.
 - Better code quality than GRUB Legacy, with more loose coupling
   between components and making it possible for people to more easily
   write GRUB modules than with GRUB Legacy.  Additionally, nearly
   anything that would have been a patch to GRUB Legacy can be written
   as a module in GRUB 2, making it easier to share modules between
   distributions.  This also means it is *much* more portable.
 - Can be run as an EFI application on modern systems using EFI, such
   as Intel-based Macintosh systems, without requiring BIOS emulation.
   It can also emulate an EFI environment for things which require it
   in order to boot.
 - Eliminates dependence on BIOS in order to determine available boot
   devices.  This empowers GRUB to be able to boot without firmware
   assistance from many different mediums, including USB and PXE, even
   without firmware support.
 - Supports booting from Linux device-mapper and LVM2 configurations,
   as well as encrypted partitions.
 - Supports kernels > 16 MB in size without patches.  This can happen
   when you compile a purely static kernel and support a great deal of
   options without putting them into modules.  Not common, but does
   happen.
Additionally, GRUB 2 standardizes (upstream) a number of things which
were developed independently by various distributions as patches for
GRUB Legacy.  Gentoo's legacy GRUB is heavily patched,
The configuration file isn't terribly difficult to figure out, either;
as I've mentioned before, there is *absolutely* no requirement to use
grub2-mkconfig, it just makes life easier.
menuentry 'GNU/Linux, with Linux 3.2.5-gentoo' --class gnu-linux --class
gnu --class os {
       load_video
       insmod gzio
       insmod part_gpt
       insmod ext2
       set root='(/dev/sda,gpt2)'
       search --no-floppy --fs-uuid --set=root
3820beff-80b5-4d05-b989-3ab9265bc2a3
       echo    'Loading Linux 3.2.5-gentoo ...'
       linux   /vmlinuz-3.2.5-gentoo root=/dev/sda3 ro
Adding an entry is no more complex as it was before; copy, paste, edit.
 Simple.  No commands necessary since GRUB reads the grub.cfg file from
the filesystem when it loads, and doesn't embed it anywhere.
(And yes, I have a separate /boot; reason being is that it is mounted -o
sync, that is, when it is mounted at all.  At least on my primary
desktop system; /boot is actually on the root fs on most of my systems.)
There will be a day when GRUB Legacy won't be supported by distributions
at all.  There's no need to maintain multiple bootloaders (and upstream
refuses to do so, reasonably), and many of the tricks, patches and
workarounds of old are no longer necessary with GRUB 2.
Also, it becomes possible to use the Linux kernel's long-existing
installation hook to automatically update the boot list when you "make
install modules_install" a new kernel image, making kernel installation
literally a single step after the build.  Many different distributions
did this before by implementing scripts that do what grub2-mkconfig does
with GRUB 2, but for GRUB Legacy.  Now, that's standard and upstream so
that there isn't fragmentation.
All told, GRUB 2 is *significantly* simpler, especially from the POV of
someone who installs, maintains and fixes systems for a living but also
from the POV of distribution packagers and maintainers.
Very nice, thanks.
--
:wq
Paul Hartman
2012-02-14 23:47:37 UTC
Permalink
Post by m***@trausch.us
It also supports partition schemes other than MBR, which is useful
since I use GPT on my systems.
FYI Gentoo's GRUB 0.9x in portage has supported GPT for at least 2 or
3 years now. I'm using it with GPT partitions and my systems all boot.
:)
m***@trausch.us
2012-02-14 23:53:44 UTC
Permalink
Post by Paul Hartman
FYI Gentoo's GRUB 0.9x in portage has supported GPT for at least 2 or
3 years now. I'm using it with GPT partitions and my systems all boot.
:)
Not all distributions do. I have been running GPT for quite some time,
while I only switched to Gentoo (relatively) recently.

That said, I also stopped using GRUB 0.9x when GRUB 1.9x became stable
enough to deploy widely, since I was quite tired of fixing broken GRUB
setups (almost never my own, mind).

Since the so-called "mainstream" distributions switched to GRUB 2, I
take a lot less calls for "my system stopped booting". Now most of
those are Windows breakages. :-)

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Andrea Conti
2012-02-14 19:29:26 UTC
Permalink
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
Remove or comment out any "splashimage" directives from the config file.

***

Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.

I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...

I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.

andrea
LK
2012-02-14 19:53:09 UTC
Permalink
Post by Andrea Conti
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
Remove or comment out any "splashimage" directives from the config file.
I meant in GRUB2. I have another box with linux mint using GRUB2, and splash backgrounds in GRUB / lowlevel menus or anywhere ("branding") reminds me of commercialism like Apple putting their logo onto every product. (They are good, tho, the apple logo is stylish. Now imagine the iPhone would have a rectangle-like icon with bad proportions)
Post by Andrea Conti
Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...
I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.
I agree to you in a big part. Thanks.

Big companies like Microsoft or Apple are doing a thing i simply call
"Similarisation of features for new/unknowledged users", which always
goes in the reverse direction on long-term. Sample situation: Microsoft
Repair CD: You can select to partition your disk appropiate to how the
assistant will like it. You are being hid from all the details, as you wont
understand them any way.
Once you try to do something special, you get problems bigger than
without this 'improvement for new ones'. This is because less work is
being done to the detailed way of doing it, and more to the simple,
which is made to just do one or two things.
Essence: The system is hidden, you only see actions what you can
do (update-grub in our case) instead of the system. This is obviously
wrong because the system, the back-end, takes more than
the front-end. Now the front-end should represent the back-end in a
human readable form and not simplify to fit the least knowledged.

BUT, i guess (from what ive heard) grub2 is fine with editing it by
hand. And the command does really only assist in the simpliest
matter, only combines all actions you'd have to take yourself.
Thanks for the clearance.

(If you want to criticise the above big block of text, I always fail to
express myself well.)
Michael Cook
2012-02-14 19:59:57 UTC
Permalink
You can't edit /etc/default/grub to customize how grub-mkconfig generates
grub.cfg. Mint probably has update-grub like Ubuntu does which just allows
you to use that command instead of grub2-mkconfig -o /boot/grub/grub.cfg
Post by LK
Post by Andrea Conti
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
Remove or comment out any "splashimage" directives from the config file.
I meant in GRUB2. I have another box with linux mint using GRUB2, and
splash backgrounds in GRUB / lowlevel menus or anywhere ("branding")
reminds me of commercialism like Apple putting their logo onto every
product. (They are good, tho, the apple logo is stylish. Now imagine the
iPhone would have a rectangle-like icon with bad proportions)
Post by Andrea Conti
Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...
I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.
I agree to you in a big part. Thanks.
Big companies like Microsoft or Apple are doing a thing i simply call
"Similarisation of features for new/unknowledged users", which always
goes in the reverse direction on long-term. Sample situation: Microsoft
Repair CD: You can select to partition your disk appropiate to how the
assistant will like it. You are being hid from all the details, as you wont
understand them any way.
Once you try to do something special, you get problems bigger than
without this 'improvement for new ones'. This is because less work is
being done to the detailed way of doing it, and more to the simple,
which is made to just do one or two things.
Essence: The system is hidden, you only see actions what you can
do (update-grub in our case) instead of the system. This is obviously
wrong because the system, the back-end, takes more than
the front-end. Now the front-end should represent the back-end in a
human readable form and not simplify to fit the least knowledged.
BUT, i guess (from what ive heard) grub2 is fine with editing it by
hand. And the command does really only assist in the simpliest
matter, only combines all actions you'd have to take yourself.
Thanks for the clearance.
(If you want to criticise the above big block of text, I always fail to
express myself well.)
m***@trausch.us
2012-02-14 20:44:42 UTC
Permalink
Post by Michael Cook
You can't edit /etc/default/grub to customize how grub-mkconfig
generates grub.cfg. Mint probably has update-grub like Ubuntu does which
just allows you to use that command instead of grub2-mkconfig -o
/boot/grub/grub.cfg
grub-mkconfig (grub2-mkconfig in Gentoo) uses the scripts in /etc/grub.d
to generate the configuration file. It runs them in sequential order.
You can add, remove or rename the scripts in order to have them do what
you want.

You can also edit the 40_custom file, which will insert its contents
verbatim (sans its shebang and exec lines) into the configuration file
when grub(2)-mkconfig is run.

For the paranoid, you can put a failsafe boot option in that file.

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
LK
2012-02-14 20:58:12 UTC
Permalink
What do you think of putting this conversation onto some website, as tutorial or clarification =P ?
Michael Mol
2012-02-14 21:19:37 UTC
Permalink
Post by LK
What do you think of putting this conversation onto some website, as tutorial or clarification =P ?
http://archives.gentoo.org/gentoo-user/msg_ee5c878773ac6ca9f49a33191654e3db.xml
--
:wq
Alex Schuster
2012-02-14 20:30:56 UTC
Permalink
Post by LK
Post by Andrea Conti
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
Remove or comment out any "splashimage" directives from the config file.
I meant in GRUB2. I have another box with linux mint using GRUB2, and
splash backgrounds in GRUB / lowlevel menus or anywhere ("branding")
reminds me of commercialism like Apple putting their logo onto every
product. (They are good, tho, the apple logo is stylish. Now imagine
the iPhone would have a rectangle-like icon with bad proportions)
Look in /etc/default/grub, there is one setting to switch to text mode.
GRUB_TERMINAL=console I think. Run update-grub to regenerate the grub.cfg
applying these settings.

BTW, this took me quite some time to find out. I had to find out about
the /etc/default/ directory first, and then I didn't use update-grub, but
grub-setup or something like that. So I like the old grub, where I simply
edit its config file, instead of having to find out which of the config
files I have to edit where and how to apply the changes.

Wonko
m***@trausch.us
2012-02-14 20:46:18 UTC
Permalink
Post by LK
I meant in GRUB2. I have another box with linux mint using GRUB2, and
splash backgrounds in GRUB / lowlevel menus or anywhere ("branding")
reminds me of commercialism like Apple putting their logo onto every
product. (They are good, tho, the apple logo is stylish. Now imagine
the iPhone would have a rectangle-like icon with bad proportions)
Comment out the GRUB_BACKGROUND line in /etc/default/grub.

You can also comment out the GRUB_GFXMODE line in order to use plain VGA
text mode.

--- Mikje
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
m***@trausch.us
2012-02-14 20:42:23 UTC
Permalink
Post by Andrea Conti
Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...
Well, it's a good thing that GRUB 2 is just a bootloader, then. :-)
And again, nobody needs the tools to configure it; they are simply
standardized from what various distributions developed for GRUB Legacy,
but was incompatible from one distribution to the next.
Post by Andrea Conti
I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.
How about "It Just Works". Seriously.

It is a better designed system with most of its functionality pushed
into modules. It is portable to more than just x86, as I've already
mentioned before, and during _that_ whole process, the quality of the
code increased significantly. It is more robust, and from the POV of a
user, maintainer, or packager it is *much* simpler.

When supporting GRUB Legacy, it's almost a necessity to know which
distribution the user installed it with. Why? Because all of them are
different! That is no longer the case with GRUB 2.

I'm not sure how that translates to being more complex. If you are
averse to change, just say so and be done with it. Is it different?
Oh, yes, absolutely. It couldn't be better if it were the same, could
it? ;-)

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
LK
2012-02-14 20:57:03 UTC
Permalink
Post by m***@trausch.us
Post by Andrea Conti
Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...
Well, it's a good thing that GRUB 2 is just a bootloader, then. :-)
And again, nobody needs the tools to configure it; they are simply
standardized from what various distributions developed for GRUB Legacy,
but was incompatible from one distribution to the next.
Post by Andrea Conti
I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.
How about "It Just Works". Seriously.
It is a better designed system with most of its functionality pushed
into modules. It is portable to more than just x86, as I've already
mentioned before, and during _that_ whole process, the quality of the
code increased significantly. It is more robust, and from the POV of a
user, maintainer, or packager it is *much* simpler.
When supporting GRUB Legacy, it's almost a necessity to know which
distribution the user installed it with. Why? Because all of them are
different! That is no longer the case with GRUB 2.
I'm not sure how that translates to being more complex. If you are
averse to change, just say so and be done with it. Is it different?
Oh, yes, absolutely. It couldn't be better if it were the same, could
it? ;-)
First, why do we need that much code? If we have less then we dont
have to divide into modules.
Second, it does not translate into complex but rather into too much,
and whenever it is too much than needed, its hard to understand
and THUS complex. Not the other way.
Post by m***@trausch.us
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Neil Bothwick
2012-02-14 21:44:31 UTC
Permalink
Post by LK
Post by m***@trausch.us
I'm not sure how that translates to being more complex. If you are
averse to change, just say so and be done with it. Is it different?
Oh, yes, absolutely. It couldn't be better if it were the same, could
it? ;-)
First, why do we need that much code?
Because there is that much real world. Sure, you and I only need a small
subset of it, but can you guarantee it is the same subset? The idea is
that GRUB2 can work everywhere out of the box, without tweak, hacks and
patches.
--
Neil Bothwick

Cross a tagline and a tribble? You get a full HD...
m***@trausch.us
2012-02-14 23:19:55 UTC
Permalink
Post by LK
First, why do we need that much code?
First, are you talking about source or binary code?

If you're talking about source code, then realize this: Not all that
source is even compiled on your system.

As to the source that *is* compiled on your system, there is:

- A tiny boot loader (max 448 bytes of binary code), which loads
the GRUB core.

- The GRUB bootloader core, which is the GRUB "main" program and
which knows how to talk to different types of modules.

- The modules themselves. There are modules for:

- disk types, including PATA, SCSI, USB, Device Manager, DMRAID,
LVM, LUKS.

- filesystems, including ext2, btrfs, reiserfs.

- partition types, including MBR, GPT, Apple Partition Map.

Each type of module implements exactly the same interface; the core only
needs to know how to talk to that type of module to communicate with all
modules that implement that interface.

The modular design makes it easier to (a) support new platforms, boot
protocols, bus types, partition types, and filesystems, and (b) ensure
that only code necessary for a particular type of thing is loaded.

This design is _necessary_ to deal with today's world. Your computer is
almost certainly setup differently from mine; I require the use of a GPT
module on my system, for example. You may not, if you still use MBR.
In fact, if you're using GRUB Legacy, then you almost certainly do not
require the GPT module on your system (at least not right now).

GRUB 1 assumed BIOS, and assumed MBR. GRUB 2 assumes neither. And for
that matter, supports encrypted disks and logical volume management
(both relatively common especially in servers) without third-party patches.

For the _most_ part, GRUB 2 is simply designed to handle today's world.
It also includes features that distributions developed (independently,
and incompatibly between each other) for GRUB 1 as patches or add-on
programs.
Post by LK
If we have less then we dont
have to divide into modules.
Not true; modules are used in GRUB not because it's too big (once in
32-bit protected mode, all memory becomes available), but to help
organize the system better. This simplifies the design. If I want to,
I can create a new type of filesystem, and then all I have to do to make
sure that GRUB 2 supports it is to write a module that knows how to talk
to it. Nothing changes anywhere else in GRUB. If I create a new type
of firmware, I simply write code that knows how to talk to that type of
firmware, and I am done. Now GRUB 2 still runs on my PC, but also runs
on my new custom computer. And that code for my custom computer never
gets loaded on your computer, because your computer never uses it.

Modules in this case are a structural (design) thing to simplify the
design of the program, not to make it possible to fit in memory or
anything like that.
Post by LK
Second, it does not translate into complex but rather into too much,
and whenever it is too much than needed, its hard to understand
and THUS complex. Not the other way.
Having spent the last 30 minutes looking at the GRUB 2 sources from the
bzr repo, I can tell you that it's very easy to understand; once you
understand how the FS interface works, it's very easy to learn how one
FS module reads a filesystem. And you then gain the understanding
required to write a new, independent module.

Think of GRUB 2's modules as "subprograms" if you must, which implement
a particular (and identical) API for each instance.

If you're interested, I can detail a history for you, and explain why
GRUB 1 was discontinued and why the whole thing was restructured in
detail. I can't right now, as I am about to get on a conference call,
but I can certainly do so later tonight or tomorrow if you want.

What it boils down to, though is that GRUB 1 made assumptions (that
every computer used BIOS, that every computer used MBR partition tables)
which no longer hold true. Because they no longer hold true, it was
necessary to push that functionality into modules with a standardized
interface, in order to support EFI and GPT. That also enabled GRUB 2 to
be able to run on more than one platform, since it no longer made
assumptions that were specific to consumer-class PC systems.

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Tanstaafl
2012-02-15 12:19:47 UTC
Permalink
Post by m***@trausch.us
If you're interested, I can detail a history for you, and explain why
GRUB 1 was discontinued and why the whole thing was restructured in
detail. I can't right now, as I am about to get on a conference call,
but I can certainly do so later tonight or tomorrow if you want.
What I would prefer is a detailed yet simple 'How-To' aimed at the
average user rather than the hacker (in other words, don't assume I can
read code/scripts and understand all or even some of what is happening)
or write my own scripts, etc...

Also, I'd prefer this How-To be aimed at current users of GRUB Legacy,
meaning, 'This is how Legacy did it, but now GRUB2 does it this way, and
for this reason'...

And last, a lot of examples of comparisons of GRUB-Legacy/GRUB2 config
files for different types of systems (obviously, these should include
all of the most common systems, then more esoteric ones can be added by
those using them)...
Neil Bothwick
2012-02-15 12:28:02 UTC
Permalink
Post by Tanstaafl
What I would prefer is a detailed yet simple 'How-To' aimed at the
average user rather than the hacker (in other words, don't assume I can
read code/scripts and understand all or even some of what is happening)
or write my own scripts, etc...
Try gentoo-wiki.com
--
Neil Bothwick

"Do not handicap your children by making their lives easy."
-- Robert Heinlein
Michael Mol
2012-02-15 12:33:40 UTC
Permalink
Post by m***@trausch.us
If you're interested, I can detail a history for you, and explain why
GRUB 1 was discontinued and why the whole thing was restructured in
detail.  I can't right now, as I am about to get on a conference call,
but I can certainly do so later tonight or tomorrow if you want.
What I would prefer is a detailed yet simple 'How-To' aimed at the average
user rather than the hacker (in other words, don't assume I can read
code/scripts and understand all or even some of what is happening) or write
my own scripts, etc...
Also, I'd prefer this How-To be aimed at current users of GRUB Legacy,
meaning, 'This is how Legacy did it, but now GRUB2 does it this way, and for
this reason'...
Just from reading Mike's earlier post, it sounds like the answer to
the bulk of those would be:
1) Legacy GRUB didn't do that. Your distro patched it to do that.
2) GRUB2 does it this way. Because legacy grub didn't do that.
And last, a lot of examples of comparisons of GRUB-Legacy/GRUB2 config files
for different types of systems (obviously, these should include all of the
most common systems, then more esoteric ones can be added by those using
them)...
It sounds like you're asking for a cookbook. (Which is admittedly
something I wondered about yesterday)

Still, it sounds like most of your menuentries could follow a template
like this:

menuentry '$name' --class gnu-linux --class
gnu --class os {
       insmod $partition_table_module
       insmod $filesystem_modules
       set root='(/dev/which_disk,$partition_table_entry_identifier)'
       search --no-floppy --fs-uuid --set=root
$UUID_OF_ROOT_FILESYSTEM
       linux   $path_to_kernel_from_boot root=/dev/root_fs_disk ro

(Shamelessly adapted from Mike's sample. I removed the video and echo,
as I suspect they're not necessary, and I removed the gzio module,
though I don't know what it's needed for)
--
:wq
m***@trausch.us
2012-02-15 14:37:06 UTC
Permalink
Post by Tanstaafl
What I would prefer is a detailed yet simple 'How-To' aimed at the
average user rather than the hacker (in other words, don't assume I can
read code/scripts and understand all or even some of what is happening)
or write my own scripts, etc...
Also, I'd prefer this How-To be aimed at current users of GRUB Legacy,
meaning, 'This is how Legacy did it, but now GRUB2 does it this way, and
for this reason'...
And last, a lot of examples of comparisons of GRUB-Legacy/GRUB2 config
files for different types of systems (obviously, these should include
all of the most common systems, then more esoteric ones can be added by
those using them)...
I can do this, but it's going to take me a day or two. I have to
refresh myself on GRUB Legacy, first. It has been a (long) while since
I've used it.

--- Mike
--
A man who reasons deliberately, manages it better after studying Logic
than he could before, if he is sincere about it and has common sense.
--- Carveth Read, “Logic”
Tanstaafl
2012-02-15 14:47:54 UTC
Permalink
Post by m***@trausch.us
Post by Tanstaafl
What I would prefer is a detailed yet simple 'How-To' aimed at the
average user rather than the hacker (in other words, don't assume I can
read code/scripts and understand all or even some of what is happening)
or write my own scripts, etc...
Also, I'd prefer this How-To be aimed at current users of GRUB Legacy,
meaning, 'This is how Legacy did it, but now GRUB2 does it this way, and
for this reason'...
And last, a lot of examples of comparisons of GRUB-Legacy/GRUB2 config
files for different types of systems (obviously, these should include
all of the most common systems, then more esoteric ones can be added by
those using them)...
I can do this, but it's going to take me a day or two. I have to
refresh myself on GRUB Legacy, first. It has been a (long) while since
I've used it.
Understood, and thanks Mike, I really look forward to reading whatever
you can provide. I realize that I'm gonna have to take this plunge
eventually, and would rather not wait until I'm forced to...
Neil Bothwick
2012-02-15 15:02:35 UTC
Permalink
Post by Tanstaafl
Understood, and thanks Mike, I really look forward to reading whatever
you can provide. I realize that I'm gonna have to take this plunge
eventually, and would rather not wait until I'm forced to...
That was my feeling a year or so ago. I saw no point in installing GRUB
legacy on a new system, so I braced myself for all the horrors I'd heard
about GRUB2, only to find it's nice and sensible once you learn what goes
where. I still have GRUB legacy on some systems as they boot fine so no
point in changing, but new installs always get GRUB2.
--
Neil Bothwick

Like an atheist in a grave: all dressed up and no place to go.
Neil Bothwick
2012-02-14 21:46:57 UTC
Permalink
Post by Andrea Conti
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all.
No it doesn't. so thankfully, outside of your FUD, this is not true.

There are scripts to automatically generate a configuration but
grub-mkconfig is no more compulsory than genkernel - but both can make
life easier when setting up multiple, different systems.
--
Neil Bothwick

Your lack of organisation does not represent an
emergency in my world.
James
2012-02-15 15:57:27 UTC
Permalink
Post by Neil Bothwick
There are scripts to automatically generate a configuration but
grub-mkconfig is no more compulsory than genkernel - but both can make
life easier when setting up multiple, different systems.
Neil et al,

Where is the BEST (gentoo) grub2 documentation?
The last link says that the reason grub2 is still
masked, is the lack of documentation

All I've found so far is:
http://www.gnu.org/software/grub/grub-documentation.html
http://wiki.gentoo.org/wiki/GRUB2
http://dev.gentoo.org/~scarabeus/grub-2-guide.xml
http://blogs.gentoo.org/scarabeus/2011/09/17/grub2-4-months-after/

Any other docs/examples for grub2? Something "dumbed_down" for us
older admins, would be keen....


James
Neil Bothwick
2012-02-15 16:11:13 UTC
Permalink
Post by James
Where is the BEST (gentoo) grub2 documentation?
I'm not saying it's the best, but the one I used to switch over is
http://en.gentoo-wiki.com/wiki/Grub2
--
Neil Bothwick

Bugs are Sons of Glitches
Claudio Roberto França Pereira
2012-02-15 16:28:04 UTC
Permalink
mike, I'd DEFINITELY LOVE to read grub's history, even if it's a short
summary or something.

TOTALLY OFF-TOPIC, but anyone could recommend me a open
source/linux/unix/free software history book? Something that mentioned
the FSF foundation, the GPL creation, the XFree86 -> X.org evolution,
linux [..]. -> 2.4 -> 2.6 evolution, sound stack evolution (OSS, ALSA,
JACK, PA, ESD, Arts, Phonon), multimedia history (ffmpeg, mplayer,
mplayer2, gstreamer, xine, vlc). It could go all the way back to
shell's, like sh, csh, BASH, zsh.
Paul Hartman
2012-02-15 17:17:47 UTC
Permalink
On Wed, Feb 15, 2012 at 10:28 AM, Claudio Roberto França Pereira
Post by Claudio Roberto França Pereira
mike, I'd DEFINITELY LOVE to read grub's history, even if it's a short
summary or something.
TOTALLY OFF-TOPIC, but anyone could recommend me a open
source/linux/unix/free software history book? Something that mentioned
the FSF foundation, the GPL creation, the XFree86 -> X.org evolution,
linux [..]. -> 2.4 -> 2.6 evolution, sound stack evolution (OSS, ALSA,
JACK, PA, ESD, Arts, Phonon), multimedia history (ffmpeg, mplayer,
mplayer2, gstreamer, xine, vlc). It could go all the way back to
shell's, like sh, csh, BASH, zsh.
Not OSS related, but I really enjoyed reading Dennis Ritchie's article
on the history of the C programming language (which also gets into the
early UNIX days):
http://cm.bell-labs.com/cm/cs/who/dmr/chist.html
Doug Hunley
2012-02-15 17:33:06 UTC
Permalink
Post by Neil Bothwick
Post by James
Where is the BEST (gentoo) grub2 documentation?
I'm not saying it's the best, but the one I used to switch over is
http://en.gentoo-wiki.com/wiki/Grub2
One thing I don't see addressed is having /boot on a RAID1 setup. For
Grub Legacy, I do:
grub > device (hd0) /dev/sda
grub > root (hd0,0)
grub > setup (hd0)

then repeat for sdb, sdc, and sdd

Does Grub2 deal w/ this better or the same?
--
Douglas J Hunley (***@gmail.com)
Twitter: @hunleyd                                               Web:
douglasjhunley.com
G+: http://goo.gl/sajR3
Neil Bothwick
2012-02-15 17:40:12 UTC
Permalink
Post by Doug Hunley
Post by Neil Bothwick
I'm not saying it's the best, but the one I used to switch over is
http://en.gentoo-wiki.com/wiki/Grub2
One thing I don't see addressed is having /boot on a RAID1 setup. For
grub > device (hd0) /dev/sda
grub > root (hd0,0)
grub > setup (hd0)
then repeat for sdb, sdc, and sdd
Does Grub2 deal w/ this better or the same?
I do it just the same. It's not really a GRUB thing, the BIOS needs
somewhere to load GRUB from, whatever the version number.
--
Neil Bothwick

I thought I saw the light at the end of the tunnel...
but it was just some sod with a torch bringing me more work!
n***@gmail.com
2012-02-15 08:10:10 UTC
Permalink
Post by Andrea Conti
Post by LK
PS: If you know how to get rid of any background image, could you
say how?
Remove or comment out any "splashimage" directives from the config file.
***
Re grub2: as long as grub0 works, I really don't care if grub2 is
better, cleaner, shinier, more modern or anything else.
I don't need a freakin' whole OS to boot linux, and having a
configuration that is so convoluted that it *has to* be generated by
running a set of scripts makes no sense at all. I thought the days of m4
and sendmail.cf were over a long time ago...
I am sure grub2 can be made to work, but for a piece of software as
vital as a boot loader, that level of complexity in my opinion is
totally unreasonable and impossible to justify.
andrea
You have a point. I'm sure grub or something like it, will be developed as
an alternative to grub2, just as various alternative DM's are. As for me, I
don't really care, just as long as I can boot the damn kernel by typing a
few commands at a grub prompt, I'm happy. ;)

Terry
James
2012-02-14 20:57:33 UTC
Permalink
Post by Florian Philipp
sys-boot/grub has two slots. The default slot 0 with version numbers
around 0.92-0.97 is grub-1 (or grub legacy). Slot 2 with version numbers
around 1.99 is grub-2. Because it is still in development hell, it has
not reached version 2.00.
OK, this part I understand.
Post by Florian Philipp
IIRC, sys-boot/grub-static is mostly there for systems that cannot
compile grub, for example AMD64 no-multilib profiles.
OK, from the handbook....
Thanks for clearing that up.

The second part of this question, is what version of grub do I use
with an AMD64 RAID-1-workstation install that will use this
(multilib) profile:

[5] default/linux/amd64/10.0/desktop/kde *

But I intend to put RAID-1 on the boot/root/swap partitions.
ext2 and ext4 FS for boot/root.

Any preferred version of grub (grub-1) will do ?

Trying to use this document:
http://en.gentoo-wiki.com/wiki/RAID/Software
The advice about grub (1 vs 2) and mdadm RAID-metadata
all confuses the grub choice for me.

Should I use Grub-1 ? or Grub-2 ?

Or maybe I should just do a traditional gentoo (handbook) install
and then migrate to a RAID-1 workstation, via this document:

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

I've spent countless hours on numerous attempts to do it all in
one install, and grub will not boot for me.

IDEAS?


James
Stefano Crocco
2012-02-14 18:07:06 UTC
Permalink
Il giorno Tue, 14 Feb 2012 17:36:28 +0000 (UTC)
Post by james
Googling around, I get the impression
that 'grub' is now grub 2. Is that
correct?
In portage I see grub-static
(GRUB Legacy boot loader)
with version numbers that coincide with
"grub" (grub2 ?).
If grub2 has replaced "grub-1" what (gentoo)
version number did grub2 first take take?
What was the last (gentoo) version number for
grub 1 that was actually grub1 , or have I
confused these details?
I cannot seem to find these details in the release
notes or as part of the sourcecode. Any suggestions
on that would be keen.
James
If I understand correctly your question, versions 0.9x are grub 1, while
versions 1.9x are grub 2. You can also distinguish them according to their
slots: grub 1 ebuilds have slot 0, while grub 2 ebuilds have slot 2.

Stefano
Continue reading on narkive:
Loading...