In order to test an analysis tool, I need a file where the depth (eh.eh_depth) is greater than 1.I've tried a couple of things:A large file (1GiB)Creating hundreds of smaller files (1MiB), deleting every other one, and then filling the disk with one file (hoping for massive fragmentation).In both cases I only got a depth of 1!I even tried manually modifying the inodes in a hex editor, but I ended up corrupting the file system.I wondered if it could be done with debugfs, but I can't see how?PS: I have seen the 'increasing depth of extent tree in ext4' question on stackoverflow, but I don't really want to create a 174GiB file.
Can I create a file on ext4 with a depth > 1 for testing purposes?
ext4;inode
If you want a file with a lot of extents, just do:$ perl -we 'for ($i=0;$i<100000;$i++) {seek STDOUT,$i*8192,0; print .}' > a$ ll a-rw-r--r-- 1 stephane stephane 819191809 Dec 15 23:50 a$ filefrag aa: 100000 extents foundThat's a sparse file where every other block is sparse, so it forces the extents to be 4KiB large.debugfs:  dump_extents aLevel Entries         Logical          Physical Length Flags 0/ 2   1/  1      0 - 199998   33413           199999 1/ 2   1/295      0 -    679   33409              680 2/ 2   1/340      0 -      0   34816 -   34816      1 2/ 2   2/340      2 -      2   34818 -   34818      1[...]