Just wanted to make sure and ask if this is good enough.

set -e

echo "=== fstrim ==="
fstrim -av

echo "=== BTRFS scrub status before ==="
btrfs scrub status /

echo "=== BTRFS scrub start ==="
btrfs scrub start -B /

echo "=== BTRFS scrub status after ==="
btrfs scrub status /

echo "=== BTRFS balance (50%) ==="
btrfs balance start -dusage=50 /

echo "=== Done ==="```
  • ewoksarebased@lemmy.mlOP
    link
    fedilink
    arrow-up
    1
    ·
    2 days ago

    Got scared in another posts comment section that btrfs needs “so much” maintenance and got suggested that I should use something like this. I use Fedora btw.

    • bearforcepilot@lemmy.zip
      link
      fedilink
      arrow-up
      5
      ·
      9 hours ago

      A lot of people who use Linux have preferences toward one thing or another, and will say pretty silly or outlandish things about competing projects.

    • warcat@lemmy.ml
      link
      fedilink
      arrow-up
      7
      ·
      2 days ago

      Hello, I have been using fedora with btrfs on various old computers for a few years and never had any problems without doing maintenance (aside from backups).

    • talkingpumpkin@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      2 days ago

      fstrim is most probably already handled.

      If you are adding a btrfs disk to an existing install you might want to check if there’s a systemd unit that runs btrfs scrub: run systemctl list-units '*btrfs*' and see what it prints.

      For btrfs balance… I read that you generally don’t want to run it (it can be pretty IO intensive) unless you added/removed disks or are troubleshooting. My tumbleweed does have a service that boils down to running btrfs balance weekly though (with values far below your 50; see sources available at https://github.com/kdave/btrfsmaintenance)

    • BCsven@lemmy.ca
      link
      fedilink
      arrow-up
      2
      ·
      2 days ago

      If you load a distro that already has btrfs options, they will have maintenance scripts built in. You shouldn’t need to touch btrfs manually on those, other than setting if your snapshots are cleaned up by number, or by time