Setup guide for the partitioning, filesystem creation, subvolume creation, mounting, and then later bootstrapping Use as general guide along with the regular official wiki approach
We will need two of them, one for /boot and the other one will be a btrfs partition with subvolumes.
mkfs.fat -F32 /dev/sda1
mkfs.btrfs /dev/sda2
I would recommend to use GPT partitioning scheme because it is just better, unless you want to do windows dualboot then I'm just sorry for you...
We will create few of them to support easy snapshoting with snapper
Mount the root btrfs volume
mount /dev/sda2 /mnt
Create subvolume for root, home, var and one for snapshots
btrfs subvolume create /mnt/@root
btrfs subvolume create /mnt/@var
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@snapshots
Mount them.
umount /mnt
mount -o noatime,compress=lzo,space_cache,subvol=@root /dev/sda2 /mnt
mkdir /mnt/{boot,var,home,.snapshots}
mount -o noatime,compress=lzo,space_cache,subvol=@var /dev/sda2 /mnt/var
mount -o noatime,compress=lzo,space_cache,subvol=@home /dev/sda2 /mnt/home
mount -o noatime,compress=lzo,space_cache,subvol=@snapshots /dev/sda2 /mnt/.snapshots
Make sure that fstab is okay after you finish
You can create snapshots like so
btrfs subvolume snapshot -r / /.snapshots/@root-`date +%F-%R`
And to restore from snapshot you just delete the currently used @root and replace it with a earlier snapshot
mount /dev/sda2 /mnt
btrfs subvolume delete /mnt/@root`
brtfs subvolume snapshot /mnt/@snapshots/@root-2015-08-10-20:19 /mnt/@root
and then just reboot :)
you will probably want to use Snapper or something like that to manage your snapshots.