• beeng@discuss.tchncs.de
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    I wanted btrfs for ages for snapshots… Then I moved to nixos with Declarative config… Then I needed to move partitions to extend my drive into old root, decided to move to btrfs from ext4 cos why not at the time… Only afterwards do I realize snapshots aren’t that helpful when you’re on nixos… Or am I missing something?

  • forestbeasts@pawb.social
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    btrfs subvolumes are cool, but I’ll still take partitions for separation. The whole point of having a separate home partition is that it’s separate from / if we have to, say, reinstall the OS, or the filesystem breaks or whatever.

    sure it might be possible to install an OS into a btrfs subvolume without wiping other subvolumes, but do I wanna risk it? Nah.

    – Frost

    • Ooops@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      sure it might be possible to install an OS into a btrfs subvolume without wiping other subvolumes, but do I wanna risk it?

      There is neither a “might” nor a risk. Subvolules behave like partitions with the only actual difference being that they are not fixed in size but all share the same space.

    • Scoopta@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      Might be possible? It’s not only possible but rather easy to do, in fact I often have multiple installs side by side in different subvolumes and I can switch between them, reinstall as needed, snapshot them. The only partition I have separate is /boot because it has to be vfat for the esp. Tbh accidentally blowing up a subvolume isn’t all that much more or less difficult to do than accidentally blowing up a partition. IMO if you’re paranoid about wrecking something the only safe separation is multiple drives and disconnecting the one you want to avoid touching. I keep home in a separate subvolume specifically for the separation you mention, it can persist across different installs because it’s separate. Subvolumes are fully isolated from most failures with the exception of filesystem corruption.

    • Magiilaro@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      I like to create partitions with specific max sizes, you can’t do that with btrfs subvolumes unfortunately. It is possible to set a quota but that can have a major performance impact with btrfs so it is not really a valid Option.

      Thats why I shy away from using btrfs subvolumes.

    • Illecors@lemmy.cafe
      link
      fedilink
      English
      arrow-up
      0
      ·
      6 months ago

      That… Is literally how you do it. You install the system onto a subvolume. Or many, in fact - the way I do. Root, var, srv, home, opt all get their own subvolume. Only boot stays as a separate partition.

      • fruitcantfly@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        6 months ago

        Ignoring /boot, what is the benefit of putting everything else in different subvolumes? As opposed to just one subvolume for / and one for /home, which is what I currently have. It just looks to me like it’d be extra work, but I’m probably missing something

        • SteveTech@aussie.zone
          link
          fedilink
          arrow-up
          0
          ·
          6 months ago

          You can snapshot them independently. E.g. I snapshot / on every update and boot, /home every boot, and temporary file directories such as /tmp & /var/tmp don’t get snapshot at all and are also mounted with nodev,nosuid,noexec flags.

        • Ooops@feddit.org
          link
          fedilink
          arrow-up
          0
          ·
          6 months ago

          You snapshot them separately, with snapshots stopping where another subvolume starts. Have a problem booting? Copy the latest /-snapshot. But if for example /var/log is a separate subvolume it persists and you can look up what was wrong.

          My setup right now has subvolumes root(mounted to /), home(mounted to /home) , logs(mounted to /var/log), snapshots(mounted to /.snapshots), pacman-cache(mounted to /var/cache/pacman) and swap(for the swapfile obviously).

          I do snapshots of root, home and logs (landing in snapshots) regularly that don’t require much space (only the difference between on subvolume and its snapshot uses real space in btrfs) and which can all be restored together as well as separately, while losing the temporary data in cache and swap is not problem.

          And you can also transfer the snapshots somewhere else as backup (into another brtfs filesystem or as a file), including just transfering the difference from the last one as an incremental backup.

  • Mucki@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    6 months ago

    Does btrfs still slow down the system until freezing, when doing snapshots of the sys subvolume? I never used btrfs again. Imagine, you set a cron for hourly snapshots, and what you get is 2 minutes of freezing every full hour 🙈 I never had that kind of trouble with other snapshotable file systems as sys volume.

    • Magiilaro@feddit.org
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      This can happen when gquotas are enabled, thats why gquotas are not recommended with snapshots

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      Never experienced that before. I have been on openSUSE for 9 years now, snapshots are pretty much instantaneous.