SGD setgrubdevice

From Super Grub Disk Wiki
Jump to navigationJump to search

The setgrubdevice command

Purpose

This command is recommended to be included in the very first menu.lst configuration file of custom SGD disks.

After the command has been executed $(grub_device) can be used instead of hard coding e.g. (hd0,0).

Usage

setgrubdevice

Example

A Grub menu.lst could contain the following command:

configfile (hd0,0)/boot/grub/menu.lst

Using setgrubdevice the command could be changed as follows:

setgrubdevice
...
configfile $(grub_device)/boot/grub/menu.lst

Technical description

Saves into the $(grub_device) variable the current grub root. (I.e. saves the result of running root)

Problems that can be solved with this option

Using setgrubdevice makes the menu.lst configuration more stable. Even if the hard disk order changes the configuration file will not need to be updated.