How to prevent Ubuntu update to hose my Grub? - Ubuntu

This is a discussion on How to prevent Ubuntu update to hose my Grub? - Ubuntu ; Apparently Ubuntu updates write their own stuff into grub. How can that be prevented? Thanks Laszlo...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 25

Thread: How to prevent Ubuntu update to hose my Grub?

  1. How to prevent Ubuntu update to hose my Grub?

    Apparently Ubuntu updates write their own stuff into grub.

    How can that be prevented?

    Thanks

    Laszlo

  2. Re: How to prevent Ubuntu update to hose my Grub?

    Laszlo Lebrun wrote:
    > Apparently Ubuntu updates write their own stuff into grub.


    > How can that be prevented?


    It is necessary to change menu.lst after a kernel upgrade.

    What changes would you not like to be made?

    As a workaround, keep a copy of menu.lst and edit it after every
    kernel upgrade.

    --
    Niklaus

  3. Re: How to prevent Ubuntu update to hose my Grub?

    Niklaus Kuehnis wrote:
    > Laszlo Lebrun wrote:
    >> Apparently Ubuntu updates write their own stuff into grub.

    >
    >> How can that be prevented?

    >
    > It is necessary to change menu.lst after a kernel upgrade.
    >
    > What changes would you not like to be made?
    >

    The 1st os of my grub should not be Ubuntu. (I have good reasons for that)

    Every upgrade overwrites (and even completely removes it) it without any
    warning.

    Laszlo

  4. Re: How to prevent Ubuntu update to hose my Grub?

    On Thu, 10 Jul 2008 11:56:17 +0200, Laszlo Lebrun wrote:

    > Niklaus Kuehnis wrote:
    >> Laszlo Lebrun wrote:
    >>> Apparently Ubuntu updates write their own stuff into grub.

    >>
    >>> How can that be prevented?

    >>
    >> It is necessary to change menu.lst after a kernel upgrade.
    >>
    >> What changes would you not like to be made?
    >>

    > The 1st os of my grub should not be Ubuntu. (I have good reasons for
    > that)
    >
    > Every upgrade overwrites (and even completely removes it) it without any
    > warning.
    >
    > Laszlo


    Download *start up manager*. It will give you a GUI to make some changes
    in GRUB.

    arnold

  5. Re: How to prevent Ubuntu update to hose my Grub?

    Laszlo Lebrun wrote:
    > Niklaus Kuehnis wrote:
    > > Laszlo Lebrun wrote:
    > >> Apparently Ubuntu updates write their own stuff into grub.

    > >
    > >> How can that be prevented?

    > >
    > > It is necessary to change menu.lst after a kernel upgrade.
    > >
    > > What changes would you not like to be made?
    > >

    > The 1st os of my grub should not be Ubuntu. (I have good reasons for that)


    > Every upgrade overwrites (and even completely removes it) it without any
    > warning.


    This might help (from /boot/grub/menu.lst):
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

    Magic is great but sometimes it sucks.

    --
    Niklaus

  6. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-10, Laszlo Lebrun wrote:
    > Niklaus Kuehnis wrote:
    >> Laszlo Lebrun wrote:
    >>> Apparently Ubuntu updates write their own stuff into grub.

    >>
    >>> How can that be prevented?

    >>
    >> It is necessary to change menu.lst after a kernel upgrade.
    >>
    >> What changes would you not like to be made?
    >>

    > The 1st os of my grub should not be Ubuntu. (I have good reasons for that)
    >
    > Every upgrade overwrites (and even completely removes it) it without any
    > warning.


    Part of a kernel update is to update the boot loader, placing the
    newest kernel in the 0 spot. If this is unacceptable to you, either
    do not do the kernel update, or keep a copy of menu.list and manually
    update it.

    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  7. Re: How to prevent Ubuntu update to hose my Grub?

    arnold wrote:
    > On Thu, 10 Jul 2008 11:56:17 +0200, Laszlo Lebrun wrote:
    >
    >> Niklaus Kuehnis wrote:
    >>> Laszlo Lebrun wrote:
    >>>> Apparently Ubuntu updates write their own stuff into grub.
    >>>> How can that be prevented?
    >>> It is necessary to change menu.lst after a kernel upgrade.
    >>>
    >>> What changes would you not like to be made?
    >>>

    >> The 1st os of my grub should not be Ubuntu. (I have good reasons for
    >> that)
    >>
    >> Every upgrade overwrites (and even completely removes it) it without any
    >> warning.
    >>
    >> Laszlo

    >
    > Download *start up manager*. It will give you a GUI to make some changes
    > in GRUB.
    >

    I can make the changes in a text editor as well, it irritates however
    *that* I have to correct the stuff.
    If another OS is placed first, Ubuntu should respect that and keep it
    unchanged.
    Laszlo

  8. Re: How to prevent Ubuntu update to hose my Grub?

    Laszlo Lebrun wrote:
    > Apparently Ubuntu updates write their own stuff into grub.
    >
    > How can that be prevented?


    I've got Windows XP set as my default os, and so far I have not noticed
    the major updates changing the default menu selection yet.

    Yousuf Khan

  9. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-10, Yousuf Khan wrote:
    > Laszlo Lebrun wrote:
    >> Apparently Ubuntu updates write their own stuff into grub.
    >>
    >> How can that be prevented?

    >
    > I've got Windows XP set as my default os, and so far I have not noticed
    > the major updates changing the default menu selection yet.


    It won't, as long as Windows is not in the #0 stanza. The updater
    places the new kernel in the 0 spot, and if the default is other than
    0, it increases it by 2. This way, your default doesn't change.

    The OP's "problem" isn't even that it is changing his default, but
    rather that it is inserting into the 0 stanza...


    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  10. Re: How to prevent Ubuntu update to hose my Grub?

    Yousuf Khan wrote:
    > Laszlo Lebrun wrote:
    >> Apparently Ubuntu updates write their own stuff into grub.
    >>
    >> How can that be prevented?

    >
    > I've got Windows XP set as my default os, and so far I have not noticed
    > the major updates changing the default menu selection yet.
    >
    > Yousuf Khan

    would you mind to give a copy of your /boot/grub/menu.lst?
    Thanks
    Laszlo

  11. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-10, Lazlo Lebrun wrote:
    > Yousuf Khan wrote:
    >> Laszlo Lebrun wrote:
    >>> Apparently Ubuntu updates write their own stuff into grub.
    >>>
    >>> How can that be prevented?

    >>
    >> I've got Windows XP set as my default os, and so far I have not noticed
    >> the major updates changing the default menu selection yet.
    >>
    >> Yousuf Khan

    > would you mind to give a copy of your /boot/grub/menu.lst?


    Is that your intended goal? If so, think differently and the solution
    is easy.

    Rather than having Windows in the 0 slot, move it to the end and
    change the default number from 0 to whichever stanza windows is in.
    It will then update fine for you in the future.

    For instance:
    default 5
    timeout 10

    title Linux Mint, kernel 2.6.24-19-generic
    root (hd0,1)
    kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro quiet
    splash
    initrd /initrd.img-2.6.24-19-generic

    title Linux Mint, kernel 2.6.24-19-generic (recovery mode)
    root (hd0,1)
    kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro single
    initrd /initrd.img-2.6.24-19-generic

    title Linux Mint, kernel 2.6.24-16-generic
    root (hd0,1)
    kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro quiet
    splash
    initrd /initrd.img-2.6.24-16-generic

    title Linux Mint, kernel 2.6.24-16-generic (recovery mode)
    root (hd0,1)
    kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro single
    initrd /initrd.img-2.6.24-16-generic

    title Linux Mint, kernel memtest86+
    root (hd0,1)
    kernel /memtest86+.bin

    title Windows XP
    root (hd0,0)
    makeactive
    chainloader +1

    Will boot Windows as default (or pretty close, I don't have Win
    installed so I made it up from memory, but you get the idea). Now, if
    you update your kernel, it will add entries at the beginning (0 and 1
    stanzas), and it will automagically change default to 7 (or at least
    should).


    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  12. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-11, Joe wrote:
    > On 2008-07-10, Lazlo Lebrun wrote:
    >> Yousuf Khan wrote:
    >>> Laszlo Lebrun wrote:
    >>>> Apparently Ubuntu updates write their own stuff into grub.
    >>>>
    >>>> How can that be prevented?
    >>>
    >>> I've got Windows XP set as my default os, and so far I have not noticed
    >>> the major updates changing the default menu selection yet.
    >>>
    >>> Yousuf Khan

    >> would you mind to give a copy of your /boot/grub/menu.lst?

    >
    > Is that your intended goal? If so, think differently and the solution
    > is easy.
    >
    > Rather than having Windows in the 0 slot, move it to the end and
    > change the default number from 0 to whichever stanza windows is in.
    > It will then update fine for you in the future.
    >
    > For instance:
    > default 5
    > timeout 10
    >
    > title Linux Mint, kernel 2.6.24-19-generic
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro quiet
    > splash
    > initrd /initrd.img-2.6.24-19-generic
    >
    > title Linux Mint, kernel 2.6.24-19-generic (recovery mode)
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro single
    > initrd /initrd.img-2.6.24-19-generic
    >
    > title Linux Mint, kernel 2.6.24-16-generic
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro quiet
    > splash
    > initrd /initrd.img-2.6.24-16-generic
    >
    > title Linux Mint, kernel 2.6.24-16-generic (recovery mode)
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro single
    > initrd /initrd.img-2.6.24-16-generic
    >
    > title Linux Mint, kernel memtest86+
    > root (hd0,1)
    > kernel /memtest86+.bin
    >
    > title Windows XP
    > root (hd0,0)
    > makeactive
    > chainloader +1
    >
    > Will boot Windows as default (or pretty close, I don't have Win
    > installed so I made it up from memory, but you get the idea). Now, if
    > you update your kernel, it will add entries at the beginning (0 and 1
    > stanzas), and it will automagically change default to 7 (or at least
    > should).
    >
    >


    Mine has not automatically adjusted the default number when new
    kernels were installed. However, I was just looking at my
    /boot/grub/menu.lst, and noticed this:

    ## should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false

    To the best of my recollection, I have never changed this setting.
    If I change it to 'true', will it then take care of updating the
    default entry on the next kernel upgrade?

    --
    "...Amusing, yet not without a certain understated omniscience."
    -- Eric Tiberius Duckman

  13. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-11, Eric T Duckman wrote:
    > Mine has not automatically adjusted the default number when new
    > kernels were installed. However, I was just looking at my
    > /boot/grub/menu.lst, and noticed this:
    >
    > ## should update-grub adjust the value of the default booted system
    > ## can be true or false
    > # updatedefaultentry=false
    >
    > To the best of my recollection, I have never changed this setting.
    > If I change it to 'true', will it then take care of updating the
    > default entry on the next kernel upgrade?
    >


    Change it to true and uncomment it...


    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  14. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-11, Joe wrote:
    > On 2008-07-11, Eric T Duckman wrote:
    >> Mine has not automatically adjusted the default number when new
    >> kernels were installed. However, I was just looking at my
    >> /boot/grub/menu.lst, and noticed this:
    >>
    >> ## should update-grub adjust the value of the default booted system
    >> ## can be true or false
    >> # updatedefaultentry=false
    >>
    >> To the best of my recollection, I have never changed this setting.
    >> If I change it to 'true', will it then take care of updating the
    >> default entry on the next kernel upgrade?
    >>

    >
    > Change it to true and uncomment it...
    >
    >


    I forget to mention, it's in the 'automagic' section, so I
    shouldn't need to uncomment, just change to 'true', correct?

    --
    "...Amusing, yet not without a certain understated omniscience."
    -- Eric Tiberius Duckman

  15. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-11, Eric T Duckman wrote:
    > On 2008-07-11, Joe wrote:
    >> On 2008-07-11, Eric T Duckman wrote:
    >>> Mine has not automatically adjusted the default number when new
    >>> kernels were installed. However, I was just looking at my
    >>> /boot/grub/menu.lst, and noticed this:
    >>>
    >>> ## should update-grub adjust the value of the default booted system
    >>> ## can be true or false
    >>> # updatedefaultentry=false
    >>>
    >>> To the best of my recollection, I have never changed this setting.
    >>> If I change it to 'true', will it then take care of updating the
    >>> default entry on the next kernel upgrade?
    >>>

    >>
    >> Change it to true and uncomment it...
    >>
    >>

    >
    > I forget to mention, it's in the 'automagic' section, so I
    > shouldn't need to uncomment, just change to 'true', correct?
    >


    No. "automagic" or not, anything with a hash mark is commented, and
    doesn't count... With it commented, it will continue to use the
    default option, which is likely false, since that's what most
    programmers put on the commented option lines...


    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  16. Re: How to prevent Ubuntu update to hose my Grub?

    Joe wrote:
    > No. "automagic" or not, anything with a hash mark is commented, and
    > doesn't count...


    Nope, Eric had it right:
    https://help.ubuntu.com/community/GrubHowto#Automagic Kernels List

    The relevant parts of menu.lst that update-grub looks at are the ones in
    between the "### BEGIN AUTOMAGIC KERNELS LIST" and "### END DEBIAN
    AUTOMAGIC KERNELS LIST" lines. Comments are preceded by at least two
    '#', e.g. '## this is a comment'. Global options are after single '#',
    e.g. '# groot=(hd0,4)'. The most common one to change is probably the
    groot option. Change this if /boot resides on a different partition that
    /. See the appropriate section on this page for more information about
    different /boot partitions. Another common option is 'kopt=', which are
    kernel options applied to all kernels in the menu.lst.


    --
    As we enjoy great advantages from inventions of others, we should be
    glad of an opportunity to serve others by any invention of ours;
    and this we should do freely and generously.
    --Benjamin Franklin

  17. Re: How to prevent Ubuntu update to hose my Grub?

    On Fri, 11 Jul 2008 00:06:22 -0500,
    Joe wrote:
    > On 2008-07-11, Eric T Duckman wrote:
    > > On 2008-07-11, Joe wrote:
    > >> On 2008-07-11, Eric T Duckman wrote:
    > >>> Mine has not automatically adjusted the default number when new
    > >>> kernels were installed. However, I was just looking at my
    > >>> /boot/grub/menu.lst, and noticed this:
    > >>>
    > >>> ## should update-grub adjust the value of the default booted system
    > >>> ## can be true or false
    > >>> # updatedefaultentry=false
    > >>>
    > >>> To the best of my recollection, I have never changed this setting.
    > >>> If I change it to 'true', will it then take care of updating the
    > >>> default entry on the next kernel upgrade?
    > >>>
    > >>
    > >> Change it to true and uncomment it...
    > >>
    > >>

    > >
    > > I forget to mention, it's in the 'automagic' section, so I
    > > shouldn't need to uncomment, just change to 'true', correct?
    > >

    >
    > No. "automagic" or not, anything with a hash mark is commented, and
    > doesn't count... With it commented, it will continue to use the
    > default option, which is likely false, since that's what most
    > programmers put on the commented option lines...


    Generally you would be correct. However update-grub is a Debian
    specific add on, not part of the official grub package.

    The maintainers decided config info for update-grub should be
    available in menu.lst. Grub may or may not tolerate meaningless
    commands or - perhaps more dangerous - meaningfull commands which do
    not belong (and grub shouldn't.)

    So they decided commands for update-grub should be commented out in
    the menu.lst file. This lead to using ## for a true comment. I'm
    uncertain if other distros use similar tricks or not, but on debian
    based distros, in menu.lst:

    The first # indicates it is a comment and is ignored by grub.

    A second # tells update-grub to ignore the line as a comment as
    well.

    This information is grossly over simplified, but the gist of it
    is:

    Is this for Grub? If yes, no hash marks.
    Is this only for update-grub, that is, it is only needed to generate a
    new menu.lst? If yes, one hash only.
    Is this merely instructive to person reading it? If yes, two or more
    hashes.

    For something like update-grub to work the only alternative would have
    been a stripped down menu.lst with a comment indicating you should not
    edit this file, edit foo.conf and run update-grub, which would also
    suck.

    Personally, I'd have preferred the second option, but have no desire
    to duplicate the effort of a 1400 line script to add eight lines to my
    menu.lst.

    YMMV,

    Michael C.
    --
    mjchappell@verizon.net http://mcsuper5.freeshell.org/

    Bad people are punished by society's law And good people are punished by
    Murphy's law. - GL,DLM

  18. Re: How to prevent Ubuntu update to hose my Grub?

    On Fri, 11 Jul 2008 04:07:25 GMT,
    Eric T Duckman wrote:
    > On 2008-07-11, Joe wrote:
    > > On 2008-07-11, Eric T Duckman wrote:
    > >> Mine has not automatically adjusted the default number when new
    > >> kernels were installed. However, I was just looking at my
    > >> /boot/grub/menu.lst, and noticed this:
    > >>
    > >> ## should update-grub adjust the value of the default booted system
    > >> ## can be true or false
    > >> # updatedefaultentry=false
    > >>
    > >> To the best of my recollection, I have never changed this setting.
    > >> If I change it to 'true', will it then take care of updating the
    > >> default entry on the next kernel upgrade?
    > >>

    > >
    > > Change it to true and uncomment it...
    > >
    > >

    >
    > I forget to mention, it's in the 'automagic' section, so I
    > shouldn't need to uncomment, just change to 'true', correct?


    Yes, because grub does not update the default entry, update-grub does.

    Michael C.
    --
    mjchappell@verizon.net http://mcsuper5.freeshell.org/

    The only people who don't make mistakes are the ones that aren't doing
    anything.

  19. Re: How to prevent Ubuntu update to hose my Grub?

    On 2008-07-11, johnny bobby bee wrote:
    > Joe wrote:
    >> No. "automagic" or not, anything with a hash mark is commented, and
    >> doesn't count...

    >
    > Nope, Eric had it right:
    > https://help.ubuntu.com/community/GrubHowto#Automagic Kernels List
    >
    > The relevant parts of menu.lst that update-grub looks at are the ones in
    > between the "### BEGIN AUTOMAGIC KERNELS LIST" and "### END DEBIAN
    > AUTOMAGIC KERNELS LIST" lines. Comments are preceded by at least two
    > '#', e.g. '## this is a comment'. Global options are after single '#',
    > e.g. '# groot=(hd0,4)'. The most common one to change is probably the
    > groot option. Change this if /boot resides on a different partition that
    > /. See the appropriate section on this page for more information about
    > different /boot partitions. Another common option is 'kopt=', which are
    > kernel options applied to all kernels in the menu.lst.


    Thanks for the correction. I've been using grub forever, but I
    learned all I know about it on redhat systems, with no "debian
    automagic" crap... ;-)

    So, there ya go, eric. Leave the # !

    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  20. Re: How to prevent Ubuntu update to hose my Grub?

    Joe wrote:

    > Rather than having Windows in the 0 slot, move it to the end and
    > change the default number from 0 to whichever stanza windows is in.
    > It will then update fine for you in the future.
    >
    > For instance:
    > default 5
    > timeout 10
    >
    > title Linux Mint, kernel 2.6.24-19-generic
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro quiet
    > splash
    > initrd /initrd.img-2.6.24-19-generic
    >
    > title Linux Mint, kernel 2.6.24-19-generic (recovery mode)
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-19-generic root=/dev/sda1 ro single
    > initrd /initrd.img-2.6.24-19-generic
    >
    > title Linux Mint, kernel 2.6.24-16-generic
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro quiet
    > splash
    > initrd /initrd.img-2.6.24-16-generic
    >
    > title Linux Mint, kernel 2.6.24-16-generic (recovery mode)
    > root (hd0,1)
    > kernel /vmlinuz-2.6.24-16-generic root=/dev/sda1 ro single
    > initrd /initrd.img-2.6.24-16-generic
    >
    > title Linux Mint, kernel memtest86+
    > root (hd0,1)
    > kernel /memtest86+.bin
    >
    > title Windows XP
    > root (hd0,0)
    > makeactive
    > chainloader +1
    >
    > Will boot Windows as default (or pretty close, I don't have Win
    > installed so I made it up from memory, but you get the idea). Now, if
    > you update your kernel, it will add entries at the beginning (0 and 1
    > stanzas), and it will automagically change default to 7 (or at least
    > should).
    >
    >

    Thank you Joe, you gave me the right advice.
    Enjoy your day, you made mine nicer.

    Laszlo


    --
    Ein Optimist ist in der Regel der Zeitgenosse, der am ungenügensten
    informiert ist. - John Priestley

+ Reply to Thread
Page 1 of 2 1 2 LastLast