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!?
The default is gz
. The best results I get with 7z
though.
Here is the results for a 1.4 Gb virtualbox container:
![enter image description here](https://i.stack.imgur.com/b6P7d.png)
Best compression – size in MB:
7z 493
rar 523
bz2 592
lzh 607
gz 614
Z 614
zip 614
.arj 615
lzo 737
zoo 890
Source
![enter image description here](https://i.stack.imgur.com/9s5c8.png)
Install
sudo apt-get install p7zip-full
Best Answer
This benchmark provides some good information about this issue. It seems that LZMA has slightly better compression ratios and performance than XZ but XZ is generally preferred due to 'practical reasons' (I'm not sure what these are).
XZ is an implementation of the lzma2 algorithm and is better at compressing 'uncompressable' data:
(http://www.jrsoftware.org/ishelp/index.php?topic=setup_compression)
You should be OK using either.