Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see fragmentation of a specific file?

Is there a tool that would show me for a specific file on disk, how fragmented it is? (How many seeks does physical disk need to make if I were to read that file in a linear fashion)

like image 666
Ghostrider Avatar asked May 13 '10 23:05

Ghostrider


People also ask

How do I view a fragmented file?

You can see if files are fragmented by using the file system browser in OSForensics. In the file system browser choose "Add device to case" from the File menu and select the drive letter or image file you wish to view. You can then navigate to the folder/files you wish to check for fragmentation.

How do I know if a disk is fragmented?

. In the search box, type Disk Defragmenter, and then, in the list of results, click Disk Defragmenter. Under Current status, select the disk you want to defragment. To determine if the disk needs to be defragmented or not, click Analyze disk.

How does a file get fragmented?

Fragmentation is caused when information is deleted from a hard drive and small gaps are left behind to be filled by new data. As new data is saved to the computer, it is placed in these gaps. If the gaps are too small, the remainder of what needs to be saved is stored in other available gaps.

Can fragmented files be recovered?

Recovering Fragmented Files Information about which exact sectors on the disk are occupied by a certain file is stored in the file system, FAT or NTFS. If a record about the file is still available in the file system, the file can be undeleted no matter whether it's fragmented or not.


2 Answers

filefrag is the tool you're looking for, if you're using Linux. Use -v parameter with filename to get detailed list of fragmentation. http://linux.die.net/man/8/filefrag

like image 52
Sami Lehtinen Avatar answered Sep 20 '22 01:09

Sami Lehtinen


fsutil file queryallocranges offset=<o> length=<l> <file> will show you the file's extents you will need admin rights.

like image 22
Dominik Weber Avatar answered Sep 20 '22 01:09

Dominik Weber