Comment by ad404b8a372f2b9

5 years ago

That's why I setup my Linux install to work like a live-CD, with a two layer filesystem: a read-only base, and a read-write overlay that lives in the RAM. The files that I know I want to keep are bound from a read-write partition on the disk to the RAM filesystem, and all the rest gets deleted every time I shutdown my PC.

A lot of pieces of software non-maliciously keep records of everything you do with them through logs or caches that aren't straightforward to delete and it's the only way I found to have control over it.

How do you persist files you care about? Another separate partition?

This is an interesting approach. Do you have any documentation on to how it was setup? Also, how do you change a setting in your browser? Do you have to rebuild your base layer?

  • Yes, the read-write disk partition also holds my files.

    No docs I'm afraid and I set it up too long ago to remember the exact details. I used overlayroot, there are some really good resources on google to set it up like this. If I remember correctly it's just a matter of setting the overlayroot.conf file to:

      overlayroot_cfgdisk="disabled"  
      overlayroot="tmpfs:swap=1,recurse=0"  
    

    And then a grub option to mount the base in read-only:

      linux /boot/vmlinuz-5.3.0-51-generic root=UUID=... ro  $vt_handoff
    

    Then you add your mounts in fstab for persistent stuff.

    I think this blog post describes it well: https://spin.atomicobject.com/2015/03/10/protecting-ubuntu-r...

    For modifications to the base, installing or modifying software, etc I have a grub option to disable the overlay system and mount the base partition in read-write so it can be used normally. So I reboot into this option, do my changes, then reboot immediately in overlay mode.

      linux /boot/vmlinuz-5.3.0-51-generic root=UUID=... rw overlayroot=disabled  $vt_handoff  
    
    

    It took me about a month to get used to it, sometimes I'd apt-get something then the next day I'd facepalm after realizing I had done it in overlay-mode and had to do it all over again. I haven't lost any personal files though, it's pretty easy to remember to avoid saving them to your home and instead go to the persistent partition.