ImDisk ramdisk: deleted hardlink files lingers in Everything index

Discussion related to "Everything" 1.5 Alpha.
Post Reply
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by nod5 »

1.5.0.1269a (x64)

Issue: On a NTFS ramdisk created with ImDisk Everything does not detect when a hardlink file is deleted in Explorer. Everything correctly detects when a new hardlink file is created so the issue is only about deleting.

The hardlink file was created with mklink like this
mklink /H X:\hardlink.txt X:\original.txt


I don't know if this is specific to ImDisk or an issue with 1.5 alpha and ramdisks in general.

edit: corrected mklink syntax
Last edited by nod5 on Thu Jul 29, 2021 7:22 am, edited 3 times in total.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by void »

While Everything 1.5 does track new and modified hard links, It does not track deleted hard links.

This is a limitation with the USN journal and Everything.


To force Everything to remove deleted hard links:
  • In Everything, from the Tools menu, click Options.
  • Click the Indexes tab on the left.
  • Click Force Rebuild.
  • Click OK.
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by nod5 »

Thanks for the reply. Force rebuild works but takes a bit of time to finish.

Idea: Could Everything have an option to frequently check the existence of the hardlink files it has indexed? In use cases with not very many individual hardlink files (I'm not suggesting this for hardlink folders) this might be feasible.

edit:
void wrote: Sat Jul 24, 2021 12:45 pm While Everything 1.5 does track new and modified hard links, It does not track deleted hard links.
In my tests Everything 1.5 does detect when a hardlink file on a regular SSD NTFS drive is deleted. I see lingering hardlink files only on the NTFS ramdisk.
Last edited by nod5 on Sat Jul 24, 2021 1:47 pm, edited 1 time in total.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by void »

If enough information is available in the USN Journal, Everything will be able delete the hard link.

However, it's not always possible.

Everything would need to track File Reference Numbers. (which it does not by default)
I will consider an option to do this when indexing File Reference Number. (Everything uses the Property "File ID" for File Reference Number)
Thank you for the suggestion.
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by therube »

(I had it on my list to inquire about just this...)
In my tests Everything 1.5 does detect when a hardlink file on a regular SSD NTFS drive is deleted.
In that regard, I'll just note that hardlink deletions were not detected on HDD on my end.
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by nod5 »

therube wrote: Mon Jul 26, 2021 8:08 pm (I had it on my list to inquire about just this...)
In my tests Everything 1.5 does detect when a hardlink file on a regular SSD NTFS drive is deleted.
In that regard, I'll just note that hardlink deletions were not detected on HDD on my end.
That's interesting. If the dependency is "If enough information is available in the USN Journal" as void said then a follow up question is what determines that availability? Does it vary with different HDD and SSD models? Or other PC hardware? OS settings? Partioning?
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by therube »

(Beyond me, so I'll just throw these out here...

USN journal for hard links
NTFS Journal USN_REASON_HARD_LINK_CHANGE event)
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by void »

It depends on the filename used in the USN Journal event.

If the filename used with USN_REASON_HARD_LINK_CHANGE event is not found in the MFT, the file is removed.

The filename could be any one of the available hard link names.
Without going into details, the filename used will essentially be random.
nod5
Posts: 38
Joined: Fri Aug 19, 2016 9:12 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by nod5 »

void wrote: Wed Jul 28, 2021 9:41 am It depends on the filename used in the USN Journal event.
It would be useful to know the answer to this: If a user in tests notices that Everything 1.5 does detect hardlink deletion on a particular SSD drive then can the user rely on that being the case also going forward, for that particular drive? Or is whatever fortunate factor that made the detection possible at test time volatile so that at later times hardlink deletion will not be detected even by the same version of Everything 1.5 on the same SSD?
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by therube »

(Just noting my notes [from a couple weeks back]...

if i (hard) DELETE a hardlink (through Everything)
should Everything have updated itself to know the link is gone?
- as it is, Everything still shows the "hardlink",
though it is no longer there
& the (remaining) file no longer shows it to be linked
(both in Properties & via icon, c/o HardLinkShell)

(links, while natural in UNIX, have always scared me - in Windows)

i guess what scares me the most, is that it is simply a feature that most
/users/ do not use, & gets relatively no mention - anywhere.
very similar to AlternateDataStreams, a feature generally hidden from view
& a feature no less, that users here want to use.

heh. i inadvertently created an ADS via some piece of software
(to remain unnamed) that wasn't even supposed to create an ADS (& at
the same time "deleted" the file that the ADS was attached to ;-))
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by void »

can the user rely on that being the case also going forward, for that particular drive?
No, Everything cannot guarantee hard link detection will work for a particular drive.



To quickly reindex an NTFS volume:
  • In Everything, type in the following search and press ENTER:
    /reindex c:
    --- where c: is the volume you wish to reindex.
should Everything have updated itself to know the link is gone?
Everything asks the OS to "delete" the currently selected files.
Everything doesn't know what the OS will do.
It might delete the files, move them to the recycle bin or partially delete a few of them.

If you are deleting a single file it might be possible to detect a successful delete through Everything.
I will consider adding support for removing deleted hard links from within Everything when a single file is selected.
Thanks for the suggestion.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: ImDisk ramdisk: deleted hardlink files lingers in Everything index

Post by void »

The method I had to detect some hard link removals is causing Everything to miss changes to hard links.

Everything 1.5.0.1284a will no longer attempt to track hard link removal.
Forcing a rebuild will be required to remove stale hard links.


I have on my TODO list to track hard link removal when adding the File ID property to your index.
Post Reply