• kristoff@infosec.pub
    link
    fedilink
    arrow-up
    3
    ·
    3 months ago

    Concerning linux, yesterday I was watching this video on computerphile on the crowdstrike incident. https://www.youtube.com/watch?v=rlaNMJeA1EA (*)

    What is interesting is the comment made in the video on how chromebooks do software upgrades with dual “OS” disk-partitions and the ability to rollback to the previous OS-partition.

    Question: is something like this also possible on one of the major linux distros? (debian, ubuntu, rocky, …) What would be the procedure to do this kind of “dual partition” system-upgrade?

    (*) a great video that explained some of the technical details in a very clear way, including some very interesting ‘lessons learned’ and "what if"s If you ever need to explain crowdstrike to your manager, this video is a good start.

    • Unmapped@lemmy.ml
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      3 months ago

      If I’m understanding the question right. This is what Immutable Linux distros do. Such as Nixos, fedora silver blue, and vanilla os.

      I use nixos myself. But its quite different then most distros. The way you config it and install packages. For the better in my opinion.

      Something like silverblue works pretty much the same as normal Fedora except you can’t install packages like you normally would. Because the system files can’t be edited. You mostly use flatpak for everything. Except the system updates. Which you have to reboot to switch to the new updated image. But past images are saved so you can rollback if needed.

      From what I understand Chromebook os is a Immutable Linux distro same as the ones I mentioned. Just with Google with built in.

      • kristoff@infosec.pub
        link
        fedilink
        arrow-up
        2
        ·
        3 months ago

        Yes, that was indeed the question.

        If I read it correct, you need a specialised distro for this. You cannot do this on a off-the-shelf Debian or Ubuntu?

        I’ll do some searching on ‘unmutable Linux’. Thanks for the (very quick) answer! 😀

        • Unmapped@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          3 months ago

          There is a file system you can use. A alternative to ext4. I think its Btrfs. I never tried it. But it let’s you take snapshots that you can restore to. That’s not just system files but everything. And pretty sure you can use it with a disto like arch and Debian. I think that’s how snapshots work. But as I said I never actually tried it out.

          • kristoff@infosec.pub
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            just watched some videos on btrfs. Looks interesting indeed. I will look into it and perhaps do a test-installation and see how it goes.

            Thanks for the info

        • tetris11@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          I think the answers given here don’t quite fit the question.

          Android and Windows have dedicated recovery partitions sectioned off on the disk that the OS never boots to and does not interact with during normal system operation.

          If something goes wrong with the OS, then a signal is sent to the BIOS or other non-OS system to “hey, recover from this partition”.

          Btrfs, NixOS, Guix, and other immutable (file-)systems, implement this via having a file system hierarchy protected by various permissions and softlinks to create a checkpoint of sorts, which is managed by a dedicated service that runs with the OS during normal system operation.

          The drawback of these systems is that if something does go wrong with the OS, it cannot fallback to the BIOS to save it. The OS has to somehow signal to itself that it needs to restore from an earlier checkpoint.

          • kristoff@infosec.pub
            link
            fedilink
            English
            arrow-up
            1
            ·
            3 months ago

            Just watched some videos on btrfs. I start to understand the conceps. Perhaps I should also look into how exactly

            On windows and the “recovery partion”. I guess what you say is that it should always be possiblity to boot in some kind of system, but it will not happen automatically as there is no way for a system to detect that the system completely hangs.

            Thinking about it. It kind of strange. Embedded systems have watchdog interrupts that get fired if the system hangs (i.e. if it does not provide a “yes, I still live” signal every “x” milliseconds). Does a PC not have something similar?

            • tetris11@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              3 months ago

              embedded systems have the advantage of all using a single bootloader: Uboot, so the error path is always known and the software knows how to fallback.

              With x86_64 systems it’s a mixed bag, and maybe the windows and linux bootloader knows what to do, but in most cases it will just signal an error and stop

      • lproven@social.vivaldi.net
        link
        fedilink
        arrow-up
        0
        ·
        3 months ago

        @kristoff @purplemonkeymad But watch out: you will need a *huge* root partition, because it’s very easy to fill it with snapshots and if it reaches 100% it *will* corrupt.

        Btrfs is tricksy: it won’t give a straight answer to df -h and there is no working equivalent of fsck.

        • lproven@social.vivaldi.net
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          @kristoff @purplemonkeymad All of these are in-place same-disk snapshots. The ChomeOS system is simpler and so can be automated but you only get 1 level of undo.

          I don’t know any mainstream OS that does dual-failover. Deepin Linux has 2 root partitions but I don’t know how it uses them.

          I think Valve SteamOS does something like this. It’s not just for games: it has KDE built in. There are guides to getting it running on your own hardware. You will want AMD graphics, though.

          • kristoff@infosec.pub
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            3 months ago

            As I mentioned earlier, I guess chrome is more like android where you have a much more strict seperation between the OS, applications and user data. (I remember reading about all the different partitions on android and what they are used for, but I should bruch up my knowledge on this).

            Thanks for the additional into on brtfs! 👍