Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] grub vs grub 2
Date: Tue, 14 Feb 2012 20:50:40
Message-Id: CA+czFiCOAS0xDgrgphsEJ6ZYu8C9Rc0c4V_wkUehwDpM3pWEsA@mail.gmail.com
In Reply to: Re: [gentoo-user] grub vs grub 2 by "mike@trausch.us"
1 On Tue, Feb 14, 2012 at 3:35 PM, mike@×××××××.us <mike@×××××××.us> wrote:
2 > On 02/14/2012 02:04 PM, Michael Mol wrote:
3 >> A detailed elaboration would be nice.
4 >>
5 >> A contrasting migration guide, complete with the how's, where's and
6 >> why's would be awesome. (Once one's invested in understanding a tool,
7 >> a 1-2-3-itsmagic walkthrough is very discomforting.)
8 >
9 > While there are many different points that differ between the two, the
10 > biggest are:
11 >
12 >  - Supported upstream.
13 >
14 >  - Can boot from GPT as well as MBR partition table types, regardless
15 >    of whether EFI is in use or not.  Also supports the use of Apple
16 >    Partition Maps, BSD disk labels, and others through modules.
17 >
18 >  - Doesn't require patching to deal with modern situations; you can
19 >    download upstream source code and it will work, unlike GRUB Legacy.
20 >
21 >  - Can boot from virtually any filesystem you would want to use,
22 >    not just a small handful of them; includes ISO9660, UDF, Reiser,
23 >    btrfs, NTFS, ZFS, HFS and HFS+, among others.
24 >
25 >  - Supports selecting filesystems by UUID without distribution-specific
26 >    patches, for filesystem types that can be identified by UUIDs.
27 >
28 >  - Can be booted from BIOS or EFI on the PC, and no longer depends on
29 >    the existence of any particular type of firmware (no more probing
30 >    for BIOS boot drives, which can fail on many different systems).
31 >
32 >    This means that GRUB 2 doesn't have to be hand-installed on systems
33 >    GRUB Legacy couldn't figure out for whatever reason.  And yes, there
34 >    were a good number of them, where LILO was the only choice due to
35 >    its use of block maps (another not-so-robust booting mechanism which
36 >    required significantly more maintenance than GRUB does).
37 >
38 >  - Can boot Linux, the BSDs, any Multiboot or Multiboot2 kernel, and
39 >    EFI applications.
40 >
41 >  - Supports El Torito natively on platforms that use it (e.g., BIOS)
42 >    to boot optical media, meaning that it is possible to use GRUB 2
43 >    boot anything that can be burned to an optical disk.  This makes it
44 >    easier to work with testing environments burned to any form of
45 >    optical disk.
46 >
47 >  - Better code quality than GRUB Legacy, with more loose coupling
48 >    between components and making it possible for people to more easily
49 >    write GRUB modules than with GRUB Legacy.  Additionally, nearly
50 >    anything that would have been a patch to GRUB Legacy can be written
51 >    as a module in GRUB 2, making it easier to share modules between
52 >    distributions.  This also means it is *much* more portable.
53 >
54 >  - Can be run as an EFI application on modern systems using EFI, such
55 >    as Intel-based Macintosh systems, without requiring BIOS emulation.
56 >    It can also emulate an EFI environment for things which require it
57 >    in order to boot.
58 >
59 >  - Eliminates dependence on BIOS in order to determine available boot
60 >    devices.  This empowers GRUB to be able to boot without firmware
61 >    assistance from many different mediums, including USB and PXE, even
62 >    without firmware support.
63 >
64 >  - Supports booting from Linux device-mapper and LVM2 configurations,
65 >    as well as encrypted partitions.
66 >
67 >  - Supports kernels > 16 MB in size without patches.  This can happen
68 >    when you compile a purely static kernel and support a great deal of
69 >    options without putting them into modules.  Not common, but does
70 >    happen.
71 >
72 > Additionally, GRUB 2 standardizes (upstream) a number of things which
73 > were developed independently by various distributions as patches for
74 > GRUB Legacy.  Gentoo's legacy GRUB is heavily patched,
75 >
76 > The configuration file isn't terribly difficult to figure out, either;
77 > as I've mentioned before, there is *absolutely* no requirement to use
78 > grub2-mkconfig, it just makes life easier.
79 >
80 > For example, here is the entry that boots my current kernel:
81 >
82 > menuentry 'GNU/Linux, with Linux 3.2.5-gentoo' --class gnu-linux --class
83 > gnu --class os {
84 >        load_video
85 >        insmod gzio
86 >        insmod part_gpt
87 >        insmod ext2
88 >        set root='(/dev/sda,gpt2)'
89 >        search --no-floppy --fs-uuid --set=root
90 > 3820beff-80b5-4d05-b989-3ab9265bc2a3
91 >        echo    'Loading Linux 3.2.5-gentoo ...'
92 >        linux   /vmlinuz-3.2.5-gentoo root=/dev/sda3 ro
93 >
94 > Adding an entry is no more complex as it was before; copy, paste, edit.
95 >  Simple.  No commands necessary since GRUB reads the grub.cfg file from
96 > the filesystem when it loads, and doesn't embed it anywhere.
97 >
98 > (And yes, I have a separate /boot; reason being is that it is mounted -o
99 > sync, that is, when it is mounted at all.  At least on my primary
100 > desktop system; /boot is actually on the root fs on most of my systems.)
101 >
102 > There will be a day when GRUB Legacy won't be supported by distributions
103 > at all.  There's no need to maintain multiple bootloaders (and upstream
104 > refuses to do so, reasonably), and many of the tricks, patches and
105 > workarounds of old are no longer necessary with GRUB 2.
106 >
107 > Also, it becomes possible to use the Linux kernel's long-existing
108 > installation hook to automatically update the boot list when you "make
109 > install modules_install" a new kernel image, making kernel installation
110 > literally a single step after the build.  Many different distributions
111 > did this before by implementing scripts that do what grub2-mkconfig does
112 > with GRUB 2, but for GRUB Legacy.  Now, that's standard and upstream so
113 > that there isn't fragmentation.
114 >
115 > All told, GRUB 2 is *significantly* simpler, especially from the POV of
116 > someone who installs, maintains and fixes systems for a living but also
117 > from the POV of distribution packagers and maintainers.
118
119 Very nice, thanks.
120
121
122 --
123 :wq