I am just wondering, does that defragment trick work for non-root users? Also, even if it did work, I could as well make my tools use this defragment trick instead, because I will probably never remember that hacky syntax of defrag command :P doing something like compress -r <folder> or decompress -r <folder> is just much more easy to remember than multiple commands. That thing I made is just a wrapper for other commands anyway On Sat, Mar 21, 2015 at 7:12 PM, Petr Bena <benapetr@xxxxxxxxx> wrote: > I would be certainly useful if this kind of tricks were mentioned on > https://btrfs.wiki.kernel.org/index.php/Compression or anywhere on > wiki > > On Sat, Mar 21, 2015 at 7:08 PM, Hugo Mills <hugo@xxxxxxxxxxxxx> wrote: >> On Sat, Mar 21, 2015 at 06:56:12PM +0100, Petr Bena wrote: >>> Hi, I like the compress feature, but unlike NTFS, compressing files in >>> btrfs is not so simple. Just changing the flags using chattr will not >>> compress anything, only newly written data would be. >>> >>> For this reason I decided to create a new tool that makes this simple, >>> you can find it here: https://github.com/benapetr/compress >>> >>> It's very simple to use, for example to compress whole folder, you would do >>> >>> compress -rv <folder_name> >>> >>> the tool would recursively scan the folder, change all folders to +c >>> and copy all files, preserving attributes to a temporary file within >>> folder, then removes the original and move the copied, now fully >>> compressed file back. >> >> What does it do that this doesn't? >> >> $ chattr -R +c $dir >> $ btrfs fi defrag -r -c $dir >> >> (Sorry to do this to you, but better early in the life of the >> project than later). >> >> Hugo. >> >>> It's written in python despite I loathe it (I am a C++ programmer), >>> because most of people love it for some reason, any because this would >>> make it more simple for people to deploy it and modify it. >>> >>> The tool right now is in early alpha stage, probably full of bugs, I >>> made it few hours ago, but I would like to hear any feedback, whether >>> there would be any use for such a tool, feature requests etc :) >> >> -- >> Hugo Mills | You shouldn't anthropomorphise computers. They >> hugo@... carfax.org.uk | really don't like that. >> http://carfax.org.uk/ | >> PGP: 65E74AC0 | -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
