FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 04-30-2010, 05:43 AM
Valent Turkovic
 
Default Fwd: Btrfs compression

How to recompress data already on btrfs partition?

Cheers.

---------- Forwarded message ----------
From: Valent Turkovic <valent.turkovic@gmail.com>
Date: Thursday, April 29, 2010
Subject: Btrfs compression
To: Community support for Fedora users <users@lists.fedoraproject.org>


Hi, AFAIK btrfs compression is enabled via mount option. I'm now
installing Fedora 13 beta on / partition formated As btrfs. During
install there is no option for compression. If I add compress option
after install is there a way to compress data that was saved during
the install?

Cheers!

--
pratite me na twitteru - www.twitter.com/valentt
blog: http://kernelreloaded.blog385.com
linux, anime, spirituality, windsurf, wireless, ronjenje, pametne kuće, zwave
registered as user #367004 with the Linux Counter, http://counter.li.org.
ICQ: 2125241, Skype: valent.turkovic, MSN: valent.turkovic@hotmail.com



--
pratite me na twitteru - www.twitter.com/valentt
blog: http://kernelreloaded.blog385.com
linux, anime, spirituality, windsurf, wireless, ronjenje, pametne kuće, zwave
registered as user #367004 with the Linux Counter, http://counter.li.org.
ICQ: 2125241, Skype: valent.turkovic, MSN: valent.turkovic@hotmail.com
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 04-30-2010, 01:40 PM
Adam Jackson
 
Default Fwd: Btrfs compression

On Fri, 2010-04-30 at 07:43 +0200, Valent Turkovic wrote:
> How to recompress data already on btrfs partition?

find / -xdev -type f | while read i; do
cp $i /tmp/tmp
rm $i
mv /tmp/tmp $i
done

Obviously, don't actually run that.

- ajax
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2010, 03:32 AM
Kevin Kofler
 
Default Fwd: Btrfs compression

Adam Jackson wrote:
> find / -xdev -type f | while read i; do
> cp $i /tmp/tmp
> rm $i
> mv /tmp/tmp $i
> done

I presume that cp should be cp -p? And I guess it would be better to do a mv
-f rather than rm + mv, otherwise you're going to have trouble when you hit
/bin/mv. :-) And of course this needs to run as root.

> Obviously, don't actually run that.

Well, are there any other caveats than the ones I listed above?

Kevin Kofler

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2010, 04:19 AM
Matt McCutchen
 
Default Fwd: Btrfs compression

On Sat, 2010-05-01 at 05:32 +0200, Kevin Kofler wrote:
> Adam Jackson wrote:
> > find / -xdev -type f | while read i; do
> > cp $i /tmp/tmp
> > rm $i
> > mv /tmp/tmp $i
> > done
>
> I presume that cp should be cp -p?

"cp --preserve=all" is needed to preserve SELinux context and extended
attributes.

> And I guess it would be better to do a mv
> -f rather than rm + mv, otherwise you're going to have trouble when you hit
> /bin/mv. :-) And of course this needs to run as root.
>
> > Obviously, don't actually run that.
>
> Well, are there any other caveats than the ones I listed above?

- Filenames with newlines will get mangled.

- Hard links will be broken.

- If a file is changed while the script is working on it, it may be
clobbered with the old contents. Similarly, if it is moved, it may
reappear in the old location.

The process should really be run using boot media, not on a live root
filesystem. This avoids the issue of manipulating the /bin/mv being
used.

Here's the approach I would use, starting in the filesystem root:

mkdir TEMP
(GLOBIGNORE=TEMP; mv * TEMP)
rsync -aAXH --remove-source-files TEMP/ .
rm -rf TEMP

--
Matt

--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 
Old 05-01-2010, 08:51 AM
Roberto Ragusa
 
Default Fwd: Btrfs compression

Matt McCutchen wrote:

> - Filenames with newlines will get mangled.
>
> - Hard links will be broken.
>
> - If a file is changed while the script is working on it, it may be
> clobbered with the old contents. Similarly, if it is moved, it may
> reappear in the old location.

- Timestamps on directories will be modified.

> The process should really be run using boot media, not on a live root
> filesystem. This avoids the issue of manipulating the /bin/mv being
> used.
>
> Here's the approach I would use, starting in the filesystem root:
>
> mkdir TEMP
> (GLOBIGNORE=TEMP; mv * TEMP)
> rsync -aAXH --remove-source-files TEMP/ .
> rm -rf TEMP

I agree with this approach.
Better yet, copy everything on another disk, format and copy back again
with compression enabled, so everything is well physically packed in the
first (faster) part of the disk. Or, BTW, is the btrfs defragmenter
good enough to let it do he job later?

P.S.
You just taught me what GLOBIGNORE is for. Thanks.
It is anyway useless. I often do things like:
mkdir OLD; mv * OLD
and it works, with just a "can't move OLD inside itself" warning.

--
Roberto Ragusa mail at robertoragusa.it
--
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel
 

Thread Tools




All times are GMT. The time now is 03:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org