Skip to content

Instantly share code, notes, and snippets.

@ruzickap
Last active May 18, 2024 04:33
Show Gist options
  • Save ruzickap/a276dafd819e6390966c29d2c2d28d86 to your computer and use it in GitHub Desktop.
Save ruzickap/a276dafd819e6390966c29d2c2d28d86 to your computer and use it in GitHub Desktop.
Create BTRFS partition on the HDD SATA disk used for backups
parted --script /dev/sda mklabel gpt
parted --script /dev/sda mkpart primary btrfs 0% 100%
mkfs.btrfs --runtime-features free-space-tree --label My_Disk_2_TB --nodiscard /dev/sda1
# Entry in /etc/fstab
# LABEL=My_Disk_2_TB /mnt/usb btrfs noatime,nodiratime,compress=zstd,autodefrag,space_cache=v2
# Links:
# * https://wiki.tnonline.net/w/Btrfs/Space_Cache
# * https://unix.stackexchange.com/questions/53378/how-can-i-script-the-creation-of-a-single-partition-that-uses-the-entire-device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment