[gentoo-user] Grub2 and is the upgrade a tooth puller.

June 25th, 2012 - 01:10 am ET by Dale | Report spam
Howdy,

It appears that grub2 is coming soon. Thread on -dev said a couple
months or so till it hits the tree, keyworded and/or masked I'm sure. I
guess it is about time to jump off the cliff and give this a try. I
installed Kubuntu on a system for my brother and it uses grub2. I have
had to edit the config and then run the update script. I have sort of
installed and made a config change to grub2, even tho it was only once.
Basically, I sort of seen the thing at least. o_O

My first question is, how hard is this to change from old grub to
grub2? I only run Gentoo here, no windoze at all and no other distro
either. I figure that may make it easier. I must confess tho, I'm a
hoarder of kernels. LOL I generally have several versions of them on
here. Is there a way for it to only see say the last 3 versions or so?
I only have three right now but I cleaned out all the non-init kernels a
while back. Given time, I may have a dozen or so. I would rather not
have that many lines on the grub screen when booting.

Also, will it know what init thingy image to connect the kernels too? I
name my kernels with the version and name the init thingy with a similar
name. Looks someting like this:

root@fireball / # ls -al /boot/bzImage-3.*
-rw-r--r-- 1 root root 4740064 May 16 20:25 /boot/bzImage-3.3.5-2
-rw-r--r-- 1 root root 4758496 May 23 13:09 /boot/bzImage-3.4.0-1
-rw-r--r-- 1 root root 4758816 Jun 14 09:00 /boot/bzImage-3.4.2.r1-1
root@fireball / # ls -al /boot/initramfs-3.*
-rw-r--r-- 1 root root 3560934 May 12 05:03 /boot/initramfs-3.3.5-1.img
-rw-r--r-- 1 root root 3560423 May 23 13:10 /boot/initramfs-3.4.0.img
-rw-r--r-- 1 root root 3561170 Jun 14 09:05 /boot/initramfs-3.4.2.img
root@fireball / #

There are times when I may have more than one kernel but only one init
thingy tho. So far, one init thingy will work with any kernel of that
version. I have not tried mixing tho.

Also, how much disk space does grub take up on /boot? Mine is on a
separate partition and I hope it is large enough.

Thoughts. Info.

Thanks in advance.

Dale

:-) :-)

I am only responsible for what I said ... Not for what you understood or how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
email Follow the discussionReplies 76 repliesReplies Make a reply

Similar topics

Replies

#1 Canek Peláez Valdés
June 25th, 2012 - 02:10 am ET | Report spam
On Mon, Jun 25, 2012 at 12:05 AM, Dale wrote:
Howdy,



Hi Dale.

It appears that grub2 is coming soon.  Thread on -dev said a couple
months or so till it hits the tree, keyworded and/or masked I'm sure.  I
guess it is about time to jump off the cliff and give this a try.  I
installed Kubuntu on a system for my brother and it uses grub2.  I have
had to edit the config and then run the update script.  I have sort of
installed and made a config change to grub2, even tho it was only once.
Basically, I sort of seen the thing at least.  o_O

My first question is, how hard is this to change from old grub to
grub2?



It's a completely new beast. Almost none of the old grub-legacy
related knowledge works for GRUB2.

 I only run Gentoo here, no windoze at all and no other distro
either.  I figure that may make it easier.  I must confess tho, I'm a
hoarder of kernels.  LOL   I generally have several versions of them on
here.  Is there a way for it to only see say the last 3 versions or so?
I only have three right now but I cleaned out all the non-init kernels a
while back.  Given time, I may have a dozen or so.  I would rather not
have that many lines on the grub screen when booting.



You can edit the config file (you first need to give it the
appropriate permissions), and remove from it the kernels you don't
want. Also, you can move the kernels/initramfs' from /boot into a temp
directory when running the grub2-mkconfig script.

Also, will it know what init thingy image to connect the kernels too?  I
name my kernels with the version and name the init thingy with a similar
name.  Looks someting like this:

/ # ls -al /boot/bzImage-3.*
-rw-r--r-- 1 root root 4740064 May 16 20:25 /boot/bzImage-3.3.5-2
-rw-r--r-- 1 root root 4758496 May 23 13:09 /boot/bzImage-3.4.0-1
-rw-r--r-- 1 root root 4758816 Jun 14 09:00 /boot/bzImage-3.4.2.r1-1
/ # ls -al /boot/initramfs-3.*
-rw-r--r-- 1 root root 3560934 May 12 05:03 /boot/initramfs-3.3.5-1.img
-rw-r--r-- 1 root root 3560423 May 23 13:10 /boot/initramfs-3.4.0.img
-rw-r--r-- 1 root root 3561170 Jun 14 09:05 /boot/initramfs-3.4.2.img
/ #



The grub2-mkconfig script should recognize the correct initramfs for
each kernel.

There are times when I may have more than one kernel but only one init
thingy tho.  So far, one init thingy will work with any kernel of that
version.  I have not tried mixing tho.

Also, how much disk space does grub take up on /boot?  Mine is on a
separate partition and I hope it is large enough.



Mine uses around 8MB:

# du -sh /boot/grub2/
7.9M /boot/grub2/

Thoughts.  Info.



I upgraded to GRUB 2 because of ext4, since grub-legacy upstream
doesn't handle ext4 (and, apparently, never will). However, the Gentoo
ebuild applies the patch from

http://code.google.com/p/grub4ext4/

and it's my impression it will continue to apply said patch in the
future, so grub-legacy on Gentoo supports ext4. Given that, I really
don't see an advantage to use GRUB2, except that it will be the one
being maintained in the future, and when UEFI hardware becomes the
standard (if ever), you will probably need it..

Besides ext4 upstream support, GRUB2 allows to use higher screen
resolutions for the graphical menu. That's about it's only advantage
over grub-legacy, and it's a very shallow one. The new configuration
format and the script to generate it are not flexible, and its
documentation is sorely lacking. I really think you should stick with
grub-legacy while Gentoo supports it.

I keep using GRUB2 in my desktop and laptop, buy I didn't migrated my
servers nor my media center to it, nor plan to do it. I see no reason
for it.

And being honest, I hope that something else replaces GRUB2; I like
the notion of a /firstboot minimal Linux as boot loader, or something
similar. If the boot loader has to do OS-related work (graphics/input
drivers and stuff like that), I think using Linux directly is better
than re-implementing something twice (and probably in the wrong
manner) as GRUB2 is doing.

So, in short: I don't recommend switching to GRUB2. And I'm using it.

Either wait for its documentation and tools to mature (i.e., when they
finally hit the 2.0 version), or wait for something else to handle the
future of Linux boot loader. Meanwhile, if you don't use UEFI, you
really don't need GRUB2. So stick to grub-legacy.

My 0.02 ${CURRENCY}.

Regards.
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México
Replies Reply to this message
#2 Neil Bothwick
June 25th, 2012 - 04:40 am ET | Report spam

On Mon, 25 Jun 2012 00:05:25 -0500, Dale wrote:

It appears that grub2 is coming soon. Thread on -dev said a couple
months or so till it hits the tree, keyworded and/or masked I'm sure. I
guess it is about time to jump off the cliff and give this a try.



If GRUB legacy is working for you, I see no need to change. I put GRUB 2
on new installs but haven't seen any reason to switch over existing
systems.

On the other hand, if you want to learn more about it, go for it!
I
My first question is, how hard is this to change from old grub to
grub2?



The same as installing GRUB 2 from scratch. I would waste time trying to
have both installed (I'm not sure if that's even supported any more)
as it's easy enough to reinstall legacy from a live CD if you have to, but
keep your menu.lst.

I must confess tho, I'm a
hoarder of kernels. LOL I generally have several versions of them on
here. Is there a way for it to only see say the last 3 versions or so?
I only have three right now but I cleaned out all the non-init kernels a
while back. Given time, I may have a dozen or so. I would rather not
have that many lines on the grub screen when booting.



You could edit the script that searches for an adds Linux kernels, or
disable it. I use the custom script to add my own entries at the top of
the menu and let the standard 10_linux script add all detected kernel
below. It lists them most recent first, so any excess of kernels falls
off the bottom of the screen :)

Also, will it know what init thingy image to connect the kernels too? I
name my kernels with the version and name the init thingy with a similar
name. Looks someting like this:

/ # ls -al /boot/bzImage-3.*
-rw-r--r-- 1 root root 4740064 May 16 20:25 /boot/bzImage-3.3.5-2
-rw-r--r-- 1 root root 4758496 May 23 13:09 /boot/bzImage-3.4.0-1
-rw-r--r-- 1 root root 4758816 Jun 14 09:00 /boot/bzImage-3.4.2.r1-1
/ # ls -al /boot/initramfs-3.*
-rw-r--r-- 1 root root 3560934 May 12 05:03 /boot/initramfs-3.3.5-1.img
-rw-r--r-- 1 root root 3560423 May 23 13:10 /boot/initramfs-3.4.0.img
-rw-r--r-- 1 root root 3561170 Jun 14 09:05 /boot/initramfs-3.4.2.img



That should work, although I do not use a separate initramfs file so I
haven't tried it.

There are times when I may have more than one kernel but only one init
thingy tho. So far, one init thingy will work with any kernel of that
version. I have not tried mixing tho.



Use symlinks, or a custom menu.

Also, how much disk space does grub take up on /boot? Mine is on a
separate partition and I hope it is large enough.



% df /boot
Filesystem Type Size Used Avail Use% Mounted on
/dev/md0 ext2 482M 406M 51M 89% /boot

However, 380MB of that is a System Rescue CD ISO, one of the nice things
about GRUB 2 is that you can boot straight fro the ISO, no need to go
hunting for a CD when you need a live boot (unless the reaso you need a
live boot is that you screwed up GRUB :)

% du /boot/grub2
1.5M /boot/grub2

A GRUB legacy box here gives

% du /boot/grub
990K /boot/grub

so not much difference.

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"



This is redundant now, portage has gone back to the old method of
spamming your screen with compiler output when using --jobs 1.


Neil Bothwick

Home is where you hang your @.



Replies Reply to this message
#3 Paul Hartman
June 25th, 2012 - 12:00 pm ET | Report spam
On Mon, Jun 25, 2012 at 1:02 AM, Canek Peláez Valdés wrote:


And being honest, I hope that something else replaces GRUB2; I like
the notion of a /firstboot minimal Linux as boot loader, or something
similar. If the boot loader has to do OS-related work (graphics/input
drivers and stuff like that), I think using Linux directly is better
than re-implementing something twice (and probably in the wrong
manner) as GRUB2 is doing.



Interestingly, Ubuntu, who has been a big supporter of GRUB2, is
moving away from it because of license incompatibility with UEFI
secure boot. They are going to use efilinux instead and are planning
to extended it to have a simple boot menu interface.
Replies Reply to this message
#4 walt
June 25th, 2012 - 04:40 pm ET | Report spam
On 06/24/2012 10:05 PM, Dale wrote:
I only run Gentoo here, no windoze at all and no other distro
either.



I agree with Canek. The only reason I switched to grub2 is that
I have an outboard docking station that I don't always power on.

That causes the BIOS to change the order of the drives when I
reboot with the docking station powered up, and then the kernel
can't find the boot drive. Very silly problem, really, and
maybe this particular BIOS is dumber than most, dunno.

But grub2 can search for the boot drive based on the disk label
or UUID, so that particular problem is gone now.
Replies Reply to this message
#5 Maxim Wexler
June 25th, 2012 - 11:00 pm ET | Report spam
I mostly gentoo, but ubuntu has this marvellous tool 'boot-repair'
based on grub2 in the yannbuntu repo. With one click it finds all the
bootable partitions on your box, writes and installs the grub.cfg.
Next time you boot viola! there's all your OSes ready to be started.

On 6/25/12, walt wrote:
On 06/24/2012 10:05 PM, Dale wrote:
I only run Gentoo here, no windoze at all and no other distro
either.



I agree with Canek. The only reason I switched to grub2 is that
I have an outboard docking station that I don't always power on.

That causes the BIOS to change the order of the drives when I
reboot with the docking station powered up, and then the kernel
can't find the boot drive. Very silly problem, really, and
maybe this particular BIOS is dumber than most, dunno.

But grub2 can search for the boot drive based on the disk label
or UUID, so that particular problem is gone now.




Replies Reply to this message
Help Create a new topicNext page Replies Make a reply
Search Make your own search