Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Multiple distributions on one system with ZFS
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 543
Location: London,UK

PostPosted: Wed Mar 28, 2018 11:54 am    Post subject: [Solved] Multiple distributions on one system with ZFS Reply with quote

Hello,

I would like to setup gentoo and ubuntu on the same system and boot between them at will. I have seperate datasets for these,
Code:

# zpool list
NAME    SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
boot    480M  33.1M   447M         -      -     6%  1.00x  ONLINE  -
rpool   278G  98.9G   179G         -     1%    35%  1.00x  ONLINE  -

# zfs list
NAME                USED  AVAIL  REFER  MOUNTPOINT
boot               32.8M   319M  32.0M  /boot
rpool               103G   166G    96K  none
rpool/HOME         26.0G   166G  26.0G  /home
rpool/ROOT         72.9G   166G    96K  none
rpool/ROOT/gentoo  72.6G   166G  72.6G  /
rpool/ROOT/ubuntu   352M   166G   352M  /ubuntu
rpool/swap         4.25G   170G    84K  -


At the moment i have set gentoo dataset to mount at / and ubuntu to mount at /ubuntu
Code:

#zfs get mountpoint rpool/ROOT/gentoo
NAME               PROPERTY    VALUE       SOURCE
rpool/ROOT/gentoo  mountpoint  /           local

#zfs get mountpoint rpool/ROOT/ubuntu
NAME               PROPERTY    VALUE       SOURCE
rpool/ROOT/ubuntu  mountpoint  /ubuntu     local


How can i change the mountpoint of ubuntu to / on the fly with grub?

My grub entry is currently set to boot into gentoo,

Code:

#cat /boot/grub/grub.cfg
menuentry 'Gentoo GNU/Linux' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-775513eb037b3043' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
                set gfxpayload=keep
        fi
        insmod gzio
        insmod part_gpt
        insmod part_gpt
        insmod zfs
        set root='hd1,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt2 --hint-efi=hd1,gpt2 --hint-baremetal=ahci1,gpt2  --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  c6af96a2a75d3132
        else
          search --no-floppy --fs-uuid --set=root c6af96a2a75d3132
        fi
        echo    'Loading Linux 4.9.76-gentoo-r1 ...'
        linux   /@/vmlinuz-4.9.76-gentoo-r1 root=ZFS=rpool/ROOT/gentoo ro 
        echo    'Loading initial ramdisk ...'
        initrd  /@/initramfs-4.9.76-gentoo-r1.img
}


How can i setup the grub entry for Ubuntu so that it is mounted at /?


Last edited by trumee on Sun Apr 01, 2018 11:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 543
Location: London,UK

PostPosted: Sun Apr 01, 2018 3:19 am    Post subject: Reply with quote

I was able to get this working. One of key issues I faced was that, whenever I booted back into Gentoo from Ubuntu the pool did not mount automatically. Each time I had to issue a 'zpool import -f rpool'. The workaround for this is top set the hostid in the kernel parameters like so for both Gentoo and Ubuntu,

Code:

linux   /@/vmlinuz-4.9.76-gentoo-r1 root=ZFS=rpool/ROOT/gentoo ro spl.spl_hostid=0x0a0af0f8


This hint is written here.

Secondly, the boot was taking a long time in gentoo. The system was trying to resume from swap. Omitting the initramfs helped with that,

Code:

dracut --omit resume  --omit-drivers="resume" --host-only "" 4.9.76-gentoo-r1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum