Jump to content

Deleted files not clearing space?


darksun5183

Recommended Posts

I've been using Plex for years now, and Unraid for a while as well, currently on version 6.3.2.  I'm sure that this is something simple and I'm just missing it but for the life of me I can't figure this out. The problem I'm having is this:

 

I've recently gotten a Roku TV and have been deleting files from within the Plex app on the TV, today I realized that files I'm deleting from the Plex app are not clearing up space within Unraid. Whenever I check the dashboard, I still have the same amount of space no matter what files I delete. I've verified that the files are being removed and that they're actually stored on the disks I'm monitoring disk space for. 

 

Before I would perform clean up from within the Plex dashboard or by physically deleting the files from terminal or file explorer. I've verified that deleting in this way does in fact clear space on the Unraid dashboard. What am I missing here? Is there a recycle bin or something similar where the files are being placed? Is there a schedule or mover that needs to run to actually the delete the files? I'm at a complete loss at this point and hoping that someone can point me in the right direction. Thanks!

Link to comment

 

2 minutes ago, trurl said:

Can you provide screenshots that show before and after the deletion and demonstrate what you are seeing that makes you think that files are being deleted without freeing space?

I absolutely can however I'm not sure if that'll be helpful unless I'm thinking of the wrong scenario: Screenshot of folder with file, screenshot of free space, screenshot of folder without file, screenshot of free space again?

 

4 minutes ago, trurl said:

Do you have the Recycle Bin plugin installed?

Not that I'm aware of, plugins page does not show anything which relates to a recycle bin.

Link to comment

I've found the culprit but I can't explain what's happening. The files are being deleted but are being replaced with a hidden file of the same size. For example, I delete a video file, the file is removed but when I run an ls -la command I see a file named .fuse_hidden00012f0800003973 which has the same file size. Whenever I try and delete the file it gets replaced with another fuse file with a different name.

 

No space is being cleared and I'm quickly running out of space. Does anyone know what is causing this issue and how it can be resolved?

Link to comment
Quote

You can safely ignore .fuse_hiddenXXXX files. It means a file was deleted but there is at least one software which is still using it, so it can't be removed permanently.

It will be done automatically when the relevant software stops using the file or exists. Such files are always gone after umount/reboot. This is how Linux and any Unix works but only FUSE exposes these files to the user.

These are likely files that were meant to be deleted but are somehow still in use

 

A stop / restart of the array should get rid of them.

Link to comment

That does appear to be the case. I stopped the array and put it into maintenance mode to check the filesystem. No errors were found and when I restarted the array I had magically gained the missing 150gb of space. I'm going to test deleting another file from Plex on the Roku TV to see if it actually deletes it or adds the hidden .fuse file.

Link to comment

Note that Linux can allow a file to be deleted while it's open.


This means there are no longer a file name pointing to the file so if looking through the directory tree and summing all files the size of the directory tree will be smaller.

But the actual disk storage usage isn't decreased.

 

As soon as the program finally closes the file, then the blocks consumed by the file will be flagged as unused and the file system will regain the free space.

 

This happens because Linux is using reference counters on files. Every directory entry that points to an inode represents one reference. Using hard links means having multiple directory entries that points to the same inode. To erase the file (i.e. release the inode) requires that all directory entries pointing to the inode needs to be removed. But any program that has the file open will also represent a reference count. So even with zero directory entries pointing to the inode, Linux has to wait until zero programs has the inode open until the reference count reaches zero and the inode gets released. And then the disk space consumed by the inode file data gets returned.

Link to comment

Thanks pwm, that makes sense. It's weird that I've never ran into this issue before and have been using Plex and Unraid for a long time. Granted, I just started using it with a Roku TV but after the restart of Unraid I can delete files without issue. Not sure where the disconnect is there but at least I know of what to look out for in the future.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...