Ubuntu – Trick installer to use btrfs root with compression

10.10btrfscompressionsoftware installation

I want to install Maverick onto a BTRFS root partition. Not for fun or testing, but because I need compression due to a small flash disk (4GB).

Now the 10.10 installer finally supports btrfs, but there is no way to enable the compress flag in it. Can I trick the installer somehow? For old versions and getting LUKS you could pre-mount partitions. Or is there an easy monkeypatch possible to enable btrfs+compress pre install?

Best Answer

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!?