[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Example for grub-mkimage & grub-setup

From: Andrei Borzenkov
Subject: Re: Example for grub-mkimage & grub-setup
Date: Sun, 18 Jan 2015 18:10:47 +0300

В Sun, 18 Jan 2015 14:14:38 +0100
Truth <address@hidden> пишет:

> I would like to install grub2 to a USB-stick (e.g. /dev/sdb).
> >From the I've learned that/... `grub-install' is actually just
> a shell script

no more.

>                and the////real task is done by `grub-mkimage' and
> `grub-setup'.

Not quite true. grub-install does all logic to detect what grub drivers
are needed, what prefix or embedded config file is needed (and create
such config file), where /boot/grub is located, etc etc etc. That it was
shell script was just an implementation detail.

>               Therefore, you//may run those commands directly to
> install GRUB, without using //`grub-install'.//
> (see /chapter 3.1. Installing GRUB using grub-install)
> However, the man-pages for /grub-setup/ and /grub-mkimage/ are quite
> short and seem to be more helpful for people which already know what to
> do rather than people which want to understand what's going on.
> Unfortunately, I couldn't find any example on how to install grub by
> just using the commands /grub-mkimage/ and /grub-setup/.
> In order to learn more about grub I would appreciate your comments and
> examples.
> Thanks in advance ...

grub-mkimage and grub-bios-setup are internal tools that are not
intended to be used directly by users. Supported interface to install
grub is grub-install. To install grub on USB stick you just need to
mount it and run grub-install. Something like

mount /dev/sdb1 /mnt
grub-istall --boot-directory=/mnt /dev/sdb

This will copy grub support files to /mnt/grub (or /grub directory on
USB stick) and instal grub boot sector in MBR of USB stick.

If this does not do what you want please explain what you want to do.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]