# savedefault under grub 0.94

## kevin_barsby

Hi,

I can't use the savedefault command with grub 0.94.

I get an Error 27: Unrecognized command.

Basically:

grub

> savedefault default=2 once

Error 27: Unrecognized command

Anyone got any ideas other than "Use lilo"

Thx

Kev

----------

## andrewy

what are you trying to do with "savedefault"? I've never heard of the command.

----------

## kevin_barsby

 *andrewy wrote:*   

> what are you trying to do with "savedefault"? I've never heard of the command.

 

It's for my myth box. I need to do a double reboot to get nvram-wakeup to work. It should go something like this:

- Set wakeup time using nvram-wakeup

- Set grub to boot to "halt" 

- reboot to reinitialise BIOS

- grub loads resets default setting

- grub halts computer

- computer wakes up on BIOS clock and boots normally

Kev

----------

## andrewy

sorry, I've never heard of savedefault, so I can't help you. I first assumed you were just trying to set the default kernel for GRUB to boot, but I guess it's a bit more complicated than that.  :Smile: 

----------

## kevin_barsby

This is the thing that's really bugging me, the documentation all seems to say just use the savedefault command, when it isn't even recognised by the grub shell.

There is either something very wrong with the grub ebuild (less likely) or my local compile of it went wrong whilst emerging.

----------

## andrewy

maybe you put it in your grub.conf?

----------

## kevin_barsby

It's actually listed under the commands and commandline options of the manpage, and here's the killer, it autocompletes from the grub shell.

Typing saved<TAB> brings up savedefault, help savedefault also gives a (unhelpful) help message. But try and run the bloody command and you get Unrecognized command.

----------

## andrewy

[code]

grub> help savedefault

savedefault: savedefault

    Save the current entry as the default boot entry.

[/code[

It sounds like savedefault does the same thing as setting default=X in the grub.conf file.

----------

## kevin_barsby

Except it doesn't work

 :Sad: 

----------

## andrewy

It works for me.

Just remember that the first entry is 0, the second entry is 1, etc.

Here's my grub.conf for an example.

```

default=0

timeout=10

splashimage=(hd0,0)/grub/splash.xpm.gz

title Gentoo 2.6.5-gentoo-r1

        root (hd0,0)

        kernel (hd0,0)/kernel-2.6.5-gentoo-r1 root=/dev/hda2

```

----------

## kevin_barsby

What happens if you type:

savedefault 

into a grub shell?

----------

## andrewy

it says there's no such command, because I'm using it in the incorrect context, apparently.

I guess you're supposed to type it when you're editing an entry with grub, I don't know how you do that though, I just use grub.conf

----------

## kevin_barsby

I think I'm going to have to switch to lilo as this feature is blatently not working on my machine.

Thanks for the help though

----------

## andrewy

no problem, good luck with LILO

----------

## Nelvin

Hi guys,

i have the same problem with grub. Everything i tried, didn't work!

Is this a gentoo error of grub?

savedefault is a commandline entry, but everytime error 27 appears.

i tried 

echo "savedefault --default=0 --once" | grub or

echo "savedefault default=0" | grub 

but always error 27

----------

## kallamej

 *info grub wrote:*   

>  - Command: savedefault
> 
>      Save the current menu entry as a default entry. Here is an example:
> 
>           default saved
> ...

 

I don't know whether this would achieve what the OP wanted. Anyway, my interpretation is that savedefault requires that the default is saved, otherwise it will be whatever number is specified or default to 0.

----------

## den_RDC

savedefault is indeed gone - i used it alot on remote servers with the once option to specify a new kernel. If the new kernel didin't boot properly i could remote-powercycle the machine and it would boot the old kernel. If it worked, i knew i could change the grub.conf permanently.

So any information on how to get this feature back?

----------

## sezz

You'll have to patch grub: http://www.commedia.it/ccontavalli/#grub-patch

If anyone can patch Grub 0.94 successfully with this... tell me how  :Smile: 

----------

## sezz

Ok, works for me  :Smile: 

You can download the updated ebuild here: http://htpc.at/public/grub-0.94-r1.ebuild

----------

