Howto setup multiboot with GPT?

Artis Caune artis.caune at gmail.com
Mon Aug 17 15:14:43 UTC 2009


2009/8/15 Andrey V. Elsukov <bu7cher at yandex.ru>:
> Hi,
>
> I have installed 8.0-BETA2 amd64 on ZFS root with GPT. I made addition partition and
> made new ZFS pool, builded and installed i386 world and kernel to this pool.
> So, is there some way to select from which partition i want to boot?
>
> My configuration:
>> gpart show ad10
> =>        34  1250263661  ad10  GPT  (596G)
>          34         256     1  freebsd-boot  (128K)
>         290     8388608     2  freebsd-swap  (4.0G)
>     8388898   209715200     3  freebsd-zfs  (100G)
>   218104098   209715200     4  freebsd-zfs  (100G)
>   427819298   822444397        - free -  (392G)
>
>> zpool list
> NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
> amd64  99,5G  10,5G  89,0G    10%  ONLINE  -
> x86    99,5G   346M  99,2G     0%  ONLINE  /mnt
>
>> cat /boot/loader.conf
> zfs_load="YES"
> vfs.root.mountfrom="zfs:amd64"


You can try using one freebsd-zfs partition, one pool and just change
bootfs zpool property:

# zpool create rpool ad10p3
# zfs create rpool/ROOT/amd64
# zfs create rpool/ROOT/x86
# zpool set bootfs=rpool/amd64 rpool

echo 'vfs.root.mountfrom="zfs:rpool/amd64"' >> /ROOT/amd64/boot/loader.conf
echo 'vfs.root.mountfrom="zfs:rpool/x86"' >> /ROOT/x86/boot/loader.conf


and then change bootfs on the fly:

amd64# zpool set bootfs=rpool/x86 rpool
amd64# reboot

x86# zpool set bootfs=rpool/amd64 rpool
x86# reboot





-- 
Artis Caune

    Everything should be made as simple as possible, but not simpler.


More information about the freebsd-hackers mailing list