Hi BP25,

BP25 <[email protected]> writes:

Hello everyone,
I'm planning to install Guix/Linux-libre with a CoW filesystem like BTRFS, hence the following question: would in this case not be neat to use the filesystem intrinsic snapshot feature for storing package generations, rather than using different folders (in the "current version" of the filesystem) as the Guix package manager seems to be
doing?

Thank you for the thoughts. When making engineering decisions, I always try to weigh the cost/benefit; I see a lot of costs to CoW, but I’m not clear on the benefit. Could you explain a bit more about what you think that would be?

I don’t know that much about how Guix manages the store, but just based on what I do know, have a lot of concerns about what this would look like.

- What are we snapshotting, exactly? The store, or something else?

I’m not sure what benefit snapshotting the store would have. The items for older generations stick around until you delete the generation *and* `guix gc', so you can always use a previous generation, if you choose. This isn’t like an imperative system where updating a package replaces the old version -- the old version persists until you explicitly remove it.


- Are we snapshotting profiles?

This makes a little more sense to me than snapshotting the store, but has a lot of complexity. Profiles don’t all live in the same place (Guix Home profiles are store items; imperative profiles (ex `guix install ...') are in /var/guix/profiles). The latter may be on a completely different filesystem from /gnu/store, so you’d need some way of creating two snapshots, otherwise you’d have profiles pointing to stuff that may have been gc’d from the store. I think we’d probably also need /var/guix/profiles to be on a dedicated FS, otherwise the snapshots would include the whole root FS, which seems like a bad thing.

We’d also have to completely change GC, to look in all snapshots to determine which store items are still alive.


- What about filesystems without snapshots?

We either would have to limit Guix to running on systems with filesystems that have this (so no ext4, and maybe no Hurd?), or have two systems running in parallel, depending on the FS setup, which changes how Guix works at a very fundamental level.


- What about split-FS setups?

What if my store is on btrfs, but / is on ext4?

Basically, I think the system to manage FS snapshots is likely to be more complex than what we already have, and work in fewer circumstances. It would have to be a very substantial benefit for that cost to be worth it, IMO.

 -- Ian

Reply via email to