# multi-boot install



## josephg (Jun 23, 2017)

My laptop has windows pre-installed on the first partition. I use it rarely. I used gparted to shrink it to the minimum.

I multi-boot with grub2. My preference would be syslinux, but for btrfs subvolumes.

I have a btrfs partition with many subvolumes, each with a different 32bit linux distro. I primarily use gentoo now. I also have voidlinux, debian, archlinux, ubuntu, and some others. /home is shared among all distros, and periodically I snapshot.

I installed openbsd on a UFS partition, which can't use the above /home, as I understand due to filesystem incompatibilities.
Now I want to start my FreeBSD journey, as I understand I can have a more stable system and also custom/build world like perhaps Gentoo.

I would like FreeBSD to share the OpenBSD /home if possible others too.

I have been reading FreeBSD docs over the past few days, and I'm still not able to decide on the filesystem. Everything seems to be going towards ZFS. But I wonder if that overhead is worth it for a single disk laptop with limited resources.

I'm also given to understand that OpenBSD/FreeBSD UFS are incompatible, which perhaps means that my initial thought isn't workable to have different disklabels for OpenBSD and FreeBSD and home on the same UFS partition.

I would appreciate you clearing any misconceptions above and some guidance regarding the directions I need to start thinking. Thanks in advance!


----------



## SirDice (Jun 23, 2017)

josephg said:


> I have been reading FreeBSD docs over the past few days, and I'm still not able to decide on the filesystem. Everything seems to be going towards ZFS. But I wonder if that overhead is worth it for a single disk laptop with limited resources.


ZFS is popular but nobody is forcing you to use it.



josephg said:


> I'm also given to understand that OpenBSD/FreeBSD UFS are incompatible,


You understood correctly.


----------



## josephg (Jun 23, 2017)

Thank you SirDice. What would you propose as my FreeBSD filesystem, and how would I share /home with OpenBSD and perhaps others?


----------



## SirDice (Jun 28, 2017)

josephg said:


> what would you propose as my freebsd filesystem,


I'm quite fond of ZFS, so that would be my fist choice. But I gather you're going to use the i386 version of FreeBSD and in that case I advise against using ZFS. It can be made to work on 32 bit but it's a major pain. For 64 bit it's not a problem. 


josephg said:


> and how would I share /home with OpenBSD and perhaps others?


The simplest solution is to put it on another box (a NAS perhaps) and NFS mount it. That would allow you to share it between all Linux and BSD versions and incarnations.


----------



## josephg (Jun 28, 2017)

SirDice said:


> I'm quite fond of ZFS, so that would be my fist choice. But I gather you're going to use the i386 version of FreeBSD and in that case I advise against using ZFS. It can be made to work on 32 bit but it's a major pain.


i'm quite fond of btrfs and use it for all my linux needs.. one big partition with lots of subvolumes, snapshots, etc. zfs sounds like that and possibly a bit more.. and hence why i'd been dithering. i think you've just helped me decide. thank you again.



SirDice said:


> The simplest solution is to put it on another box (a NAS perhaps) and NFS mount it. That would allow you to share it between all Linux and BSD versions and incarnations.


oh but this is a laptop, and not always on the network.


----------



## josephg (Jun 29, 2017)

i'm having a rethink.. and would like your opinion. what if i make a large zfs filesystem as root/boot, with subvolumes for freebsd, /home, and each of my linux distros?


----------



## Beeblebrox (Jun 29, 2017)

When multi-booting, there are several important considerations, whether you choose Grub for the task or not. For example: https://forums.freebsd.org/threads/48442/#post-271094
There's also more detail at https://forums.freebsd.org/threads/31713/
My comments in topics should be a how-to


----------



## josephg (Jun 30, 2017)

grub is not my preferred bootloader, but that is what i use because i have root on subvolumes. i will keep grub to boot freebsd kernel, or chainload freebsd partition. your links are very helpful, thanks! your comments have also highlighted the need for either keeping three separate homes or using the same /home for each os. you also suggest ext2 on freebsd might not be compliant. this is my quandry too.

this is why i'm having a rethink again. if i create a freebsd zfs partition/filesystem, can i use a subvolume to install linux? i can't find much documentation on this topic. i quote a couple below.. still trying to get my head around zfs concepts.

http://lists.freebsd.org/pipermail/freebsd-hackers/2015-April/047621.html  two+ years old. i wonder if things have moved on..
http://ericmccorkleblog.wordpress.c...eebsd-and-gentoo-linux-on-a-common-zfs-volume


----------



## Beeblebrox (Jun 30, 2017)

josephg said:


> you also suggest ext2 on freebsd might not be compliant


The thread is old ext2fs IS compliant. My Grub sits on ext2, FreeBSD can r/w & check consistency.
My comment "whether you choose Grub for the task" was to clarify that partition layout is consistent with whatever BL one would prefer - you should have a separate BL partition.  Another consideration for example, is that swap is ill-advised placed on ZFS.



josephg said:


> if i create a freebsd  ZFS partition/filesystem, can i use a subvolume to install linux?


As long as the ZFS versions are compatible with each other through the different OS, there's no problem. The *ZFS on Linux wiki* has complete walk-through for several distros. The tl;dr for multi-booting with ZFS is that you create someOS dataset under pool/ROOT/someOS, and install the base system on each someOS, with additional datasets as required. There are several problems however:
1. With Linux (except Ubuntu), ZFS is not native, it's third party add-on. So you'll have to do a bunch of `update-initramfs` crap or worse, be forced to use dracut which is completely insane IMHO when you understand how it adds matryoshka like chained systems to boot a damn OS.
2. Many tutorials do not address the `zpool set bootfs pool/ROOT/someOS` problem. It should not be an issue with a separate BL partition, but lo-and-behold Linux throws out "root mount error" when this or some other minor tweak did not go as it expected. IDK the solution; I just got fed up with the insanity.
3. You'll have to set machine-id's same across all OS so that ZFS does not require `zpool -f import pool` on each OS switch. On the other hand, that's probably not very healthy for ZFS data integrity.

As a separate approach, there are pretty good VM's (like VirtualBox) that should do the job at a minor resource cost.

Another alternative is to place each Linux OS root on ext4 partitions (takes about 500MB), but to have the the sub-folders (/usr, /var, etc) on ZFS datasets. So Fedora would boot from ext4, but mount rpool/fed-usr as /usr. Preventing conflicting ZFS mounts is easily done by `zfs set mountpoint legacy pool/dataset` and placing mount directives for dataset in fstab


----------



## josephg (Dec 6, 2017)

it's been a while, but i've finally taken the plunge and am happily running freebsd 32bit on zfs zroot. intel pentium laptop with 1g ram. all seems well, and i'm using it as my main system for now, ignoring other requirements to multi-boot etc.


----------

