You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Windows Analyze counts NTFS hard links more than once #2011
On NTFS, mo analyze counts each directory entry for a hard-linked file.
Two names for one 4,096-byte file report 8,192 bytes.
This affects directory totals and --json output.
The windows source at 59f3dc5a reported 6,911,541,248 bytes for a 100,000-entry fixture.
The fixture held 30,000 unique files and 70,000 extra hard links.
The unique file bytes totaled 2,073,501,696.
The scan counts the file once and reports 4,096 bytes.
Both names remain visible. A later link can show 0 B.
Environment
Windows 11 on NTFS. Reproduced with Mole CLI (Windows) source 59f3dc5a.
The test used mo analyze --json; it changed no files.
Proposed fix
Use the volume serial number and file ID from Windows directory records.
Share the identity set across one scan and keep the result out of reusable caches.
Draft implementation: luojiyin1987:fix/analyze-hardlink-dedup.
@luojiyin1987 Thanks for the report and the fix. #2012 is merged into the windows branch, so each NTFS file now counts once per scan and later links show 0 B. #2015 follows up on the memory cost you measured, keeping NTFS identities as one bit per MFT record. Both ship with the next Mole CLI (Windows) release, and a clone install of the windows branch picks them up with mo update now.
Activity
tw93 commentedon Nov 16, 2026
@luojiyin1987 Thanks for the report and the fix. #2012 is merged into the
windowsbranch, so each NTFS file now counts once per scan and later links show 0 B. #2015 follows up on the memory cost you measured, keeping NTFS identities as one bit per MFT record. Both ship with the next Mole CLI (Windows) release, and a clone install of thewindowsbranch picks them up withmo updatenow.