Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • You might want to read ext4.wiki.kernel.org/index.php/Main_Page Commented Feb 13, 2017 at 12:46
  • 1
    Perhaps, if I understand your intention correctly, you would be more interested in lower-level API, where you work with storage devices w/o having to go through the file-system layer. Your entry-point then could be the dmsetup program, an interface to device mapper. This may be a good choice if you are planning a database-like storage. Commented Feb 13, 2017 at 16:48
  • 4
    This is an implementation detail of the filesystem. Almost all filesystems do fragment files by default; only iso9660 and romfs are incapable of doing that and require continuous storage (of these I can list off-head). Commented Feb 13, 2017 at 17:44
  • 2
    whether the file is contiguous on disk or not, data read/write will always be contiguous unless you do a seek to another part of the file. So why do you care about this? Unless fragmentation is a serious problem that affects performance Commented Feb 14, 2017 at 8:41
  • 3
    @hudac one thing to keep in mind is that contiguous is not all that useful in practice. The easy one is flash where fragmentation is not a big deal, but on a spinning platter you still might not benefit from contiguous data. On a spinning platter you need to think about your access patterns and where the data is. If you need the sector that just passed under the head you have to wait for it to come fully around again. To get the best results you want to stagger the data so that it is "close" when it needs to be read. Increasing cache size is easier ;-) Commented Feb 14, 2017 at 17:30