linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Hadmut Danisch <hadmut@danisch.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Setting options permanently?
Date: Mon, 30 Jan 2012 15:49:27 +0800	[thread overview]
Message-ID: <4F264B87.3090400@cn.fujitsu.com> (raw)
In-Reply-To: <4F22BCCC.5090800@danisch.de>

> Is there a way to set options like compression on a btrfs permanently to
> activate them even when mounted automatically by the desktop or manually
> by a third person?

Actually there is.

Btrfs supports per file compression flag, and if this flag is set to a
directory, all files in that directory will inherit the flag.

So you can mount the filesystem for the first time and set the flag for
the root dir, and that's it. There's a flaw that the compression method
is zlib, which should be changed to lzo (or lz4, or snappy..) in the
future.

chattr is used to set file flags, and there was a patchset to enable
compression flag for chattr, but was never merged:

http://www.spinics.net/lists/linux-btrfs/msg09604.html
http://www.spinics.net/lists/linux-btrfs/msg09605.html

      parent reply	other threads:[~2012-01-30  7:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 15:03 Setting options permanently? Hadmut Danisch
2012-01-27 23:20 ` Chester
2012-01-28  0:49   ` Hadmut Danisch
2012-01-28  3:32     ` Duncan
2012-01-28  6:05       ` Ben Klein
2012-01-28  8:23         ` Roman Mamedov
2012-01-28  9:24           ` Ben Klein
2012-01-28 10:55           ` Duncan
2012-01-30  5:57       ` Li Zefan
2012-01-28 12:07     ` Fajar A. Nugraha
2012-01-30  7:18     ` Sander
2012-01-30  7:49 ` Li Zefan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F264B87.3090400@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=hadmut@danisch.de \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).