help-grub
[Top][All Lists]
Advanced

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

Re: Understanding Grub2


From: Richard Owlett
Subject: Re: Understanding Grub2
Date: Mon, 16 Apr 2018 06:09:41 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1

On 04/15/2018 10:58 PM, sashab wrote:
Hi Richard,

On 15/04/18 23:34, Richard Owlett wrote:
On 04/15/2018 09:16 AM, Goh Lip wrote:


On 15/04/18 20:58, Richard Owlett wrote:
a MBR BIOS is used.
I wish to dedicate the first partition to Grub



Assuming partition is sda1, from any working grub 2 bios-legacy OS in
your computer.
sudo mount /dev/sda1 /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sda

Then put in your grub.cfg in sda1/boot/grub/grub.cfg (or
/boot/grub2/grub.cfg if applicable)

I did that.
When booting that device, I got the expected grub command line.
I am now investigating what my grub.cfg should look like.

I am reading several references listed at
https://www.gnu.org/software/grub/grub-documentation.html
especially
https://www.gnu.org/software/grub/manual/grub/grub.html#Invoking-grub_002dmkconfig


I suspect that
   grub-mkconfig -o /boot/grub/grub.cfg
will do what I need.

CLARIFICATION:
In my original post I had said:
As there may or may not be a complete OS elsewhere on my device, it implies
the functional equivalent of "update-grub" being on same partition to which
the minimalist Grub has been installed.
It's my understanding is that "update-grub" is Debian specific.
My reading of the Gnu documentation suggested that
   grub-mkconfig -o /boot/grub/grub.cfg
would *similar* functionality.
I prefer a pure Gnu approach for "reproducibility"{best word?} reasons.
I have minor quibbles the results of Debian's approach. I wish to experimentally determine whether my quibbles are with Gnu or Debian.


There is a reference to

https://www.gnu.org/software/grub/manual/grub/grub.html#Simple-configuration

which has references to /etc/grub.d  and  /etc/default/grub .

These were not created by grub-install.
Is there a default set somewhere?
Would it be safe to copy them from my current install?

Those files are maintained and delivered by your distro; And used by
grub-mkconfig.
AFAIK those could be copied from an another install.

That addresses the "safety" issue.
Is there a Gnu prototype somewhere?



Are there other directories and files I'll need?

Thank you very much.
I suspect you have rattled my thought patterns enough to resolve some
apparently unrelated conundrums ;}


If i get it right, you would like to keep your boot partition portable.
In that case you may wish to create a simple separate conf for your
"full" install by hand like Goh already wrote.

I prefer to avoid custom manual configuration.


However, for automating things it could work if you have os-prober set
up on your first partition.

An another option would be to make use of sh-like syntax of grub conf.
In that case you should take a look at how GRML does it.
(There is a conf on their iso which can be loaded by your locally
installed grub. If you prepare such a conf for your local install, your
could look up all partitions for such a conf and present menu entries on
boot.)


I'll investigate.

Hth.
Regards,
     Alex

Thank you.






reply via email to

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