While on Ubuntu 10.10 I cannot get defragment working. inglor@selene:~$ btrfs filesystem defragment /media/Data/ ioctl failed on /media/Data/ ret -1 errno 1 total 1 failures inglor@selene:~$ uname -a Linux selene 2.6.35-23-generic #36-Ubuntu SMP Tue Oct 26 17:03:18 UTC 2010 i686 GNU/Linux inglor@selene:~$ sudo btrfs filesystem show [sudo] password for inglor: failed to read /dev/sr0 Label: ''Data'' uuid: 3946b7c3-44c8-430e-b737-0c0c965e16c4 Total devices 1 FS bytes used 12.32GB devid 1 size 29.08GB used 28.75GB path /dev/sda7 Btrfs v0.19-35-g1b444cd Is it implemented on kernel 2.6.36 and above only? -- Caution: breathing may be hazardous to your health. -- 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 Mon, Nov 8, 2010 at 5:33 PM, Leonidas Spyropoulos <artafinde@gmail.com> wrote:> While on Ubuntu 10.10 I cannot get defragment working. > > inglor@selene:~$ btrfs filesystem defragment /media/Data/ > ioctl failed on /media/Data/ ret -1 errno 1 > total 1 failures > ... > Is it implemented on kernel 2.6.36 and above only?You need to run it as root (via sudo or whatever). On the other hand, it probably doesn''t work like you think it does, and you probably don''t want to defrag anyway :p btrfs fi defrag takes a file or folder, and defrags just that file or folder (i.e., no recursion). If you wanted to defrag an entire tree, you''d have to do something like "find /whatever | xargs -I{} btrfs fi defrag {}" or some such. This would have the effect of unlinking any cow''d files, which isn''t necessarily useful. --Carey -- 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
> You need to run it as root (via sudo or whatever). On the other hand, > it probably doesn''t work like you think it does, and you probably > don''t want to defrag anyway :p > > btrfs fi defrag takes a file or folder, and defrags just that file or > folder (i.e., no recursion).Quick question about defrag: is it safe to use it on an open file? Thanks, Will :-} -- 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