Grub stripping out default option commands solved

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
breusshe
Level 1
Level 1
Posts: 20
Joined: Sat Dec 15, 2007 1:36 am

Grub stripping out default option commands solved

Post by breusshe »

I'm trying to get Grub to use the "savedefault" command by using the following menu.lst entries:

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default saved

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

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=true

I can edit and successfully save the file (I've reopened it to make sure the changes are being saved), however, when I run update-grub, the "updatedefaultentry" and "savedefault" options are stripped out of menu.lst. I'm wondering why this is and how do I make Grub remember what OS I logged into last if I cannot use this method.

Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Brett
Husse

Re: Grub stripping out default option commands

Post by Husse »

Welcome to Mint breusshe
I'm not absolutely sure but I think this does not work
You should remove the line
default saved
Instead every option should have savedefault added on a separate line, like so:

# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda2.
title Linux Mint, kernel 2.6.20-15-generic (recovery mode) (on /dev/sda2)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/sda2 ro single
initrd /boot/initrd.img-2.6.20-15-generic
savedefault
boot

However this has not worked for me, but is the correct method as far as I know
User avatar
breusshe
Level 1
Level 1
Posts: 20
Joined: Sat Dec 15, 2007 1:36 am

Re: Grub stripping out default option commands

Post by breusshe »

I appreciate the time to reply to this post.

I should have also noted that the configuration I listed in my original post was what I used when I had Xunbuntu 7.10 installed. The "default saved" is necessary since that is what tells Grub how to go about finding out what the "default" entry is now. Using "saved" tells Grub to look up what was used last in a file. I forget what file this info is saved to, but that is what it has to do.

Thanks again!
Brett
User avatar
breusshe
Level 1
Level 1
Posts: 20
Joined: Sat Dec 15, 2007 1:36 am

Re: Grub stripping out default option commands

Post by breusshe »

I finally uninstalled the grub_gfx package and just installed the regular grub package. This one understands "savedefault" and does not strip it out when you do an "update-grub".

No idea what is wrong with the gfx package, but I don't need pretty grub screens anyhow.
Brett
Locked

Return to “Installation & Boot”