I ported over here from the old site which had this topic but mostly for Freenas. Since I’m on Goldeneye I thought it best to ask here. Here’s the issue: My Truenas is basically an SMB NAS storage. I have imported many photos. Of course, Win11 created thumbs.db files which carried over to folders I transferred over to Truenas. Those folders cannot be deleted from Truenas because of that file. I can and have deleted or moved the content but the folder won’t delete.
In my research, I discovered a Windows procedure to prevent thumbs.db from being created there so it won’t affect Truenas in the future. But my concern is with the past. I need those .db files gone from Truenas to get rid of the folders, clean house, so to speak. But I’m not a “coder” and need some help with CLI Shell commands to do so.
I noticed one other poster in the old forum was advised “Forget about them. They’re too small. Leave them there.” But he was asking for the same thing I am. It’s annoying to have an empty box with something you’ll never use on the floor in your house you’re always tripping over. Just trying to clean up that floor.
It’s mainly my photo collection which has subfolders @ tank/win/pictures. Any insights will be much appreciated. Thanks.
Then, make sure that it’s finding the files you want. This will also force you to be careful with commands, since you can review what you’re about to do.
find /mnt/tank/win/pictures -type f -name Thumbs.db
Finally, run the deletion.
find /mnt/tank/win/pictures -type f -name Thumbs.db -delete
No need for -iname or wildcards. Windows 10/11 use the specific name Thumbs.db.
You’ll likely need /mnt/ at the start of the path, since TrueNAS imports pools with -R /mnt by default.
A pool checkpoint can be made with zpool checkpoint tank. It can later be discarded with zpool checkpoint -d tank. ↩︎
I really appreciate everyone’s input on this issue. I know enough to “backup before you nuke” anything so I did. I saw archiboy’s post first before I got the other suggestions/corrections. The result of archboy’s worked in the sense of releasing the thumbs.db files from the deletion block. It did not delete anything BUT I went through the offending folders from Windows and I was able to manually delete the folders that had the file in it (my goal) successfully. As I mentioned in the initial post, I did the task to prevent Windows from creating that .db in the future so–at this point–you have all contributed useful information and I am deeply grateful! I will keep your posts for future use if I run into the same situation. Good job!