[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Choosing default OS in multi boot system





Le 30.10.2013 15:48, Richard Owlett a écrit :
berenger.morel@neutralite.org wrote:


Le 30.10.2013 14:55, Richard Owlett a écrit :
I have a laptop physically set aside for _experimenting_ with
install
parameters to determine my optimum configuration. One install will
duplicate as closely as possible whatever comes with some donated
hardware for the church's after school program for pre-teens.

The combination of running the Debian Installer with as many
defaults
as possible and Grub2 being automatically installed each time
results
in two annoying characteristics.

ONE:
On boot, the the last system installed will be the default.
That is
the least likely one to run correctly (IF AT ALL) due to bad
choices
during install or subsequent tweaking. Resulting Grub rescue
mode ...
;/

TWO:
When there are multiple Debian installs present, especially
when same
kernel used, the Grub menu is not informative.

QUESTION_ONE:
Can I force the boot to default to the oldest rather than newest
install. It will always be a functioning install and usually is
completely normal with ONLY defaults chosen.

QUESTION_TWO:
Is there an automatic way for the Grub menu to display the
associated
partition label instead of the kernel id? the partition
designation
(sda1 ... sda8 etc) would be minimally acceptable.

I could manually edit the configuration file which advises "DO
NT EDIT" ;/
I do occasionally try to follow convention :)

TIA

My replies to your questions are: "probably". You probably can do
those things, but I have no idea about how, because grub became
too complex to maintain. I allow you to understand here, that I
think grub is bloated for my uses.

Your problems are the exact ones I had, and which made me switch
to lilo.
Where Grub is bloated, lilo obviously lacks small features:

Don't know if I'd call Grub2 bloated, but Grub-legacy was friendlier.

In my own and humble opinion, and for my needs, it is.
I do not hate grub, since when you do not have complex needs it works out of the box, and maintains itself (in fact, not really itself, it's os-prober plus some dpkg hooks which maintains it), unlike Lilo for the last point (which does not have the required hooks). But when you need to take control on your boot loader, Lilo is better, because you have less things to bother with, and I only say that because I tried to use both grub1 and grub2 (it was the transition, which did not helped my mind). Lilo was really damn easy to configure, and worked in 5 minutes, maybe less. I also had problems at installation time with grub on some installations (it refuses to installs itself, for obscure reasons, leading to unusable system), and lilo had none.

Grub is able to read a configuration file when it runs, this is why there is no need ( or at least, there were ) to run a tool to update it (lilo reinstalls itself on boot sector everytime you run #lilo). But I think it was in the old grub1, now you need to run something like #update-grub to update the configuration file (???), so the strong point of grub is no longer a strong point. It also includes a "shell", to tune your booting options before booting. This might be useful for 2 situations I can see: booting on a guest HD (but for that, the easier is to install a boot loader on the guest HD itself), or fixing errors (and in such situation, I prefer to simply boot on the old kernel, with it's old options, and then fix the errors definitely, instead of playing with things without auto-completion or any warning from the system).

Those "features" are very rarely useful, if useful at all (the shell is almost unusable for people who do not know the american qwerty layout, for example), so I name it bloated. But it is not important, because the boot loader have no impact on how the system works when booted, and normal users do not even know that it exists. There are more important softwares with more critical problems :)

The only problem (but not a small one) of Lilo for normal users is the need to edit the configuration file (and so, to run #lilo after) when a kernel with a different name is installed or removed*, which does not happen in stable Debian (the one officially recommended for users).

*: Note that if the alternative system was extended to the kernels, aka if kernels were installed with both their real name plus 2 variants, say, "linux-old" and "linux-last", that problem of manually editing /etc/lilo.conf and running lilo then would not be present. We could also imagine for mixed installations adding the distribution stableness in the name, like "linux-testing-old", plus an identifier for system name ( root partition would probably be the best choice, being by uuid, label or /dev name ). This could provide a way for automatic updates for lilo/syslinux without changing configuration files or source code at all.
Maybe the metapackages linux-image* could handle that, I do not know.

_ no QWERTY text editor inside ( it is anyway a pain to use such
keyboard if you do not usually use qwerty keyboards, as I )

Didn't know either Grub or lilo had an internal editor.

I was wrong, it is not a text editor, because you can not change files, it is a kind of shell, limited to boot options. Grub have it, Lilo does not ( at least, I think lilo does not have ).

_ no automatic updates when you add or remove a kernel (
os-prober does not change the /etc/lilo.conf file, so you must be
careful on kernel updates. But you should anyway always be, right? )

Automation was motivation for staying with Grub, but may not be worth
the bother.

I think that, depending about how works os-prober, some scripts might be made to automate lilo upgrades (or the idea with symlinks I spoke about previously). It seem (from my quick experiment, since there are no documentation about it) that this tool have to be run as root (it uses mount), and will display informations for every other system in following format:
partition:OS full name:OS family:next boot loader

Since I only have one Debian and a windows on that computer, there are probably many informations lacking, but it seems to be easy to parse to generate a lilo.conf file. Now, I have no idea how to install hooks in dpkg, otherwise I would probably work on that now.

But, by being simple, it's damn easy to add a new OS, it takes 5
lines (and some are not mandatory) at the end of the config file:
===
image  = /boot/vmlinuz-3.2.0-2-amd64
   label    = "linux-old"
   root   = /dev/sda6
   initrd = /boot/initrd.img-3.2.0-2-amd64
   read-only
===

I do not think I need to explain the content of those lines,
except that I have used the old way /dev/sda6 for partition
names, but indeed, other ones works too. It's simply that this
way is easier to maintain than
"9dfd6ae9-d0ff-46ef-ac65-7bb9dbe7b614".


For the default system, there is a dedicated line:
===
default=Linux-old
===
There are other various things, mostly to configure the selection
menu ( do you want a CLI interface, ncurse-like interface, or
graphical one? How much time do you want to have to choose
default? etc) but you will learn about them easily by reading
comments in debian's default lilo.conf.



I experimented with it some time ago. Don't recall it being too
difficult to deal with. Also I have become more familiar/comfortable
with Debian/*nix way of doing things in the meantime.

Debian is really nice to learn basics of linux-distributions. Configuration files are really nicely commented, and are easy to understand even for french people ( we are usually not very good in foreign languages ), plus it is so flexible... I just can not find any reason to dislike Debian, except that some packages are not always up to date (minor issue, which only affects not so popular packages or software with fast version cycle imo). And UNIX philosophy is simply the best to give people control over their tools.


Reply to: