a double-sided script to run right after first system boot, to mount subvolumes in a Debian BTRFS system, set up snapshots and automatic backups, in a scoop of buttery smoothness
Because like butter in a toaster, butter-filesystem in your drive makes homelab management smooth, efficient, and deliciously simple.
- BTRFS subvolumes for root (
/) and home (/home) partitions - ZRAM (because swap in RAM is faster and c00ler)
- mount options for SSDs longevity (
noatime, compress=zstd,ssd) and TRIM on disk once a week - snapshot of the filesystem immediately after the installation, so you can always roll back
- automatic backup of
/homedirectory - keep the system alive even when the laptop lid is closed
- disable sleep/hibernation (because, well, it's a server, not a napper)
🧈 /root + /home on BTRFS subvols 📸 Snapshots ready to roll back 🛟 Auto-backups on USB plug-in 💨 ZRAM + SSD tweaks for speed
- a freshly installed Debian (11 or above) server
- msdos or gpt partition table (old BIOS/no EFI computers use msdos/MasterBootRecord and do not require a specific
/bootpartition) - two btrfs primary partitions with
noatimemount options/(bootable)/home
- one swap area of 2GB should suffice (just in case)
- sudo privileges to execute the script (install sudo with root user and add sudo user)
- USB device labeled "backups" for automatic backups
- a copy of this script or an Internet connection
butter.sh sets up Btrfs and reboots to lock it in. Then t0aster.sh finishes the job—snapshots, backups, and a system check. Smooth as butter, twice as nice!
Once the Debian installation is finished and the server has rebooted, log in with the sudo user account (we do not recommend using root account - and we advise to never install funny scripts like this one with the root superuser) and run cd to reach the /home directory.
-
download the scripts to the sudo user
homedirectorycd && wget https://raw.githubusercontent.com/lerez0/butter-t0aster/main/butter.sh && wget https://raw.githubusercontent.com/lerez0/butter-t0aster/main/t0aster.sh
-
run the scripts from your sudo user home folder
sudo bash butter.sh # mounts BTRFS subvolumes and reboots # after reboot: sudo bash t0aster.sh # configures snapshots and backup, ZRAM and SSD
This will automatically configure your system, apply all the optimisations, and reboot the server.
🔥 oops!? If anything glitches, peek at /var/log/butter-t0aster.log for clues!
We'd be glad to read your experience - please return your comments in the 'Issues' section."
Feel free to fork and edit the script to suit your needs! Want to change the snapshot frequency? Adjust the swappiness value? Or maybe add another backup target? All of that can be done by editing the butter.sh and t0aster.sh files.
This project is under the MIT License. See the LICENSE file for details.
If you have suggestions or improvements for the script, feel free to open an issue and send us love.
Crank it up a notch with our Debian firstb00t script and harden your setup to NSA-grade specs — because a smooth server deserves a tough shell!
Grab it at firstb00t repo. Expect a quick spread of safety: tighter SSH, sneaky firewall rules, email sender, spinning containers, and a log to peek at (/var/log/firstb00t.log). Your server’ll be slick and secure — ready to toast any troublemaker!
We'd like to thank JustAGuy Linux and Stephen's Tech Talks for their inspiration
made with ⏳ by le rez0.net
