Files disappearing from dataset

I’ve used Truenas core for a while, but am new to Truenas scale. I recently built a Truenas scale server to use as a Plex media server. Everything is set up and working, and I copied my media files to the dataset via SMB share. Plex recognized all of the media files without issue. However, a few days later I attempted to play one of them and found that all files had disappeared from the dataset. This has happened 3 times now and I’m at a loss. I can copy the files over and they all work perfectly. I can play them without issue, but a couple of days later the dataset is empty. This last time I checked and all the files were there last night, but are gone this morning. I don’t see anything in the logs to indicate why they’re disappearing. Drive health is good and there are no alerts from the server. Any thoughts as to what could cause this? Thanks in advance.

My guess is that it’s due to an app you have running either on the server, or at least with access to the SMB share.

Hi, thanks for replying. This is a fresh install of Truenas Scale and the only thing running on it is Plex. I did find something that I’m testing now. I noticed all the files that were copied to the SMB share showed that they were owned by my created user account and the group “root”. I noticed because there was one file that didn’t disappear and it was owned by my created user account and the group “apps”. So I copied the files back and chown’d them to the group “apps”. I also added the group “apps” to the account. That was this morning and I’m monitoring to see if the files remain. So far, so good.

Also, regarding your suggestion, only one system has access to the SMB share, and it’s the one copying the files over. Thanks!

Well, I just checked and the files are gone again. I don’t see anything in the logs to indicate they were deleted. What’s weird is one file is still there, but all the others are gone.

Is it moving them somewhere else or are you getting back the file space? Doing any snapshots?

Hi, the files are just gone. The space is reclaimed. It’s as if they were never there. I did notice something interesting last night and I made some changes to see if it makes a difference: I’d set up the dataset and added a couple of folders in it, then shared out those folders as separate SMB shares. That’s how I was copying the files over. As a test, I deleted those shares, then shared the main dataset folder as the SMB share and copied some files over. They’ve been there since yesterday. If they’re still there when I get home from work this may have stopped the deletions. I can’t think of why it would matter, but if it works I’ll be thrilled.

With the details you have given, Plex is the primary suspect.

To verify, stop Plex. Make really sure it isn’t running.
Now put the files in the dataset, just as you have.

And wait.
If they still get removed, Plex is not the cause and you should look elsewhere.

-—
With your latest post I am confused as to how your shares were defined. Did you have multiple shares pointing at the same place, and when you stopped doing it that way and instead resorted to share the “main dataset”, the problem has gone away?

1 Like

Sorry, I should’ve stated before that I have Plex off. Here’s how the shares were:
Dataset named “MediaServer”.
–Folder named “plex”
–Folder named “movies”
–Folder named “tvshows”

SMB share of “movies” and “tvshows” folders

What I did is remove the “movies” and “tvshows” SMB shares and create a new “plex” share.

My formatting didn’t come through. The “movies” and “tvshows” folders are subfolders of “plex”.

How did you create the folders?

I usually share only datasets, did not even know you could share just folders.

Be careful with that “plex” folder, so Plex doesn’t accidentally use it as application/data folder for it’s own internal usage. Your media folders should be in a different location than those Plex application/data folders.

1 Like

I’ll check into that to be sure. Thanks! I tell ya, I’m about to scrap Truenas altogether and just go back to Linux Mint. I’ve run Plex Server on Mint and Windows and it’s as simple as it gets. Best of all, since I can just use a standard drive to hold my media, it’s easy to swap between systems. I thought Truenas would offer some benefits, but so far it’s just been a headache.

1 Like

Although I didn’t figure out what the issue was, I was able to solve the problem. I did a full reinstall of Truenas and followed the storage configuration outlined in a video I found on Youtube titled " Installing Plex on truenas scale and setting up plex with datasets" by John Kinder (sorry I’m unable to use links here). It was easy to follow and got me up & running quickly. If I had to guess, I’d say tangofan was correct in the assumption that it had something to do with the way the Plex folder was set up. I must’ve inadvertently set things up with the media files in the plex folder and plex was running some sort of cleanup job. I guess I’ll never know.

Everything is working perfectly now and the files aren’t disappearing.

2 Likes