View previous topic :: View next topic |
Author |
Message |
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 5:44 am Post subject: Impending forced migration to grub2 |
|
|
Just noticed the following while emerging:
Code: |
# William Hubbs <williamh@gentoo.org> (13 Jan 2019)
# Multiple open bugs including build failures, dead upstream.
# Please see the following URL for instructions for migrating to grub 2.
# https://wiki.gentoo.org/wiki/GRUB2_Migration
# Removal on 1 Feb 2019 (bug #674364)
|
I've tried grub2 on a test VM, and frankly, the default installation it's overly complex to easily configure and manage.
Grub2 has so many hidden 'features', gotchas, config files scattered all over the place.
There's defaults in /etc/default/grub, config tweaks and stuff I don't want, and don't think I need in /etc/grub.d, always have to run grub-mkconfig which spews 100's of lines of obscure and incomprehensible code.
Unless I accepted how IT wanted to work, accepted that it would do what it wanted, and not how I want / need it to work, it was hopeless.
In short, a real PITA. So much so that I masked it off from coming in. What's wrong with small and simple?
I have played around with a zfs root / boot file system, forced to use grub2, and I'd like to mimic Solaris's abeadmin (found a free BSD script that just needs to default to the selected kernel / root data set). Programatically updating grub legacy configs would be possible, but programatically updating grub2 configs in nigh impossible. So much so, that project is stalled.
Wasn't it a long held UNIX value that small and simple is beautiful?
So I pose the question: Where is a reference, guide, or hints to make grub2 work and look like grub legacy? Simple 3 line kernel entry in grub.conf, that's all I want / need.
I really don't want all the excess baggage, headache and hassles of grub2.
Are there any options? |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Sat Jan 19, 2019 6:50 am Post subject: Re: Impending forced migration to grub2 |
|
|
eohrnberger wrote: | So I pose the question: Where is a reference, guide, or hints to make grub2 work and look like grub legacy? Simple 3 line kernel entry in grub.conf, that's all I want / need. | I had a similar question. A basic config file was surprisingly (to me anyway) fairly simple. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 6:53 am Post subject: Re: Impending forced migration to grub2 |
|
|
pjp wrote: | eohrnberger wrote: | So I pose the question: Where is a reference, guide, or hints to make grub2 work and look like grub legacy? Simple 3 line kernel entry in grub.conf, that's all I want / need. | I had a similar question. A basic config file was surprisingly (to me anyway) fairly simple. |
Ahh, there's the answer.
Now this is much more like it, and without need to run grub-mkconfig
Much appreciated. Now, to add the needed pieces to support booting from zfs . . . tomorrow. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Jan 19, 2019 9:20 am Post subject: Re: Impending forced migration to grub2 |
|
|
eohrnberger wrote: | What's wrong with small and simple?
Wasn't it a long held UNIX value that small and simple is beautiful? |
As a LILO user of 15+ years, I wonder the same... no forced migration here. |
|
Back to top |
|
|
Goverp Advocate
Joined: 07 Mar 2007 Posts: 2008
|
Posted: Sat Jan 19, 2019 11:44 am Post subject: |
|
|
I'm just going to ignore the change and continue with grub-2 masked. Grub-legacy works for me, I'll leave it installed When I finally get a new box, it will have EFI partitions, so I'll use rEFInd.
It's right to remove Grub-legacy from the options for new installations, but if it works for you and your happy with the slight frisson of fear from its lack of support, continue using it. Removing it from portage doesn't remove it from your system (assuming you have Grub-2 masked). _________________ Greybeard |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6098 Location: Dallas area
|
Posted: Sat Jan 19, 2019 12:33 pm Post subject: |
|
|
If you want to keep using grub-1 then just copy it to your local portage repository. I did that with grub-static, who cares what Hubbs says. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54244 Location: 56N 3W
|
Posted: Sat Jan 19, 2019 2:02 pm Post subject: |
|
|
What Anon-E-moose said.
Your boot loader is part of your firmware. I don't understand to rush to move to grub2 on a perfectly working system.
Its not like your boot loader is a threat vector.
When I build my next system, I'll look at syslinux rather than grub2. I've already dipped a toe in the water, as I have one install that used to net boot.
It now has an ssd but I kept the boot system the same. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 4:49 pm Post subject: |
|
|
Thanks pjp. Your pointer got me started.
I now can boot my zfs root dataset with a tweaked minimal grub.cfg.
Now, to adapt the abeadm to programatically edit the grub.cfg so that when that script is used to designate the active boot environment, it'll make that the default menu entry.
More Googling, I'm thinking. |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sat Jan 19, 2019 4:50 pm Post subject: Re: Impending forced migration to grub2 |
|
|
Ant P. wrote: | eohrnberger wrote: | What's wrong with small and simple?
Wasn't it a long held UNIX value that small and simple is beautiful? |
As a LILO user of 15+ years, I wonder the same... no forced migration here. |
I had a bad tendency to forget to re-run lilo after a new kernel build, so I had to keep rescue media handy. That's probably my favorite thing about grub (grub-0.97) - no getting "li" or whatever the heck at boot time. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 4:51 pm Post subject: Re: Impending forced migration to grub2 |
|
|
Ant P. wrote: | eohrnberger wrote: | What's wrong with small and simple?
Wasn't it a long held UNIX value that small and simple is beautiful? |
As a LILO user of 15+ years, I wonder the same... no forced migration here. |
True. Hmm. Does LILO support booting a root file system which is in a zfs dataset? Didn't think it did.
I know that grub2 does. I know that Oracle had a grub legacy which was able to, but don't think that was released to open source.
ALl things considered, looks like going forward with grub2 is the right direction at this time. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Sat Jan 19, 2019 4:52 pm Post subject: |
|
|
@eohrnberger: You're welcome.
Anon-E-moose wrote: | If you want to keep using grub-1 then just copy it to your local portage repository. I did that with grub-static, who cares what Hubbs says. | Well, lack of upstream support is reasonable. However, not having it easily accessible in the tree for rebuilds is yet one more inconvenience. The list of managing around the distro grows and grows and is becoming cumbersome. Perhaps by design. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 5:02 pm Post subject: |
|
|
NeddySeagoon wrote: | What Anon-E-moose said.
Your boot loader is part of your firmware. I don't understand to rush to move to grub2 on a perfectly working system.
Its not like your boot loader is a threat vector.
When I build my next system, I'll look at syslinux rather than grub2. I've already dipped a toe in the water, as I have one install that used to net boot.
It now has an ssd but I kept the boot system the same. |
Hey Neddy.
Took a quick look at syslinux, last update seems to be a few years back. Is it that stable and feature complete?
Lastly, does it support zfs? Do you know off hand? I didn't see anything on their Wiki about that. |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sat Jan 19, 2019 5:28 pm Post subject: |
|
|
As another aside, I have one EFI system, probably more to come. Right now I'm using a non-portage rEFInd on the EFI system, but in the coming weeks I'm probably moving everything to grub2. I need to better understand grub2 for work anyway. I need to look at the "grub2 like grub1" instructions on this thread more carefully. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sat Jan 19, 2019 5:40 pm Post subject: |
|
|
I'll contribute the following as a working (for me anyway) root on zfs grub2.cfg
Code: |
default=0
timeout=30
terminal_input console
terminal_output console
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
insmod gzio
insmod part_msdos
insmod zfs
insmod linux
set root='hd0,msdos2'
menuentry 'kernel-genkernel-x86_64-4.14.65-gentoo rpool/ROOT/default' {
echo 'Loading Linux x86_64-4.14.65-gentoo rpool/ROOT/default'
linux /BOOT@/kernel-genkernel-x86_64-4.14.65-gentoo root=ZFS=rpool/ROOT/default ro
echo 'Loading initial ramdisk ...'
initrd /BOOT@/initramfs-genkernel-x86_64-4.14.65-gentoo
}
|
Critique and feedback always welcome. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Jan 19, 2019 8:45 pm Post subject: Re: Impending forced migration to grub2 |
|
|
depontius wrote: | Ant P. wrote: | eohrnberger wrote: | What's wrong with small and simple?
Wasn't it a long held UNIX value that small and simple is beautiful? |
As a LILO user of 15+ years, I wonder the same... no forced migration here. |
I had a bad tendency to forget to re-run lilo after a new kernel build, so I had to keep rescue media handy. That's probably my favorite thing about grub (grub-0.97) - no getting "li" or whatever the heck at boot time. |
Haven't had that problem in a long time - `make install` in the kernel tree automatically runs it. |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sat Jan 19, 2019 9:27 pm Post subject: |
|
|
depontius wrote: | As another aside, I have one EFI system, probably more to come. Right now I'm using a non-portage rEFInd on the EFI system, but in the coming weeks I'm probably moving everything to grub2. I need to better understand grub2 for work anyway. I need to look at the "grub2 like grub1" instructions on this thread more carefully. |
If you need it for work, that's one thing. However, there is nothing you can do with grub2 that you can't do with refind and probably easier with refind.
My non-EFI boxes are grub legacy, the EFI boxes are refind. refind can launch grub2 if you want. It's in the wiki, but for home use forget grub 2 and the stub kernel. Use refind and never edit a configuration because you built a new kernel again.
Two caveats from my two installations. You MUST run refind-install within a UEFI environment even if your mobo offers dual legacy and EFI. Use of an EFI booted sysresecuecd or sysrecuecd USB stick (faster) and chrooting into your working legacy boot installation is recommended (by me).
Second warning. I had a panic when I removed the hard drive, inserted another then went back to the first HDD. This appears to be a BIOS problem with some mobos (including mine). If you ever boot with the drive out, the BIOS forgets all about it and you have to run refind-install and efibootmgr all over again. This is because EFI boot is partly in the BIOS, unlike legacy boot that was in the BIOS, but the BIOS made no choices other than what drive to boot. Everything else was on the drive using a simple very old mechanism. The EFI BIOS does more than that and efibootmgr actually fiddles with your mobo's NVRAM.
I dislike getting into personalities but sad experience has taught me that if WilliamH was involved, it probably was done wrong. I have masked all his projects and run the old rescued ebuilds in local repo. |
|
Back to top |
|
|
Duncan Mac Leod Guru
Joined: 02 May 2004 Posts: 312 Location: Germany
|
Posted: Sat Jan 19, 2019 9:33 pm Post subject: Re: Impending forced migration to grub2 |
|
|
pjp wrote: | eohrnberger wrote: | So I pose the question: Where is a reference, guide, or hints to make grub2 work and look like grub legacy? Simple 3 line kernel entry in grub.conf, that's all I want / need. | I had a similar question. A basic config file was surprisingly (to me anyway) fairly simple. |
THANK YOU ! |
|
Back to top |
|
|
miket Guru
Joined: 28 Apr 2007 Posts: 488 Location: Gainesville, FL, USA
|
Posted: Sat Jan 19, 2019 11:16 pm Post subject: |
|
|
I decided long ago that even with a simple configuration Grub 2 was way too big and messy for my needs. Around that time I found out about extlinux in the Syslinux package and started using it for all new setups (but I did not bother the boot loader of any machines already using Grub 1).
It is quite true that Extlinux has a more limited set of filesystems than Grub 2, but you could get around that by using a non-ZFS boot FS for the kernel and a bit of Busybox-based early userspace to mount and start the ZFS root partition. You would copy new kernels to the boot filesystem as usual and edit line(s) in extlinux/extlinux.conf as needed. It sounds like it would be about as easy to make your abeadmin script work with Extlinux as it would be for Grub 1. Extlinux does not require running a configuration-builder script.
I wrote a Busybox-ash init script to start LVM, mount the root partition (the name of which I fetch from the real_root kernel-command-line parameter), and start /sbin/init on the root partition. I never have to edit that script. My original way of doing this early boot uses the boot partition as the original root filesystem rather than an initramfs; later I made my own special cpio builder to make an initramfs from components indicated in a configuration file. As with the init script, I never have to alter the initramfs. It's a bit of work to set it up at first, but updating kernels is no hassle at all.
(I've always steered way from EFI, but I would bet that the initramfs variant of my setup would work OK.).
There are (ahem) certain developers who don't like Busybox, but I'm not one of them. |
|
Back to top |
|
|
Irre Guru
Joined: 09 Nov 2013 Posts: 434 Location: Stockholm
|
Posted: Sat Jan 19, 2019 11:25 pm Post subject: |
|
|
I stick to LILO and grub:0 as long as possible. My IQ is too low for grub:2 |
|
Back to top |
|
|
saboya Guru
Joined: 28 Nov 2006 Posts: 552 Location: Brazil
|
Posted: Sun Jan 20, 2019 12:00 am Post subject: |
|
|
depontius wrote: | As another aside, I have one EFI system, probably more to come. Right now I'm using a non-portage rEFInd on the EFI system, but in the coming weeks I'm probably moving everything to grub2. I need to better understand grub2 for work anyway. I need to look at the "grub2 like grub1" instructions on this thread more carefully. |
Why would you migrate from rEFInd to grub2? Can't see any benefit in doing so. |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sun Jan 20, 2019 12:22 am Post subject: |
|
|
saboya wrote: | depontius wrote: | As another aside, I have one EFI system, probably more to come. Right now I'm using a non-portage rEFInd on the EFI system, but in the coming weeks I'm probably moving everything to grub2. I need to better understand grub2 for work anyway. I need to look at the "grub2 like grub1" instructions on this thread more carefully. |
Why would you migrate from rEFInd to grub2? Can't see any benefit in doing so. |
Two reasons... First, my work machines use grub2, and I frequently help others with their problems. So I really ought to understand grub2 better, so I'm prepared to help them. Second, I generally like to stick with "live" software, so even though people will say there are no problems with grub-0.97, I'm not sure I like sticking with it, even though I can copy it to my local portage tree and make sure I don't delete the source.
Moving to grub2, though not optimal in some ways, makes my work machines, my BIOS machines, and my one EFI machine all more similar. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Sun Jan 20, 2019 2:03 am Post subject: |
|
|
I have rEFInd on my laptop. I don't understand the appeal. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sun Jan 20, 2019 2:33 am Post subject: |
|
|
pjp wrote: | I have rEFInd on my laptop. I don't understand the appeal. |
The non-portage rEFInd I'm currently using doesn't allow you to specify a kernel command line, which is annoying. I looked at the Gentoo rEFInd page, and I think maybe it's a newer version and does.
The other part of my move is that I got an SSD from Santa Wife, and when I get the time plan to put it into this system, copying my existing installation. So I'll have to do some sort of boot manager installation. It's going to be either grub2 or the portage version of rEFInd. Right now I'm half expecting that I'm going to have to boot my system from rescue media to boot from the new drive - I won't be able to chroot into the copied installation from the old one and install either rEFInd or grub from there and have it work upon next boot. After swapping hard drives, that is. The new drive will be USB-attached to do the copy. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Sun Jan 20, 2019 4:52 am Post subject: |
|
|
depontius wrote: | The other part of my move is that I got an SSD from Santa Wife, and when I get the time plan to put it into this system, copying my existing installation. |
I did this last weekend. Going from a WD 250G Velociraptor to a Crucial MX500 SATA USB. hdparm speed test went from 140 Mbps to 480 Mbps over thee times as fast. An NVME drive would be twice as fast, but this was super easy. Total time was four hours including the physical work and copying the old drive with cp -a (twice because I screwed up the command the first time) and going slow and careful. If I have time tomorrow, I'll write it up in tips and tricks and PM you. |
|
Back to top |
|
|
eohrnberger Apprentice
Joined: 09 Dec 2004 Posts: 240
|
Posted: Sun Jan 20, 2019 5:05 am Post subject: |
|
|
Tony0945 wrote: | depontius wrote: | The other part of my move is that I got an SSD from Santa Wife, and when I get the time plan to put it into this system, copying my existing installation. |
I did this last weekend. Going from a WD 250G Velociraptor to a Crucial MX500 SATA USB. hdparm speed test went from 140 Mbps to 480 Mbps over thee times as fast. An NVME drive would be twice as fast, but this was super easy. Total time was four hours including the physical work and copying the old drive with cp -a (twice because I screwed up the command the first time) and going slow and careful. If I have time tomorrow, I'll write it up in tips and tricks and PM you. |
I've done this a number of times, including from a gz tarball across an NFS mount when booting from installation media. You can also tar a running Gentoo onto new media (after particians and filesystems have been written), chroot into the copied environment and lay down the grub boot strap on the new drive.
Yes, as you did, last time for me was from HDs with platters to an SSD, and yes, I concur, the speed performance boost is really nice. Programs that are started literally leap to the screen.
Even noticed that if your HW is only SATA2, there's still a performance boost, even though SSDs are SATA3. |
|
Back to top |
|
|
|