I came across this thread as because I was looking to install Linux Mint Debian Edition on a flash drive and installing on compressed btrfs from the get-go. Although these solutions were not directly applicable to reaching my results I used some of this information to reach my target.
The problem was that the point of the installer formatting and mounting the partition and starting copying files was right next to each other, as so I was unable to perform the "remount" option mentioned by others above.
The LMDE version of the installer script was in python (usr/lib/live-installer/installer.py). I'm not sure if it is the same with Ubuntu, but if it is, this will be directly applicable. This allowed me to edit the script and add this line right under the line that origionally mounted the partition for "/"
os.system("mount -o remount,compress /dev/sda3 /target -t btrfs")
of coures the "/dev/sda3" will vary depending on your device.
I understand this is an Ubuntu forum, but like I said it came up with the search and this solution would be directly relevant if the installer is python based. We are all Debian here anyways, right!?
I can only answer with the available information in the different related btrfs sites. As you say, using compression is relatively safe as compression is only applied to the new written content. As per the stability of the FS, it is still in testing stage, although it seems to be pretty stable right now. About recompressing the whole disk, I'm not sure you can do it (I haven't seen it). It shouldn't be difficult to write such tool. Right now the obvious way is to copy/move the data from the partition to other disk/partition, and then re-copying, but it implies having enough space in another disk or partition to do the copy (and a fair amount of time)...
Best Answer
Format and enable LZO
I would avoid using any GUI to format;-)
mkfs.btrfs device
is good enough, depending on how you would like to make use of Btrfs features:You can make use of the compression by adding the option when mounting, for example:
The good thing about Btrfs is that LZO compression can also be enabled on a
subvol
basis, very flexible;-) For exampleNOTE: You can add compression to existing Btrfs file systems at any time, just add the option when mounting and do a
defragment
to apply compression to existing data.BTW: 2 best Btrfs docs out there:
http://www.funtoo.org/wiki/BTRFS_Fun
http://docs.oracle.com/cd/E37670_01/E37355/html/ol_btrfs.html
Make use of LZO compression:
http://www.oracle.com/technetwork/articles/servers-storage-admin/advanced-btrfs-1734952.html
USB Auto Mount
I am not too sure about this, will let other blokes answer it;-)
I'd prefer to write a simple shell script to do the mount because I won't attach the USB HDD to the computer all the time.