For an I/O operation to be performed as direct I/O, it must meet certain alignment criteria. The alignment constraints are usually determined by the disk driver, the disk controller, and the system memory management hardware and software.
The requirements for direct I/O are as follows:
The starting file offset must be aligned to a 512-byte boundary.
The ending file offset must be aligned to a 512-byte boundary, or the length must be a multiple of 512 bytes.
The memory buffer must start on an 8-byte boundary.