Hello, Is there any possibility to remount a compressed btrfs without any compression at all? Syslinux bootloader does not understand any btrfs compression and whenever I edit syslinux.cfg on my compressed / subvolume, the file becomes compressed and thus unreadable by syslinux on the next boot. I tried to remount / without the ''compress'' option (and edit syslinux.cfg in uncompressed state) and while the "mount" command would not show compression any more, I can see in the /proc/mounts that compression is still there and the file still gets compressed after editing. But there seem to be no mount option like compress=none or something. The only workaround I found is to boot from a live CD mount / without any compression and re-save syslinux.cfg. Then it the file gets uncompressed. Are there any other options except for this workaround to temporarily remount btrfs without compression? thanks -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am Montag, 7. November 2011 schrieb dima:> Hello,Hi Dima,> Is there any possibility to remount a compressed btrfs without any > compression at all? > > Syslinux bootloader does not understand any btrfs compression and > whenever I edit syslinux.cfg on my compressed / subvolume, the file > becomes compressed and thus unreadable by syslinux on the next boot. > > I tried to remount / without the ''compress'' option (and edit > syslinux.cfg in uncompressed state) and while the "mount" command would > not show compression any more, I can see in the /proc/mounts that > compression is still there and the file still gets compressed after > editing. But there seem to be no mount option like compress=none or > something. > > The only workaround I found is to boot from a live CD mount / without > any compression and re-save syslinux.cfg. Then it the file gets > uncompressed. > > Are there any other options except for this workaround to temporarily > remount btrfs without compression?What does lsattr show on the file? Have you tried chattr -c on the file? It might help to do a btrfs filesystem defrag on the file to remove compression, cause I don´t think chattr -c itself will uncompress it. As far as I understand it is possible to individually set compression on/off on single files. Although the global thing should work as well IMHO as least when the file is rewritten. Ciao, -- Martin ''Helios'' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/07/2011 09:19 PM, Martin Steigerwald wrote:> Am Montag, 7. November 2011 schrieb dima: >> Hello, > > Hi Dima, > >> Is there any possibility to remount a compressed btrfs without any >> compression at all? >> >> Syslinux bootloader does not understand any btrfs compression and >> whenever I edit syslinux.cfg on my compressed / subvolume, the file >> becomes compressed and thus unreadable by syslinux on the next boot. >> >> I tried to remount / without the ''compress'' option (and edit >> syslinux.cfg in uncompressed state) and while the "mount" command would >> not show compression any more, I can see in the /proc/mounts that >> compression is still there and the file still gets compressed after >> editing. But there seem to be no mount option like compress=none or >> something. >> >> The only workaround I found is to boot from a live CD mount / without >> any compression and re-save syslinux.cfg. Then it the file gets >> uncompressed. >> >> Are there any other options except for this workaround to temporarily >> remount btrfs without compression? > > What does lsattr show on the file? Have you tried chattr -c on the file? It > might help to do a btrfs filesystem defrag on the file to remove > compression, cause I don´t think chattr -c itself will uncompress it.Hi Martin, Thanks for your reply. Yes, I did check out lsattr. It shows that no flags are set. Setting chattr +c then chattr -c and re-saving file has no effect either. I also tried to defragment the file itself and the directory where it was in without setting -c but it would not have any effect because / is mounted with compression.> As far as I understand it is possible to individually set compression > on/off on single files.Could not find how to turn it off though. thanks -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/7/2011 7:55 PM, dima wrote:> On 11/07/2011 09:19 PM, Martin Steigerwald wrote: >> Am Montag, 7. November 2011 schrieb dima: >>> Hello, >> >> Hi Dima, >> >>> Is there any possibility to remount a compressed btrfs without any >>> compression at all? >>> >>> Syslinux bootloader does not understand any btrfs compression and >>> whenever I edit syslinux.cfg on my compressed / subvolume, the file >>> becomes compressed and thus unreadable by syslinux on the next boot. >>> >>> I tried to remount / without the ''compress'' option (and edit >>> syslinux.cfg in uncompressed state) and while the "mount" command would >>> not show compression any more, I can see in the /proc/mounts that >>> compression is still there and the file still gets compressed after >>> editing. But there seem to be no mount option like compress=none or >>> something. >>> >>> The only workaround I found is to boot from a live CD mount / without >>> any compression and re-save syslinux.cfg. Then it the file gets >>> uncompressed. >>> >>> Are there any other options except for this workaround to temporarily >>> remount btrfs without compression? >> >> What does lsattr show on the file? Have you tried chattr -c on the >> file? It >> might help to do a btrfs filesystem defrag on the file to remove >> compression, cause I don´t think chattr -c itself will uncompress it. > > Hi Martin, > Thanks for your reply. > Yes, I did check out lsattr. It shows that no flags are set. Setting > chattr +c then chattr -c and re-saving file has no effect either. > > I also tried to defragment the file itself and the directory where it > was in without setting -c but it would not have any effect because / is > mounted with compression. > >> As far as I understand it is possible to individually set compression >> on/off on single files. > > Could not find how to turn it off though. > > thanks > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.htmlHey Dima, I know if you install a system without the compress flag already done, you can force BTRFS to compress everything post-install by teling it to "rebalance" the filesystem. I''m under Win7 right now so I dont know the exact command. Check btrfs --help for that. I dont know if it works in reverse, but you can definitely try it. Edit your fstab, remove the compress flag, reboot. Tell btrfs to rebalance the system, reboot again. And I -THINK- that''ll decompress all the files -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith <egriffith92@gmail.com> wrote:> Edit your > fstab, remove the compress flag, reboot. Tell btrfs to rebalance the system, > reboot again. And I -THINK- that''ll decompress all the filesI think the original question was how to force uncompressed mode, whether specific to a file or to a whole filesystem, without having to reboot :) AFAIK there''s no way to do that. -- Fajar -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote:> On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith<egriffith92@gmail.com> wrote: >> Edit your >> fstab, remove the compress flag, reboot. Tell btrfs to rebalance the system, >> reboot again. And I -THINK- that''ll decompress all the files > > I think the original question was how to force uncompressed mode, > whether specific to a file or to a whole filesystem, without having to > reboot :) > > AFAIK there''s no way to do that. >Whoops! Misunderstood the question haha. Yeah, as far as decompressing just a single file; from what I''ve read, thats impossible. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/08/2011 10:54 AM, Eric Griffith wrote:> On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote: >> On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith<egriffith92@gmail.com> >> wrote: >>> Edit your >>> fstab, remove the compress flag, reboot. Tell btrfs to rebalance the >>> system, >>> reboot again. And I -THINK- that''ll decompress all the files >> >> I think the original question was how to force uncompressed mode, >> whether specific to a file or to a whole filesystem, without having to >> reboot :) >> >> AFAIK there''s no way to do that. >> > > Whoops! Misunderstood the question haha. Yeah, as far as decompressing > just a single file; from what I''ve read, thats impossible.Eric, Fajar, Thanks. Understood. Yes, it is possible to remove the compress flag from fstab, reboot and even do not do any defragmentation/rebalancing - just re-save the file and it will be saved uncompressed. This works. But only with reboot... -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Nov 08, 2011 at 11:00:42AM +0900, dima wrote:> On 11/08/2011 10:54 AM, Eric Griffith wrote: > >On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote: > >>On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith<egriffith92@gmail.com> > >>wrote: > >>>Edit your > >>>fstab, remove the compress flag, reboot. Tell btrfs to rebalance the > >>>system, > >>>reboot again. And I -THINK- that''ll decompress all the files > >> > >>I think the original question was how to force uncompressed mode, > >>whether specific to a file or to a whole filesystem, without having to > >>reboot :) > >> > >>AFAIK there''s no way to do that. > >> > > > >Whoops! Misunderstood the question haha. Yeah, as far as decompressing > >just a single file; from what I''ve read, thats impossible. > > > Eric, Fajar, > Thanks. Understood. > > Yes, it is possible to remove the compress flag from fstab, reboot > and even do not do any defragmentation/rebalancing - just re-save > the file and it will be saved uncompressed. This works. But only > with reboot...chattr -c on the file should work (followed by defrag or rewriting the file). I just retested and it seems to be broken right now. I''ll track it down. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Nov 08, 2011 at 10:01:51AM -0500, Chris Mason wrote:> On Tue, Nov 08, 2011 at 11:00:42AM +0900, dima wrote: > > On 11/08/2011 10:54 AM, Eric Griffith wrote: > > >On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote: > > >>On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith<egriffith92@gmail.com> > > >>wrote: > > >>>Edit your > > >>>fstab, remove the compress flag, reboot. Tell btrfs to rebalance the > > >>>system, > > >>>reboot again. And I -THINK- that''ll decompress all the files > > >> > > >>I think the original question was how to force uncompressed mode, > > >>whether specific to a file or to a whole filesystem, without having to > > >>reboot :) > > >> > > >>AFAIK there''s no way to do that. > > >> > > > > > >Whoops! Misunderstood the question haha. Yeah, as far as decompressing > > >just a single file; from what I''ve read, thats impossible. > > > > > > Eric, Fajar, > > Thanks. Understood. > > > > Yes, it is possible to remove the compress flag from fstab, reboot > > and even do not do any defragmentation/rebalancing - just re-save > > the file and it will be saved uncompressed. This works. But only > > with reboot... > > chattr -c on the file should work (followed by defrag or rewriting the > file). I just retested and it seems to be broken right now. > > I''ll track it down.Ok, I had forgotten. chattr -c clears the compression flag bug doesn''t set the no compress flag. We looks like we need to patch chattr for this. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/09/2011 12:12 AM, Chris Mason wrote:> On Tue, Nov 08, 2011 at 10:01:51AM -0500, Chris Mason wrote: >> On Tue, Nov 08, 2011 at 11:00:42AM +0900, dima wrote: >>> On 11/08/2011 10:54 AM, Eric Griffith wrote: >>>> On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote: >>>>> On Tue, Nov 8, 2011 at 8:06 AM, Eric Griffith<egriffith92@gmail.com> >>>>> wrote: >>>>>> Edit your >>>>>> fstab, remove the compress flag, reboot. Tell btrfs to rebalance the >>>>>> system, >>>>>> reboot again. And I -THINK- that''ll decompress all the files >>>>> >>>>> I think the original question was how to force uncompressed mode, >>>>> whether specific to a file or to a whole filesystem, without having to >>>>> reboot :) >>>>> >>>>> AFAIK there''s no way to do that. >>>>> >>>> >>>> Whoops! Misunderstood the question haha. Yeah, as far as decompressing >>>> just a single file; from what I''ve read, thats impossible. >>> >>> >>> Eric, Fajar, >>> Thanks. Understood. >>> >>> Yes, it is possible to remove the compress flag from fstab, reboot >>> and even do not do any defragmentation/rebalancing - just re-save >>> the file and it will be saved uncompressed. This works. But only >>> with reboot... >> >> chattr -c on the file should work (followed by defrag or rewriting the >> file). I just retested and it seems to be broken right now. >> >> I''ll track it down. > > Ok, I had forgotten. chattr -c clears the compression flag bug doesn''t > set the no compress flag. We looks like we need to patch chattr for > this. > > -chris >Just for the record - I could find a solution thanks to the btrfs wiki being online again. In Gotchas it says mount -o nodatacow also disables compression and indeed it does. Remounting with this option and re-saving the file makes it uncompressed. However, I could not find how to remount the filesystem afterwards without nodatacow. ~dima -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
dima, Wed, 09 Nov 2011 10:01:13 +0900:> On 11/09/2011 12:12 AM, Chris Mason wrote: >> On Tue, Nov 08, 2011 at 10:01:51AM -0500, Chris Mason wrote: >>> On Tue, Nov 08, 2011 at 11:00:42AM +0900, dima wrote: >>>> On 11/08/2011 10:54 AM, Eric Griffith wrote: >>>>> On 11/7/2011 8:52 PM, Fajar A. Nugraha wrote: >>>>>> On Tue, Nov 8, 2011 at 8:06 AM, Eric >>>>>> Griffith<egriffith92@gmail.com> wrote: >>>>>>> Edit your fstab, remove the compress flag, reboot. Tell btrfs to >>>>>>> rebalance the system, >>>>>>> reboot again. And I -THINK- that''ll decompress all the files >>>>>> >>>>>> I think the original question was how to force uncompressed mode, >>>>>> whether specific to a file or to a whole filesystem, without having >>>>>> to reboot :) >>>>>> >>>>>> AFAIK there''s no way to do that. >>>>>> >>>>>> >>>>> Whoops! Misunderstood the question haha. Yeah, as far as >>>>> decompressing just a single file; from what I''ve read, thats >>>>> impossible. >>>> >>>> >>>> Eric, Fajar, >>>> Thanks. Understood. >>>> >>>> Yes, it is possible to remove the compress flag from fstab, reboot >>>> and even do not do any defragmentation/rebalancing - just re-save the >>>> file and it will be saved uncompressed. This works. But only with >>>> reboot... >>> >>> chattr -c on the file should work (followed by defrag or rewriting the >>> file). I just retested and it seems to be broken right now. >>> >>> I''ll track it down. >> >> Ok, I had forgotten. chattr -c clears the compression flag bug doesn''t >> set the no compress flag. We looks like we need to patch chattr for >> this. >> >> -chris >> >> > > Just for the record - I could find a solution thanks to the btrfs wiki > being online again. In Gotchas it says > > mount -o nodatacow also disables compression > > and indeed it does. Remounting with this option and re-saving the file > makes it uncompressed. However, I could not find how to remount the > filesystem afterwards without nodatacow. > > ~dimaSorry for possibly OT question - when I have historical btrfs system mounted with zlib compression, can I remount it with lzo ? What will happen? Will the COW be broken and the files taking duplicate space? Or will the Universe explode and be replaced with something even more bizzare? Thank you Lubos -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/09/2011 04:48 PM, Lubos Kolouch wrote:> Sorry for possibly OT question - when I have historical btrfs system > mounted with zlib compression, > > can I remount it with lzo ? What will happen? Will the COW be broken > and the files taking duplicate space? Or will the Universe explode and > be replaced with something even more bizzare?Hello Lubos If you have a kernel that supports lzo (don''t quite remember when it got in), why can''t you? Absolutely nothing will happen, and only the new/updated files will be with lzo compression. You can remount on the fly switching b/w the two compression options without any problems. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 9, 2011 at 2:48 PM, Lubos Kolouch <lubos.kolouch@gmail.com> wrote:> Sorry for possibly OT question - when I have historical btrfs system > mounted with zlib compression, > > can I remount it with lzo ?yes> What will happen? Will the COW be broken > and the files taking duplicate space? Or will the Universe explode and > be replaced with something even more bizzare?New written block/extents will use lzo compression (if it''s compressible, or if it''s mounted with compress-force). Old, unmodified block/extents will remain unchanged, using zlib or uncompressed. -- Fajar -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 09, 2011 at 03:04:01PM +0700, Fajar A. Nugraha wrote:> On Wed, Nov 9, 2011 at 2:48 PM, Lubos Kolouch <lubos.kolouch@gmail.com> wrote: > > Sorry for possibly OT question - when I have historical btrfs system > > mounted with zlib compression, > > > > can I remount it with lzo ? > > yes > > > What will happen? Will the COW be broken > > and the files taking duplicate space? Or will the Universe explode and > > be replaced with something even more bizzare? > > New written block/extents will use lzo compression (if it''s > compressible, or if it''s mounted with compress-force). Old, unmodified > block/extents will remain unchanged, using zlib or uncompressed.This is correct, your old stuff will be zlib and your new stuff lzo. The compression type is recorded on a per-extent basis and the global switch just decides what type of compression to use for new writes. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 09, 2011 at 10:01:13AM +0900, dima wrote:> Just for the record - I could find a solution thanks to the btrfs wiki > being online again. In Gotchas it says > > mount -o nodatacow also disables compression > > and indeed it does. Remounting with this option and re-saving the file > makes it uncompressed. However, I could not find how to remount the > filesystem afterwards without nodatacow.I saw this mentioned on irc today (that nodatacow diasables compression). There is a way how to turn off compression on a file -- with help of the NOCOW _file_ attribute, ie. you don''t have to remount. * create the file, compression enabled * set NOCOW (with the attached single-purpose nocow.c utility) * btrfs fi defrag the_file Make sure you have enough free space for the uncompressed file size. You can compare the extent layout before and after the defrag with "filefrag -v" . I did a test first, here''s what I saw with a ~60M file (filled with zeros, suitable for compression): # filefrag -v zerofile2 Filesystem type is: 9123683e File size of zerofile2 is 69927424 (17073 blocks, blocksize 4096) ext logical physical expected length flags 0 0 2700 32 1 32 2942 2731 32 2 64 2943 2973 32 3 96 2944 2974 32 4 128 2945 2975 32 ... 533 17039 2641 2671 32 534 17071 2643 2672 2 eof zerofile2: 535 extents found # btrfs fi defrag zerofile2 # filefrag -v zerofile2 Filesystem type is: 9123683e File size of zerofile2 is 69927424 (17073 blocks, blocksize 4096) ext logical physical expected length flags 0 0 20992 2107 1 2107 23552 23098 1581 2 3688 16400 25132 1185 3 4873 12410 17584 889 4 5762 14762 13298 667 5 6429 15881 15428 500 6 6929 17585 16380 751 7 7680 23099 18335 375 8 8055 25133 23473 376 9 8431 3072 25508 2160 10 10591 5632 5231 1620 11 12211 8192 7251 2431 12 14642 18432 10622 2431 eof zerofile2: 13 extents found david
On 11/10/2011 09:11 AM, David Sterba wrote:> On Wed, Nov 09, 2011 at 10:01:13AM +0900, dima wrote: >> Just for the record - I could find a solution thanks to the btrfs wiki >> being online again. In Gotchas it says >> >> mount -o nodatacow also disables compression >> >> and indeed it does. Remounting with this option and re-saving the file >> makes it uncompressed. However, I could not find how to remount the >> filesystem afterwards without nodatacow. > > I saw this mentioned on irc today (that nodatacow diasables > compression). There is a way how to turn off compression on a file -- > with help of the NOCOW _file_ attribute, ie. you don''t have to remount. > > * create the file, compression enabled > * set NOCOW (with the attached single-purpose nocow.c utility) > * btrfs fi defrag the_file > > Make sure you have enough free space for the uncompressed file size. You > can compare the extent layout before and after the defrag with > "filefrag -v" .Hello David, Thank you, I will try it out tonight. Is there any way to see if nocow attribute was set on a particular file, and is there any way to unset it? thanks ~dima -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Dmitry Olenin, Wed, 09 Nov 2011 17:03:39 +0900:> On 11/09/2011 04:48 PM, Lubos Kolouch wrote: >> Sorry for possibly OT question - when I have historical btrfs system >> mounted with zlib compression, >> >> can I remount it with lzo ? What will happen? Will the COW be broken >> and the files taking duplicate space? Or will the Universe explode and >> be replaced with something even more bizzare? > > Hello Lubos If you have a kernel that supports lzo (don''t quite remember > when it got in), why can''t you? > Absolutely nothing will happen, and only the new/updated files will be > with lzo compression. You can remount on the fly switching b/w the two > compression options without any problems.Hello Dmitry, By the way, this is interesting question to me - I mounted the filesystem with -o compress=lzo, in dmesg showed btrfs: use lzo compression, but - the lzo module was not loaded (not shown in lsmod - and yes, I have it as a module). When I do modprobe lzo, it shows there. Isn''t it a bit strange? So btrfs is using lzo module that was not loaded? (and says so in the dmesg output)? Thank you Lubos -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/10/2011 03:57 PM, Lubos Kolouch wrote:> Dmitry Olenin, Wed, 09 Nov 2011 17:03:39 +0900: > >> On 11/09/2011 04:48 PM, Lubos Kolouch wrote: >>> Sorry for possibly OT question - when I have historical btrfs system >>> mounted with zlib compression, >>> >>> can I remount it with lzo ? What will happen? Will the COW be broken >>> and the files taking duplicate space? Or will the Universe explode and >>> be replaced with something even more bizzare? >> >> Hello Lubos If you have a kernel that supports lzo (don''t quite remember >> when it got in), why can''t you? >> Absolutely nothing will happen, and only the new/updated files will be >> with lzo compression. You can remount on the fly switching b/w the two >> compression options without any problems. > > Hello Dmitry, > > By the way, this is interesting question to me - I mounted the filesystem > with -o compress=lzo, in dmesg showed btrfs: use lzo compression, > > but - the lzo module was not loaded (not shown in lsmod - and yes, I have > it as a module). > > When I do modprobe lzo, it shows there. > > Isn''t it a bit strange? So btrfs is using lzo module that was not loaded? > (and says so in the dmesg output)?Hello Lubos Yes, I was wondering about this too when I started doing lzo. The lzo module you load most likely has nothing to do with btrfs. This is the only explanation. I would think that lzo for btrfs is built into kernel. Unfortunately I don''t have my .config with me at the moment to check it. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 11/10/2011 11:23 AM, dima wrote:> On 11/10/2011 09:11 AM, David Sterba wrote: >> On Wed, Nov 09, 2011 at 10:01:13AM +0900, dima wrote: >>> Just for the record - I could find a solution thanks to the btrfs wiki >>> being online again. In Gotchas it says >>> >>> mount -o nodatacow also disables compression >>> >>> and indeed it does. Remounting with this option and re-saving the file >>> makes it uncompressed. However, I could not find how to remount the >>> filesystem afterwards without nodatacow. >> >> I saw this mentioned on irc today (that nodatacow diasables >> compression). There is a way how to turn off compression on a file -- >> with help of the NOCOW _file_ attribute, ie. you don''t have to remount. >> >> * create the file, compression enabled >> * set NOCOW (with the attached single-purpose nocow.c utility) >> * btrfs fi defrag the_file >> >> Make sure you have enough free space for the uncompressed file size. You >> can compare the extent layout before and after the defrag with >> "filefrag -v" . > > > Hello David, > > Thank you, I will try it out tonight. Is there any way to see if nocow > attribute was set on a particular file, and is there any way to unset it?Hi David I tried the nocow utility. It worked. First I made sure to re-save the syslinux.cfg file while btrfs was mounted with lzo to ensure that it is compressed, then I set the NOCOW flag with your utility. Then I checked fragmentation of the file and since it was a small one it was not fragmented. So when I ran btrfs fi defrag syslinux.cfg it did not have any effect and file was not uncompressed. Then I simply re-saved the file and it got uncompressed fine since bootloader could read it on reboot. thanks -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html