You are not logged in.

#1 2011-09-05 19:18:17

DarkSniper
Member
Registered: 2011-04-05
Posts: 74

[Solved] BTRFS and per subvolume Compression

I've decided to try out BTRFS, and it's been working well for me so far, but I've run into one issue that I'm not exactly sure how to fix.

For the most part, I've followed the guide on the wiki to get my setup running on BTRFS
One of the things I did differently was making a separate subvolume for /home so I can snapshot it separately from my root subvolume.
I would like to enable compression on my home subvolume only. When doing so, it seems that it was enabled for the whole pool, as extlinux refused to boot after a kernel upgrade, complaining about compressed files.

For now, I've just disabled compression and reinstalled extlinux using the install CD, since it's not all that important [but would be nice to have].

Could this possibly be caused by nesting home under __active?

Edit: Yep, that was it. Just booted into the install disk and moved my home subvolume into the root of my BTRFS pool. Compression is on, and extlinux is still fine, even after running mkinitcpio, and editing extlinux's configuration file.

Here's what my subvolumes look like:

ID 256 top level 5 path __active
ID 257 top level 5 path __active/home

Here's what I was using in my fstab:

# sda2; Btrfs Root
UUID=4665d81c-aeeb-416d-bf58-2f1d6542e6c3		/		btrfs		defaults,noatime,autodefrag		0	0
UUID=4665d81c-aeeb-416d-bf58-2f1d6542e6c3		/home		btrfs		defaults,noatime,autodefrag,compress,subvolid=257		0	0
UUID=4665d81c-aeeb-416d-bf58-2f1d6542e6c3		/var/lib/btrfs-root		btrfs		defaults,noatime,autodefrag,subvolid=0		0	0
/var/lib/btrfs-root/boot			/boot		none		bind		0	0

And here's the tree of my BTRFS root:

├── __active
│   ├── bin
│   ├── boot
│   ├── dev
│   ├── etc
│   ├── home
│   ├── lib
│   ├── lib64
│   ├── media
│   ├── mnt
│   ├── opt
│   ├── proc
│   ├── root
│   ├── run
│   ├── sbin
│   ├── srv
│   ├── sys
│   ├── tmp
│   ├── usr
│   └── var
├── boot
│   ├── extlinux
│   ├── initramfs-linux-ck-fallback.img
│   ├── initramfs-linux-ck.img
│   ├── vmlinuz26-ck -> vmlinuz-linux-ck
│   └── vmlinuz-linux-ck
└── __snapshot

Last edited by DarkSniper (2011-09-05 23:38:43)


Failure is not an option... It comes bundled with Windows.

Offline

#2 2011-09-25 17:28:44

eric
Member
From: under heaven
Registered: 2004-02-11
Posts: 118

Re: [Solved] BTRFS and per subvolume Compression

Are you sure that compression is enabled in only one subvolume instead of compression is disabled in all subvolumes?

I ask this because I've tried to do the same with no success.
see: https://bbs.archlinux.org/viewtopic.php?id=126635

What I've found was:
- The 'mount' command and 'cat /etc/mtab' both show that one subvolume uses compression and the other does not;
... but ...
- Copying a textfile to these subvolumes and checking the used space with the commands 'sync && df' shows that both subvolumes use compression or none use compression (depending which subvolume is mounted first).

And according to an 1 year old thread in the btrfs-linux mailinglist, turning on compression on a per-subvolume basis is not possible.
see: http://www.mail-archive.com/linux-btrfs … 05552.html

So, can you confirm that it is working for you (or not) by copying a big text file (or an other file that is easy to compress) to the compressed subvolume and then checking the free space with the command 'sync && df', and then doing the same but now copying to the non-compressed subvolume?

Offline

#3 2011-09-27 22:31:11

eric
Member
From: under heaven
Registered: 2004-02-11
Posts: 118

Re: [Solved] BTRFS and per subvolume Compression

I assume that per subvolume compression is not possible, even though some people post their partition layout with per subvolume compression on the same device using the btrfs filesystem.
Also because of this thread (from 4 months ago) on the btrfs-linux mailinglist:
http://www.mail-archive.com/linux-btrfs … 09885.html

But there is hope that (soon?) this will be possible, at least that is how I interpret the next e-mail:
http://www.mail-archive.com/linux-btrfs … 12437.html

Offline

Board footer

Powered by FluxBB