On Sat, Oct 1, 2016 at 12:51 AM, Xen <address@hidden> wrote:
Giovanni Gherdovich schreef op 30-09-2016 20:25:
Hello,
I'd like to install two different linux distributions and use grub to
boot into one or the other. I have a dedicated grub partition on
/dev/sda1 and two other partitions for the OSes. /dev/sda1 appears to
be a "BIOS boot partition" to tools like parted(8), fdisk(8) or
gdisk(8).
As far as I know the "BIOS Boot Partition" does not contain any
filesystem
but only the Grub image. It is the space you need that would otherwise
be
put somewhere between the MBR and the first partition.
I think you do not need to run grub2-install on /dev/sda1, but on
/dev/sda,
though, and it will pick the boot partition automatically(?).
Your boot directory is just going to be on any regular filesystem that
you
have access to. In your case that is /dev/sda4, apparently.
So I think you simply need to be installing on /dev/sda.
In case you want to move your boot files off of /dev/sda4, you could
split
/dev/sda1 (it doesn't need to be 500MB, 1 or 2MB would be fine).
So you would delete it, create a new first partition of /dev/sda1,
then
another dedicated boot partition /dev/sda2 (you can use a tool like
parted
to renumber your gpt partitions) and then your remaining partitions
will
shift until /dev/sda5, you will now have 5 partitions, including one
new
"regular boot partition" containing an actual filesystem (like ext2).
Regards.
Thanks, that worked like a charm.
I did exactly what you suggested (I used gdisk to manipulate the
partitions).
After that I went with
grub2-install --boot-directory=/mnt/boot /dev/sda
and it just did the right thing: put the core.img file on the
filesystem-less
"bios boot partition", which it found on its own; core.img then was
pointing
to a grub2 binary located in /mnt/boot, i.e. the mount point of my
newly created
ext2 regular boot partition.