Snapshotting GoboLinux

cosminap made an interesting post in the forum about “snapshotting” a GoboLinux system (the relevant part is at the end of the post). S/he suggests using a union filesystem to do so magically, and also do away with patching of programs to fit the filesystem hierarchy (a common thread from earlier posts: I don’t think it’s necessary or terribly useful. I might make a longer post later). However, there’s also a suggestion of doing the same thing by making copies of the /S/L tree and creating a symlink to the newest version, which I think is viable.

I did a little testing on my dummy system, and there’s nothing in Scripts that requires the entries under /System to be real directoriesmodprobe requires /System/Kernel/Modules to be real all the way through and doesn’t follow symlinks, so it has to be real always.. It is perfectly possible to move /S/L to /System/Links- and run ln -s Links-20071220171925 /System/Links, and have a working system afterwards (remembering that you’ll have to call /P/CoreUtils/Current/bin/ln manually, since it won’t be in the path that first time).

Making additional copies and switching the symlink around will let you have pretty effective snapshots of your system state. It isn’t as simple as cosminap suggested, though: as I said, kernel modules must be installed in a real path, and aren’t under the /S/L hierarchy, and neither is the kernel, one of the examples in the post. Unmanaged files in general would only be updated with a SymlinkProgram run. Settings can also change between versions and wouldn’t be covered, nor would /Programs/*/Current. So it would mainly be useful as a recovery method from a single broken install, rather than a full system snapshot, and in that case you’d know what was wrong and be able to revert it yourself.However, it would be useful to be able to perform multiple installs atomically, which is part of the problem identified in the post. I’d like us to look into whether it’s possible to do that. I think it’s at least technically possible with ChrootCompile, so we might be able to add it in the future. A script to make a dated copy and to make or update the symlink might be nice to have for the cases where it is useful, if somebody wants to write it (hint).

What cosminap really wants here is a full snapshotting filesystem, like ZFS. It’s only available through FUSE for Linux, so it’s probably not as performant as you’d like for your root filesystem. I remember hearing that NTT made a native filesystem with similar functionality, but I couldn’t find it just now. That’s a better level to implement this than in the system tools, given the range of changes that can be made, and the need for the restored system state to be consistent. The filesystem or dedicated backup software is where this belongs.

3 Responses to “Snapshotting GoboLinux”

  1. mAcCo says:

    ZFS looks really wonderful. When will Gnu/Linux adopt it as a default? 😀
    By the way the part concerning the creation of multiple /S/L copies sounds interesting, especially if it can be used to un-symlink packages without actually removing them. But I think it would require to make a copy of every /P entry, or there’s a more friendly way to do it?

    You should post this comment on the forum too. Bye.

  2. Michael says:

    ZFS isn’t available under a compatible license, so not for a while. You can run it through FUSE, but it’s slow (not that slow, but not fast enough to be the default root).

    You would have to make a copy, or at least a listing of data in each /P entry, to restore Current properly, and you might need to copy Settings. The version entries wouldn’t need it, though, so you’d save space on that. It isn’t actually necessary to make those copies to make it work, but you will end up with an inconsistent system when you restore a /S/L snapshot. It wouldn’t be problematic in almost any case, but there’s always a possibility that it could, especially when you install other software later and the dependency checks in Compile pick up the wrong version.

    By the way, you can un-symlink packages without removing them – that’s what DisableProgram does. You can also use Compile/InstallPackage –no-symlink to skip that stage altogether. You can still run the programs by providing their full path.

    And thanks for the feedback.

  3. mAcCo says:

    Oh, I see. Well, I think I should look deeper in scripts’ folder next time 😀
    In fact there are many of them. The wiki should definitely be updated 😛

Leave a Reply

You must be logged in to post a comment.