grub_install


Description:

[ Version ( since = "1.0.17" ) ]
public bool grub_install (string root, string device) throws Error

install GRUB 1

This command installs GRUB 1 (the Grand Unified Bootloader) on device, with the root directory being root.

Notes:

* There is currently no way in the API to install grub2, which is used by most modern Linux guests. It is possible to run the grub2 command from the guest, although see the caveats in "RUNNING COMMANDS" in guestfs(3).

* This uses grub-install from the host. Unfortunately grub is not always compatible with itself, so this only works in rather narrow circumstances. Careful testing with each guest version is advisable.

* If grub-install reports the error "No suitable drive was found in the generated device map." it may be that you need to create a /boot/grub/device.map file first that contains the mapping between grub device names and Linux device names. It is usually sufficient to create a file containing:

<![CDATA[(hd0) /dev/vda]]>

replacing /dev/vda with the name of the installation device.

This function depends on the feature "grub". See also feature_available.

Parameters:

this

A GuestfsSession object

Returns:

true on success, false on error