On 8 April 2012, at 19:21, Canek Peláez Valdés wrote:
> … 
> And (optionally) convert all the files and directories to use extends:
> 
> find <directory> -xdev -type f -print0 | xargs -0 chattr +e
> find <directory> -xdev -type d -print0 | xargs -0 chattr +e

Ok, so I was just casually reading the chattr manpage, following this post… 

       The  letters  `acdeijstuADST'  select the new attributes for the files:
       append only (a), compressed  (c), …

       A  file  with  the `c' attribute set is automatically compressed on the
       disk by the kernel.  A read from this file returns  uncompressed  data.
       A  write  to this file compresses data before storing them on the disk.
    
COMPRESSED?!?!

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?

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?

Is there a reason I've been unaware of this? Why isn't this hugely popular?

Stroller.


Reply via email to