how to create file without using extent allocation
Hello, Can we create file on ext4 file system which dose not uses extent allocation? -- Regards, Akshay Nehe.
On Thu, Mar 22, 2012 at 3:31 PM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Hello,
Can we create file on ext4 file system which dose not uses extent allocation?
Man page of mkfs.ext4 suggests using "-O ^feature" to disable an ext4 feature. This seems to work: $ dd if=/dev/zero of=test1 bs=4M count=20 [...] $ mkfs.ext4 -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=408f6da2-c4ef-4335-9574-985f3a349ed2 (extents) (huge files) $ mkfs -O ^extent -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=23c046d6-db7a-419d-a1d5-0cba3c5b52d0 (huge files) Hope this helps, Vlad
Thanks for help, i find it useful. On 3/22/12, Vlad Dogaru <ddvlad@rosedu.org> wrote:
On Thu, Mar 22, 2012 at 3:31 PM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Hello,
Can we create file on ext4 file system which dose not uses extent allocation?
Man page of mkfs.ext4 suggests using "-O ^feature" to disable an ext4 feature. This seems to work:
$ dd if=/dev/zero of=test1 bs=4M count=20 [...] $ mkfs.ext4 -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=408f6da2-c4ef-4335-9574-985f3a349ed2 (extents) (huge files)
$ mkfs -O ^extent -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=23c046d6-db7a-419d-a1d5-0cba3c5b52d0 (huge files)
Hope this helps, Vlad
-- Regards, Akshay Nehe.
On 3/22/12, Vlad Dogaru <ddvlad@rosedu.org> wrote:
On Thu, Mar 22, 2012 at 3:31 PM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Hello,
Can we create file on ext4 file system which dose not uses extent allocation?
Man page of mkfs.ext4 suggests using "-O ^feature" to disable an ext4 feature. This seems to work:
$ dd if=/dev/zero of=test1 bs=4M count=20 [...] $ mkfs.ext4 -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=408f6da2-c4ef-4335-9574-985f3a349ed2 (extents) (huge files)
$ mkfs -O ^extent -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=23c046d6-db7a-419d-a1d5-0cba3c5b52d0 (huge files)
Hope this helps, Vlad
On Thu, Mar 22, 2012 at 9:59 AM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Thanks for help, i find it useful.
-- Regards, Akshay Nehe.
Akshay, 1) If you are going to participate in kernel mailinglists, you need to be aware the appropriate netiquette is to bottom post all responses. I have moved your reply to the bottom to make this flow better. 2) I assume you see it is a mkfs option that controls this. So you can't control it on a file by file basis as far as I know. I don't think you can even control it by re-mounting. Instead you have to reformat, so it is a fundamental change. Greg
On 3/22/12, Greg Freemyer <greg.freemyer@gmail.com> wrote:
On 3/22/12, Vlad Dogaru <ddvlad@rosedu.org> wrote:
On Thu, Mar 22, 2012 at 3:31 PM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Hello,
Can we create file on ext4 file system which dose not uses extent allocation?
Man page of mkfs.ext4 suggests using "-O ^feature" to disable an ext4 feature. This seems to work:
$ dd if=/dev/zero of=test1 bs=4M count=20 [...] $ mkfs.ext4 -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=408f6da2-c4ef-4335-9574-985f3a349ed2 (extents) (huge files)
$ mkfs -O ^extent -F test1 [...] $ file test1 test1: Linux rev 1.0 ext4 filesystem data, UUID=23c046d6-db7a-419d-a1d5-0cba3c5b52d0 (huge files)
Hope this helps, Vlad
On Thu, Mar 22, 2012 at 9:59 AM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
Thanks for help, i find it useful.
-- Regards, Akshay Nehe.
Akshay,
1) If you are going to participate in kernel mailinglists, you need to be aware the appropriate netiquette is to bottom post all responses. I have moved your reply to the bottom to make this flow better.
Okay I got it, I will follow right method from now onwards.
2) I assume you see it is a mkfs option that controls this. So you can't control it on a file by file basis as far as I know. I don't think you can even control it by re-mounting. Instead you have to reformat, so it is a fundamental change.
Actually I want to create files which uses indirect block mapping on ext4 file-system. I have mounted loop device with ext4 file-system, can I create files on it using indirect block mapping?
Greg
-- Regards, Akshay Nehe.
On Thu, Mar 22, 2012 at 11:10 AM, Akshay Nehe <akshaynehe785@gmail.com> wrote:
On 3/22/12, Greg Freemyer <greg.freemyer@gmail.com> wrote: <snip>
2) I assume you see it is a mkfs option that controls this. So you can't control it on a file by file basis as far as I know. I don't think you can even control it by re-mounting. Instead you have to reformat, so it is a fundamental change.
Actually I want to create files which uses indirect block mapping on ext4 file-system. I have mounted loop device with ext4 file-system, can I create files on it using indirect block mapping?
What is a "ext4 file-system"? If you mean a file-system the ext4 kernel code can read and write, then yes, the ext4 kernel code is backward compatible to either a ext2 or ext3 feature set file-system, including filesystems created years ago as ext2 or ext3. Via mkfs you can either get a group of features via "-t ext3" or control individual features via -O. So as stated in Vlad's reply you can reformat your loopback file via: mkfs -O ^extent -F test1 or possibly more clearly: mkfs -t ext3 -F test1 where test1 is the name of your loopback file. Note ^ mean not in the syntax. I believe both of the above will create a legacy ext3 style filesystem that both the ext3 and ext4 kernel module can read. The key thing is mkfs -t ext3 merely sets a default set of options. You can override them something like: mkfs -t ext3 -O extents,dir_index,flex_bg -F test1 Test1 will be a "ext3" filesystem that only the ext4 kernel module can read/write. See the mkfs man page and the -t and -O args in particular. fyi: As you see, the fs type of a partition is less important than the discreet feature flags. Basically I don't know how mkfs currently sets the fs_type field, but I do know the feature flags are what you need to pay extra attention to. Greg
participants (3)
-
Akshay Nehe -
Greg Freemyer -
Vlad Dogaru