Numerous resource allocating and releasing will cause fragmentation which will seriously affect the I/O performance of file systems. One method to solve this problem is file defragmentation. This paper focuses on fragmentation detection, the key part of the file defragmentation. We estimate file fragmentation situation through file’s layout, and then analyze the detailed effects of the situation on performance measurement. Then we quantize this by the file’s “fragmentation degree” through theoretical and experimental analyses. Finally we use it to estimate the file’s fragmentation and decide whether the file needs to be defragmented.