[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Understanding Grub2
From: |
sashab |
Subject: |
Re: Understanding Grub2 |
Date: |
Mon, 16 Apr 2018 05:58:51 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
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.
>
> 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.
> 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.
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.)
Hth.
Regards,
Alex