What is Btrfs?
Btrfs is a new copy on write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Jointly developed at Oracle, Red Hat, Fujitsu, Intel, SUSE, STRATO and many others, Btrfs is licensed under the GPL and open for contribution from anyone.
Why Btrfs?
It is possible to dynamically resize mounted filesystems
filesystems can span physical volumes, with optional RAID support
physical volumes can be added to and removed from mounted filesystems
compression option
snapshots (including read-only and read-write) and seeds
has a mode that is optimized for solid-state drives
1. Download KaOS Test Cycle 2014.04 ISO
2. Preparing USB
Using the command line
In order to create a bootable USB flash drive, you will need coreutils (which provides dd). Most GNU distributions have coreutils already installed.
To use dd, open a terminal and write (substitute the correct path):
sudo dd if=/path/to/the/downloaded/iso of=/path/to/the/USB/device
3. Boot live USB
4. Format as BTRFS
Current installer is not ready enough to create Btrfs partitions so you have to use others options.
Using terminal you may use parted to create partitions and mkfs to format as Btrfs $ mkfs.btrfs /dev/sdX
But for this tutorial I've installed Gparted
$ sudo pacman -S gparted
When our new partition Btrfs is ready close Gparted.
5. Install KaOS.
Here you have to follow the typical steps, but be careful and don't forget. Do not format again!
Just choose yes, the partition is already formatted, so it's safe.
6. Edit fstab
$ kdesu kate /etc/fstab
And edit until it looks like this.
UUID=YOUROWNUUID / btrfs rw,noatime,compress=lzo,ssd,discard,space_cache,inode_cache 0 1
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/spool tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
Where:
rw - Partition is mounted in read-write mode
noatime - Don't update inode access times on the filesystem. Can help performance
compress=lzo - Data compression enable
Discard - Optional if you already use ssd option, enable TRIM.
All others options optimize cache and send temps to RAM.
Recomendations
Verify if your SSD is align using $ sudo blockdev --getalignoff /dev/sda4
if the result is 0 then your SSD is correctly aligned.
Creating a snapshot:
# mount /media/btrfs
# cd /media/btrfs
# btrfs subvolume snapshot root root_snapshot_2011_01_11
# cd ~
# umount /media/btrfs
Rolling back a snapshot:
# mount /media/btrfs
# umount /home
# mount -o defaults,subvol=home_snapshot_A /dev/sda /home
# btrfs subvolume delete /media/btrfs/home # optional; this is so the
# mv /media/btrfs/home_snapshot_A /media/btrfs/home # /etc/fstab need not change.
# umount /media/btrfs