Power Outage, USB Drive Not Mounted, Plex dutifully reads the change an clobbers my library

Looking for tips or tricks to prevent this in the future. It’s a rare occurrence so not really an imperative…

I had a power outage long enough to take down my drive array and networking (small UPS) but not the server (big UPS). When the power came back on, the Movie drive did not re-mount to /media/Movies. A cron job fired up and copied a movie from my office computer into the directory, which, without a mounted drive just sat there. Plex saw the change and plex-danced itself down to 1 movie! Haha- unintended consequences :slight_smile:

Is there a better way I can configure? Is there a way to check for mounting before plex updates? I really like the automatic update (and this was a wing-nut occurrence) so I’d like to leave that alone. I gunzipped a backup into the plex directory so there was really nothing lost other than a little time.

regards

Ensure that Settings -> Library -> Empty trash automatically after every scan is disabled on your server. That should prevent the server from removing items from your library if they are temporarily unavailable.

Will do! thx for the tip

To add to Philip,

If the top-most (monitored) directory itself is Not available then PMS will not remove the media. It will place Red Trash Cans over each icon until it returns.

If you were to move the mount point away from /media, you will be able to avoid what happened to you with greater control (and keep automatic + empty trash on).

It works this way because /media/<label> may or may not be removed when the drive drops. It varies by Gnome version. (/media is the automounter and source of the problem)

I want to say I created the mount-points in /media/ and mapped to FSTAB to prevent the auto-mount daemon from doing this (with already-named NTFS drives). It was so long ago… I know it’s dogma to mount externals in /mnt/ but I think I just went with /media/ since that’s where the AMD put them? Is it best practice (as far as PLEX is concerned) to put them in /mnt/? Looks like it is…

I don’t put anything in /mnt that’s permanent.
I consider /mnt as temp.

For USB drives you’ve got floating around, how about /usb ?
The name is both meaningful and doesn’t collide with any existing names.

From there, UUID= identification technique in /etc/fstab to make sure it comes back to the same mount point /usb/label-name each time.

If you use this technique, then I recommend;

/usb/<label>/Movies , with PMS attached to Movies.

This way, when unmounted, /usb/<label>/Movies/movie (year)/movie (year).ext
is missing the top most “Movies” and prevents PMS from scanning and removing.

It views the whole block as ‘unavailable’ and won’t remove it.

If it could see /usb/<label>/Movies/ and one of those next directories are gone then it sees that as “media item removed” and acts accordingly

That’s exactly how my FSTAB is built, though pointing /media/. And the drives are actually named “movies” and “movies_bak” etc. /USB/ makes perfect sense, going that way. Thanks for the insight.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.