Menu

WWFileFragmentCount2

yamamoto2002
Attachments
Fragmentation4.png (221945 bytes)

WWFileFragmentCount2 program inspects data fragment status of specified file on NTFS formatted volume.

This program opens specified file with read-only access rights and report its fragmentation status. It does not write, does not fix file fragmentation.

Download

Version 1.0.1 for Windows https://sourceforge.net/projects/playpcmwin/files/others/WWFileFragmentCount2_101.zip/download

License

MIT License

How to install

Unzip downloaded file.

How to run the program

Run WWFileFragmentationCount2.exe

Specify the file by pressing browse button (or ALT+B) or drop the file from explorer to the file name textbox.

Press Start button (or ALT+S) to inspect the file.

How to uninstall

Just delete downloaded zip file and extracted directory.

Changelog

  • Version 1.0.1 : Fix typo.

  • Version 1.0.0 : initial release.

Screenshot

Screenshot

Source code

What is "sector", "cluster", "partition", "volume", "fragmented", "logical drive", "NTFS" and "master file table" ?

Please read these documents:

VCN means Virtual Cluster Number. That is sequential cluster number of the file content starts from zero. VCN 0 means the first cluster of the file content and VCN 1 means the second cluster of the file content.

LCN is Logical Cluster Number. Sequential number from the volume start to the end. The first sector of the disk drive exists on LCN 0.

This program shows VCN to LCN mapping table of the specified file.

About sector size and drive managed hidden field of HDDs

Traditional HDD sector size is 512 bytes. Some of recent HDD has 4096 bytes sector size, those are called "4K sector" or "Advanced Format" hard drives: https://en.wikipedia.org/wiki/Advanced_Format

From the following documentation, there is a hidden 50 bytes of error correction code and 15 bytes of other housekeeping data for every 512 bytes sector data. The disk drive embedded microcontroller and its firmware manages those fields (those 65 bytes data is not exposed to the OS). https://www.seagate.com/tech-insights/advanced-format-4k-sector-hard-drives-master-ti/

About SMR hard drives

Shingled Magnetic Recording drives are more advanced HDDs than traditional Conventional Magnetic Recording HDDs and the sector number is virtualized: There is additional sector virtualization layer and there is a table to map sector number and physical sector number. On SMR drives, sequential sector number (or sequential LCN) does not mean those are contiguously stored to physical disk. Frequently updated sectors are stored in their CMR area and write-once-read-many-ish sectors are moved to SMR area when drive IO activity becomes low. SSDs have a similar mechanism with fast and small SLC area and slow and large QLC area.

How to create heavily fragmented file for testing

  • prepare one relatively large file (※1).
  • Prepare small capacity drive and format it.
  • Fill the entire drive with many small files.
  • Delete some of the small files with random manner until free space becomes larger than the size of file ※1.
  • Write one relatively large file ※1 to the drive. This large file should be heavily fragmented.

Fragmentation illustrated


Related

Wiki: Home