Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Extended file attributes: ext4
Date: Mon, 09 Apr 2012 14:11:20
Message-Id: CA+czFiADDDonMPuzYiofAQMGW3d1uXmbrOHR1M+z_Ae=HgayqA@mail.gmail.com
In Reply to: Re: [gentoo-user] Extended file attributes: ext4 by Stroller
1 On Mon, Apr 9, 2012 at 6:06 AM, Stroller <stroller@××××××××××××××××××.uk> wrote:
2 >
3 > On 8 April 2012, at 19:21, Canek Peláez Valdés wrote:
4 >> …
5 >> And (optionally) convert all the files and directories to use extends:
6 >>
7 >> find <directory> -xdev -type f -print0 | xargs -0 chattr +e
8 >> find <directory> -xdev -type d -print0 | xargs -0 chattr +e
9 >
10 > Ok, so I was just casually reading the chattr manpage, following this post…
11 >
12 >       The  letters  `acdeijstuADST'  select the new attributes for the files:
13 >       append only (a), compressed  (c), …
14 >
15 >       A  file  with  the `c' attribute set is automatically compressed on the
16 >       disk by the kernel.  A read from this file returns  uncompressed  data.
17 >       A  write  to this file compresses data before storing them on the disk.
18 >
19 > COMPRESSED?!?!
20 >
21 > You mean, all I need to do is `touch new.dd.img && chattr +c new.dd.img && dd if=/dev/sdX of=new.dd.img` and I never again need to worry about piping dd through bzip and bunzip?
22 >
23 > If I have a massive great big uncompressed dd image, I can compress it as simply as touching a new file, changing this attribute on the new file and copying it over?
24 >
25 > Is there a reason I've been unaware of this? Why isn't this hugely popular?
26 >
27 > Stroller.
28
29 From the kernel sources, Documentation/filesystems/ext2.txt:
30
31 " Specification
32 =============
33
34 ext2 shares many properties with traditional Unix filesystems. It has
35 the concepts of blocks, inodes and directories. It has space in the
36 specification for Access Control Lists (ACLs), fragments, undeletion and
37 compression though these are not yet implemented (some are available as
38 separate patches). There is also a versioning mechanism to allow new
39 features (such as journalling) to be added in a maximally compatible
40 manner. "
41
42 So, ext2's extended attribute set listed support for compression
43 (among other things), but it wasn't implemented. None of the other
44 ext*.txt files reference compression.
45
46 Digging into the kenrel source for ext4 in linux-3.2.1.-gentoo-r2,
47 there are symbols defined for managing compression, but they're not
48 used. In short, compression support is specced, but not implemented.
49
50
51
52 --
53 :wq

Replies

Subject Author
Re: [gentoo-user] Extended file attributes: ext4 Stroller <stroller@××××××××××××××××××.uk>