enquiry about defrag
Hi all,
i am new on btrfs, i am testing KVM on btrfs (host: kernel x86-64 3.5.3), the performance is reasonable.
I have two question on defrag, can someone help me?
1. According to btrfs wiki, defragment a COW file will produce two unrelated files.
Does it apply to the "autodefrag" mount option?
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Use the "filefrag" command, part of e2fsprogs.
Quoted 4 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Quoted 7 lines · ching
Quoted 4 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Is compression enabled? If so, yes, it's normal.
Signature · 1 line
Fajar
Quoted 9 lines · Fajar A. Nugraha
Quoted 6 lines · ching
Quoted 4 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Is compression enabled? If so, yes, it's normal.
compression with lzo.
thanks. i will retry with compression disabled when 3.6 is stable.
Hi,
You need to compile the latest version of filefrag, it has some fixes by Liu Bo wrt to that. However, even then, filefrag may not report the correct the extent count for btrfs. According to filefrag_fiemap(), it tries to check whether physical extents are consecutive on disk and then considers them as a single extent. For btrfs this may not always be true, because logically the extents might not be consecutive, even though they are consecutive on disk. xfstest 281 fails for me because of this. (filefrag -v, however, seems to show BTRFS extents correctly).
For me the best way is to check the output of btrfs-debug-tree.
Alex.
Quoted 8 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Use the "filefrag" command, part of e2fsprogs.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · ching
Quoted 4 lines · Fajar A. Nugraha
Quoted 3 lines · ching
Quoted 2 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Is compression enabled? If so, yes, it's normal.
compression with lzo.
thanks. i will retry with compression disabled when 3.6 is stable.
i just realize that it is possible to control compression per file by file attribute
http://radudi.com/index.php/2011/08/31/using-btrfs-per-file-and-per-directory-compression/
when i try to follow example above, no file attribute is shown (my mount option is rw,noatime,compress-force=lzo,space_cache,inode_cache)
$lsattr -V Linux.raw_image
lsattr 1.42.5 (29-Jul-2012)
---------------- Linux.raw_image
is there any official resource/web page for control compression per file by file attribute?
Quoted 19 lines · ching
Quoted 5 lines · ching
Quoted 4 lines · Fajar A. Nugraha
Quoted 3 lines · ching
Quoted 2 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Is compression enabled? If so, yes, it's normal.
compression with lzo.
thanks. i will retry with compression disabled when 3.6 is stable.
i just realize that it is possible to control compression per file by file attribute
http://radudi.com/index.php/2011/08/31/using-btrfs-per-file-and-per-directory-compression/
Quoted 8 lines
when i try to follow example above, no file attribute is shown (my mount option is rw,noatime,compress-force=lzo,space_cache,inode_cache)
$lsattr -V Linux.raw_image
lsattr 1.42.5 (29-Jul-2012)
---------------- Linux.raw_imageis there any official resource/web page for control compression per file by file attribute?
FYI, git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 21 lines · Liu Bo
Quoted 20 lines · ching
Quoted 5 lines · ching
Quoted 4 lines · Fajar A. Nugraha
Quoted 3 lines · ching
Quoted 2 lines · Jan Steffens
Quoted 1 line · ching
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 2 lines
Use the "filefrag" command, part of e2fsprogs.
my image is a 16G sparse file, after defragment, it still has 101387 extents, is it normal?
Is compression enabled? If so, yes, it's normal.
compression with lzo.
thanks. i will retry with compression disabled when 3.6 is stable.
i just realize that it is possible to control compression per file by file attribute
http://radudi.com/index.php/2011/08/31/using-btrfs-per-file-and-per-directory-compression/
when i try to follow example above, no file attribute is shown (my mount option is rw,noatime,compress-force=lzo,space_cache,inode_cache)
Quoted 14 lines
Quoted 6 lines
$lsattr -V Linux.raw_image
lsattr 1.42.5 (29-Jul-2012)
---------------- Linux.raw_imageis there any official resource/web page for control compression per file by file attribute?
FYI,
git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.gitQuoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
may i ask a stupid question, if i remove my "compress-force=lzo" option, will compression disabled for new written data?
Quoted 1 line
may i ask a stupid question, if i remove my "compress-force=lzo" option, will compression disabled for new written data?
the answer is yes. :)
Quoted 4 lines · Li Zefan
Quoted 1 line
may i ask a stupid question, if i remove my "compress-force=lzo" option, will compression disabled for new written data?
the answer is yes. :)
The problem seems fixed. The number of extent decrease to 14055 after defrag with compression off.
Quoted 11 lines · ching
Hi all,
i am new on btrfs, i am testing KVM on btrfs (host: kernel x86-64 3.5.3), the performance is reasonable.
I have two question on defrag, can someone help me?
1. According to btrfs wiki, defragment a COW file will produce two unrelated files.
Does it apply to the "autodefrag" mount option?
2. Is there any command for the fragmentation status of a file/dir ? e.g. fragment size, number of fragments.
can anybody helps on question 1?
Quoted 5 lines · ching
Quoted 3 lines
1. According to btrfs wiki, defragment a COW file will produce two unrelated files.
Does it apply to the "autodefrag" mount option?
can anybody helps on question 1?
The data blocks associated with the files (that were originally created by snapshotting and thus shared the same blocks) will become unshared, so yes it would appear like two unlreated files.
Autodefrag option affects only newly written data. With current implementation it could unshare some extents if the defragged range picked by autodefrag logic overlaps with an existing one.
Quoted 1 line
From my experience, running 'btrfs fi defrag' with autodefrag on
produced better result. Beware that there are some unfixed deadlocks that may happen with autodefrag enabled.
david
Quoted 13 lines · David Sterba
Quoted 4 lines · ching
Quoted 3 lines
1. According to btrfs wiki, defragment a COW file will produce two unrelated files.
Does it apply to the "autodefrag" mount option?
can anybody helps on question 1?
The data blocks associated with the files (that were originally created by snapshotting and thus shared the same blocks) will become unshared, so yes it would appear like two unlreated files.
Autodefrag option affects only newly written data. With current implementation it could unshare some extents if the defragged range picked by autodefrag logic overlaps with an existing one.
Quoted 6 lines
Quoted 1 line
From my experience, running 'btrfs fi defrag' with autodefrag on
produced better result. Beware that there are some unfixed deadlocks that may happen with autodefrag enabled.
david
thanks for your help very much :)