# Btrfs internal disk - Wiping the fs metadata ```bash sudo wipefs -af /dev/sdx ``` - Creating partition scheme ```bash sudo fdisk /dev/sdx ``` g -> n [enter until done] -> w. `fdisk -l /dev/sdx` should now display /dev/sdx1 as a partition. - Creating fs with a default subvolume, for easy extension in the future ```bash sudo mkfs.btrfs /dev/sdx1 sudo mount /dev/sdx1 /mnt sudo btrfs subvolume create /mnt/default sudo btrfs subvolume set-default /mnt/default ``` - Giving user with UID 1000 ownership of the mounted path ```bash sudo chown -R 1000:1000 /mnt ls -l / | grep mnt # This should be owned by you (assuming UID 1000) sudo umount /mnt ls -l / | grep mnt # This should be owned by root after unmount ``` - Editing /etc/fstab ```bash lsblk -o Name,Label,Size,UUID # Identify the UUID of the new btrfs partition ``` - Creating desired mountpoint, (/storage, for example) ```bash sudo mkdir /storage ``` - In /etc/fstab, insert the line: ```bash UUID= /storage btrfs compress=zstd:1,rw,nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name= 0 0 ``` - Verification `sudo mount -a`