Posted Dec 6, 2007 15:10 UTC (Thu) by email@example.com (guest, #38022)
Parent article: SEEK_HOLE or FIEMAP?
> One might argue that anybody who wants to separate holes and data in
> a file can already do so with the FIBMAP ioctl() command.
Such an implementation at:
That can be used to count the level of fragmentation of a filesystem, with some interresting
The main problem is that some filesystems do not implement it correctly or at all (so LILO or
Gujin cannot be installed on them).
The other problem, for the case of a bootloader, is that it does not give the position of the
data in the disk but in the device, and there is a big difference when the device is a RAID or
The thing the bootloader has to do is to register where its own code/data are on disk to be
able to load them without the kernel support, and to have only one file, to write the position
of the end of the file at the beginning of itself, so to have block allocated to disk before
the write into the file is finished - possible but tricky.