help-grub
[Top][All Lists]
Advanced

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

Re: change default os


From: Simon Hobson
Subject: Re: change default os
Date: Thu, 14 Mar 2013 12:06:14 +0000

And people wonder why (some) FOSS projects have a poor reputation for support.

Jordan Uggla wrote:
>> If you edit /boot/grub/grub.cfg and change where it says 'set default="0"' 
>> to the index of teh OS you want to boot, that will do it **BUT** the change 
>> will be wiped out next time Gurb updates it's config.

>Since it will get wiped out, it's hardly worth mentioning at all.

Sometimes something IS worth mentioning so that you can say why not to do it. 
As you correctly point out, people coming up from Grub 1 will be used to 
working in certain ways - it can be as helpful to say what NOT to do (and why) 
as it is to say what TO do.

>> To make the change permanent, make the same change in /etc/default/grub and 
>> then run "update-grub" to update /boot/grub/grub.cfg.
>>
>> Both these will allow you to change the default OS to boot, but it's done by 
>> index into the list. If the list changes (such as installing an updated 
>> kernel) then your index will be wrong and you'll boot something else.
>
>That's why GRUB_DEFAULT can be set to a menu entry title, so that it
>will continue working no matter how many entries come before the one
>you want.

It would help if the stock file had a comment to that effect. I don't know if 
this is a GRUB issue or a Debian issue - but on a Debian system the line is 
there, but no hints what values it accepts. SInce it's a numeric 0, then one 
might guess that it's numeric, and TBH I wouldn't have thought of trying to put 
a text string in there. The 95% you mention probably shouldn't need to be 
digging into the documentation to find these things out - and I think it's a 
bit rich dissing a suggestion because there's an "undocumented"* alternative.
* Yes I know, from what you've said it probably is in the docs, somewhere, but 
for the 95% you mention, just a ne line comment in the defaults file would 
suffice.

Your comments may be technically correct, but making statements like :
> Please don't try anything that Simon has recommended in the above
> email, everything he has said has been overly complicated and has had
> issues with breaking in various ways on upgrades.

Is far from helpful. It makes the list seem hostile, where only certain elite 
people are allowed to post. Contrast two approaches :
1) Ignore everything A said, they're stupid things to do ...
2) While what A says will work, a better way is ... because ...
Which is more helpful ? Which makes the list seem a more open place to ask for 
help ? Especially when statement A is factually incorrect.

>> An alternative way is to re-order the components in /etc/grub. On my Debian 
>> system, Windows (and others) are detected by30_os-prober - if you change the 
>> numbering so this comes before nn_linux, then the Windows OS will come 
>> before Linux in the list, meaning Windows will boot by default. You'll need 
>> to take care to deal with this change any time Grub gets updated and the 
>> installer wants to put new config files in.
>
>Hence it's hardly worth mentioning. I highly recommend against doing
>this. My general feeling is that you should never make any changes in
>/etc/grub.d/ at all (only modifying /etc/default/grub is enough for
>95% of people, and for 4 of the next 5% adding custom entries via
>/boot/grub/custom.cfg is enough). If you're in the 1% that can't get
>what you need/want from grub-mkconfig without modifying /etc/grub.d/
>then I would recommend writing your grub.cfg completely manually.

I strongly disagree with that stance. Again, I don't know if it's a Debian or 
stock GRUB issue, but for Xen hosts it makes sense to re-order the components - 
assuming you want to retain the default "boot latest version" operation. The 
other techniques you mention all (AFAIK) require manual intervention any time 
you upgrade either Xen or the Kernel.

On the upside, I've learned something new today :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]