My random project

For years I have had a zfs setup on my main workstation that I have really enjoyed. Multiple Linux distros setup to multi-boot from the same zpool with lots of things transparently shared between all of them. Of course, zfs isn’t for everyone and there are a limited number of distros that even support it fully.

As a challenge, I thought I might take a similar approach on my laptop except this time using btrfs. While btrfs lacks many zfs features and conveniences, I believed it would be possible to create a similar setup.

Here is the result:

  • 1 partition + ESP
  • 7 distros
  • 59 subvolumes, 18 of which are shared by all distros
  • Fully encrypted with luks
  • Important application configs are completely shared between systems so the system is the same no matter which distro I choose to boot into

What I learned:

  • It was a little surprising how many features btrfs lacks compared to zfs
  • It took much longer than I thought it would
  • More distros than I expected had no support or limited support for btrfs
  • I was glad I did it in a VM first so I could recover snapshots when needed
13 Likes

Wow, good work! A couple of questions: do you run Plasma between them all? And how does NixOS play with the others, given it has self contained packages?

I can see NixOS always taking up a lot of space because of how it works, it’s in some ways like OS-X in the way packages are contained, although in other ways I guess it’s different. I’ve often looked at their website but haven’t tried it yet :grinning_face_with_smiling_eyes:

1 Like

I did install plasma on all of them but I chose not to share the plasma config so they could be different DEs if I wanted that.

It is fine. I don’t run home manager so my home directory on Nixos is pretty much the same as any other. The application files/libraries/binaries are stored radically differently but that doesn’t really have much impact.

That being said, most of my Nixos installs are servers which is where Nixos really shines. Completely automated updates/declarative config/easy rollbacks/no need to worry about version/library conflicts/etc

Hmm…so in a way NixOS is kind of semi-autonomous? Connected yet not affecting the others. It’s a neat setup. I guess it needs an advanced file system of course. I’ll probably try NixOS one day but it will be on another machine (I don’t really like VMs) and at the moment I’ve run out of machines (6 at the moment) :rofl:

It’s nice to hear of folk trying out things that may not be obvious or easy. It often inspires others too, keep it up mate!

All the distros are autonomous. I can add/remove distros at any time.

To you give you a better idea here is the basic subvolume layout. It would have been easy enough to share more application config, but on my laptop, those are the only applications I care about the config for.

Name Mountpoint
eos-root /
eos-home /home
eos-varcache /var/cache
eos-paccache /var/cache/pacman
eos-varlog /var/log
eos-daltocache /home/dalto/.cache
fedora-root /
fedora-varcache /var/cache
fedora-home /home
fedora-varlog /var/log
mga-root /
mga-varcache /var/cache
mga-home /home
mga-varlog /var/log
debian-root /
debian-home /home
debian-varlog /var/log
debian-varcache /var/cache
neon-root /
neon-varcache /var/cache
neon-home /home
neon-varlog /var/log
shared-libvirt /var/lib/libvirt/images
shared-snapper /etc/snapper
shared-localbin /usr/local/bin
shared-appimage /home/dalto/Applications
shared-dotsteam /home/dalto/.steam
shared-steam /home/dalto/.local/share/Steam
shared-dotmozilla /home/dalto/.mozilla
shared-dotthunderbird /home/dalto/.thunderbird
shared-dotminecraft /home/dalto/.minecraft
shared-dotlibrewolf /home/dalto/.librewolf
shared-atjoplin /home/dalto/.config/@joplin
shared-joplin /home/dalto/.config/joplin-desktop
shared-vivaldi /home/dalto/.config/vivaldi
shared-documents /home/dalto/Documents
shared-downloads /home/dalto/Downloads
shared-pictures /home/dalto/Pictures
shared-videos /home/dalto/Videos
shared-music /home/dalto/Music
2 Likes

Ah yeah I get it! (I think) Multiple mounts on a single / and then shared stuff within /home. That sounds good. :sweat_smile:

image

I need to stop now before updating my laptop becomes a full-time job. :rofl:

7 Likes

I have 6 installs on my dev machine. But they are simpler to maintain, because all of them are Arch based… :wink:

2 Likes

Gee - I only have 5 on mine. But, I wimp out on the ZFS setup - it is only on my data drive(s) - boots are on f2fs, btrfs, and ext4…

Still learning… :grin:

1 Like

Oh, and I didn’t count that Windows 10 … Not using it at all.

1 Like

I have a Win setup on a laptop - but I couldn’t say I NEVER use it… I fire it up once a year or so to remind myself why I’m not going back…

Actually, it's only there because it came on the laptop when my sister bought it!

I have Windows on a desktop. I also fire it up once a year, but I use Turbo Tax for my income taxes. Then back in the closet for a year.

Pudge

2 Likes

I use a VM for my taxes :grin:

3 Likes

I don’t have any taxes to do anymore… :sob: For that you need an income!

3 Likes

I made a few changes here and there

  • I added sharing for snapper, joplin, vivaldi and librewolf.
  • I learned that trying to share /var/lib/libvirt is a terrible idea. Now I am only sharing the images.
  • I hit a number of snags with Nixos I am still working through.
1 Like

I think (from all I have read on Nixos) that all you need to do is remove your mind, scrub it clean of all knowledge and procedures, and start again on Nixos…! Let us just say - you are a person of rare courage!

Lol.

I have been using Nixos for quite a while now. These days I mostly use it for server applications but I ran it on my laptop exclusively for about 6 months.

That being said, you are not wrong to think that you need to rethink a lot of what you know when you start using it.

Even worse - you have to rethink what you THINK you know as well! Nifty concept, capably executed - but I came up with 680x0 assembly on the first real multitasking system aimed at home… a rather different mindset!

I made a few more changes.

The biggest one is that, inspired by the recent topic on debian, I added debian testing with the latest plasma and removed nixos.

I decided nixos wasn’t worth the amount of disk space it would use up on my small laptop SSD.

I got snapper configured in all 5 distros.

I learned a few more things:

  • I have gotten much better at taking distros where the installer doesn’t support this setup in. I suspect I could any distro which supports a btrfs root shoehorned in at this point
  • I have also learned how to convert most distros to systemd-boot
  • I am glad I took detailed notes on the whole process because otherwise I would not remember how I did it six months from now
  • Because almost all the apps I use on my laptop are sharing a config, the time it takes to add a distro and get it configured is amazingly low.
  • I have also learned that the whole project is mostly pointless. :sunglasses:

The sad reality is I have five different Linux distros, each based on different major distro, and because they are all configured the same I don’t even really notice which I am using until I need to do some package management related task. I had to put the logos on the launcher buttons so I would know where I was.

Ultimately, they are all Linux and they all work.

8 Likes

Is it OK that I’m impressed anyway? I don’t know if I could follow your trail, even with a map…

Good work!

1 Like