godarch / darch

A tool for building and booting stateless and immutable images, bare metal.
https://godarch.com/
MIT License
832 stars 32 forks source link

Works w/ ZFS & ZBM? #54

Open dm17 opened 3 years ago

dm17 commented 3 years ago

Any idea how Darch would mesh with a system that runs ZFS on its root, and uses ZBM (https://github.com/zbm-dev/zfsbootmenu)? Thanks for the great software!

dm17 commented 3 years ago

After thinking on this a bit more... I wonder what it would take to replace Darch's docker imaging with ZFS snapshotting.

pauldotknopf commented 3 years ago

Is it possible to mount a snapshot as a file system?

dm17 commented 3 years ago

@pauldotknopf Seems so, ZBM has a selection menu for snapshots. The devs are very knowledgeable & responsive on https://github.com/zbm-dev/zfsbootmenu/ I'm not sure if any features from https://github.com/jimsalterjrs/sanoid/ would be needed to pull this off.

Oh, and docker has a ZFS storage driver! https://docs.docker.com/storage/storagedriver/zfs-driver/

So this could be a fairly simple, more space efficient, and more performant setup... But would need help from you to understand how the pieces fit together in terms of Darch. ZBM + ZFS + Docker + Darch? Seems more elegant than Nix :)

dm17 commented 2 years ago

@pauldotknopf Just wanted to reply with a blurb from Andrew, a ZBM developer:

"I don't know enough about Darch to understand its layout and interaction with GRUB in its normal configuration.

If Darch can be made to put kernel and initramfs pairs into a boot subdirectory of some ZFS filesystem, you can probably get ZBM to find and boot them. You can select different kernels from the kernel-selection submenu. ZBM kernel-selection logic tends to select the highest kernel version by default and provides a limited mechanism (based on file-name matching) for pinning the default kernel that it boots.

Alternatively, if Darch can be made to dump each environment's kernel/initramfs on a separate filesystem, ZBM will handle them separately at the top level. This will most naturally fit our management model."

i2 commented 2 years ago

Any update on this? I'm very interested too.