Jump to content

is there a way to "not empty trash" when a mount is disconnected?


Recommended Posts

jaquestati
Posted

had a drive disconnected accidentally, and lost TONS of stuff that will take days to re-import : (

is there any plex like "don't empty trash" option that i'm somehow missing?

thanks...

Posted

Hi, why do you think you have to reimport it?

jaquestati
Posted

well all the movies/shows disappeared after a scan :) :(

luckily i only scanned like 5 or 6 libraries when the mount was down and i didn't realize it..

but.. like my spaghetti western library was on of them... and all like 1100 movies (lots of duplicates/different versions of things ahaha) were gone... the library was empty (thats how i realized a mount was down) which was really frustrating as that library in particular had 100's of manual matches/edits for like different dubs, versions with subs, custom subs, no subs, dual custom audio etc... probably a hundred hours of work.. kaput... ahahaha...

luckily i didnt scan my music libraries as reimporting them from the cloud for some reason takes like a week ahahaha...

i run plex on the same server, but luckily it has an option to "not empty trash on a library scan"... so everything was still there/,metadata/manual matches/edits.. and playable, just has a red trashcan icon on it till plex rescans it...

  • 1 month later...
Posted
On 1/2/2023 at 1:10 PM, jaquestati said:

well all the movies/shows disappeared after a scan :) :(

luckily i only scanned like 5 or 6 libraries when the mount was down and i didn't realize it..

but.. like my spaghetti western library was on of them... and all like 1100 movies (lots of duplicates/different versions of things ahaha) were gone... the library was empty (thats how i realized a mount was down) which was really frustrating as that library in particular had 100's of manual matches/edits for like different dubs, versions with subs, custom subs, no subs, dual custom audio etc... probably a hundred hours of work.. kaput... ahahaha...

luckily i didnt scan my music libraries as reimporting them from the cloud for some reason takes like a week ahahaha...

i run plex on the same server, but luckily it has an option to "not empty trash on a library scan"... so everything was still there/,metadata/manual matches/edits.. and playable, just has a red trashcan icon on it till plex rescans it...

It shouldn't be happening. We'd have to look at an example along with the emby server log. Thanks.

jaquestati
Posted

what shouldn't be happening?

from time immemorial.... if i ever scanned an emby library with a drive accidentally disconnected... emby deleted everything that was on that drive : ) : (

 

  • Agree 1
Posted
1 hour ago, jaquestati said:

what shouldn't be happening?

from time immemorial.... if i ever scanned an emby library with a drive accidentally disconnected... emby deleted everything that was on that drive : ) : (

 

Let's look at an example.

Thanks.

GrimReaper
Posted
4 hours ago, Luke said:

It shouldn't be happening.

If it shouldn't be happening, shouldn't this FR be marked as completed then?

 

  • Thanks 1
jaquestati
Posted

but i don't see it as a 'problem' ... to report... i see it as a well known feature : ) : (

i'm not saying something went wrong.. i knew from the start this would happen... just saying it shouldn't (again a simple check box of 'dont delete trash' like plex has would fix it)

Posted

I'm not familiar with Plex but if Emby can't find previously existing items which were not deleted via the UI would it be possible to flag them as missing until the user takes action? The user action could include acknowledge and allow deletion or fix the backend and rescan among other things. 

Posted
6 hours ago, jaquestati said:

but i don't see it as a 'problem' ... to report... i see it as a well known feature : ) : (

i'm not saying something went wrong.. i knew from the start this would happen... just saying it shouldn't (again a simple check box of 'dont delete trash' like plex has would fix it)

Right and we're saying that it shouldn't be deleting the trash to begin with.

jaquestati
Posted

weird...so if i accidentally scan a library that is accidentally disconnected... everything shouldn't be getting removed?

is this a change/something new?

 

  • 2 weeks later...
Posted
On 2/8/2023 at 8:55 PM, jaquestati said:

weird...so if i accidentally scan a library that is accidentally disconnected... everything shouldn't be getting removed?

is this a change/something new?

 

It should not be removed, and no, it's not a new thing.

mastrmind11
Posted

this happens to me from time to time if i reboot my nas and server and the server beats the nas before the shares get mounted.  it's just n empty library, if you rescan all the posters and whatnot come back.  nothing should be getting deleted physically.  i'v never seen that happen.

jaquestati
Posted
On 2/20/2023 at 9:48 PM, Luke said:

It should not be removed, and no, it's not a new thing.


ah... i accidentally scanned my main tv library with the cloud drive crashed/disconnected and it happened again...

but maybe now that i look at it this time... maybe emby does what plex does now and not actually remove them but it has to rescan and get the metadata for all the episodes again after this happens the same way plex does?

i can't be sure as i didn't look in the library before i reconnected the drive and started a new scan of it.. to know if the library was empty or just all got unidentified/with no series identified no thumbnails/covers etc. ?

all i can say is when i did check the library, like 5% had been reidentified/had covers/thumbs etc.... and it's slowly doing the rest as i type...  it's been like 12 hours and looks to take another day or so ahaha : (

not sure exactly whats going on here to be honest : ) : (

is that whats supposed to happen after an accidental scan on a unmounted drive? emby has to rescan everything and reidentify get the metadata all over again for the stuff not found in the unmounted scan?

ps- if i made like daily backups of emby, would it be enough to just backup the /var/lib/emby/data dir with the database etc, so that i could just restore that if this ever happened again? to save what its doing now and gonna do for the next day or so (reidentify/regrab all the metadata etc) or would i also have to backup the metadata (way too big never could do that if so alas)

mastrmind11
Posted
5 hours ago, jaquestati said:


ah... i accidentally scanned my main tv library with the cloud drive crashed/disconnected and it happened again...

but maybe now that i look at it this time... maybe emby does what plex does now and not actually remove them but it has to rescan and get the metadata for all the episodes again after this happens the same way plex does?

i can't be sure as i didn't look in the library before i reconnected the drive and started a new scan of it.. to know if the library was empty or just all got unidentified/with no series identified no thumbnails/covers etc. ?

all i can say is when i did check the library, like 5% had been reidentified/had covers/thumbs etc.... and it's slowly doing the rest as i type...  it's been like 12 hours and looks to take another day or so ahaha : (

not sure exactly whats going on here to be honest : ) : (

is that whats supposed to happen after an accidental scan on a unmounted drive? emby has to rescan everything and reidentify get the metadata all over again for the stuff not found in the unmounted scan?

ps- if i made like daily backups of emby, would it be enough to just backup the /var/lib/emby/data dir with the database etc, so that i could just restore that if this ever happened again? to save what its doing now and gonna do for the next day or so (reidentify/regrab all the metadata etc) or would i also have to backup the metadata (way too big never could do that if so alas)

are you saving the metadata with your media?  if so, rescanning should be almost instant.  if not, then it has to refetch, which as you are experiencing, takes a long time for large libraries.

jaquestati
Posted (edited)
On 3/1/2023 at 7:45 AM, mastrmind11 said:

are you saving the metadata with your media?  if so, rescanning should be almost instant.  if not, then it has to refetch, which as you are experiencing, takes a long time for large libraries.

no, alas i can't save metadata with the movies, as it's all in the cloud... (as most of it was when i started using emby, and emby can't write to that mount)

ps- its still scanning/importing ahaha... this looks to take another full day at least to get it all back   :  )  :  (

EDIT- make that 3-4 days i think...like half way thru at like the 48 hour mark ahahaha... : (

EDIT- FINALLY it finished ahaha.. took about 4 days : ) : (
now to figure out what i need to backup so i dont have to waste 4 days reimporting/regrabbing metadata etc.... still not sure of just backing up the database would be enough (that works for plex unsure of how emby deals with missing mount stuff... does it delete the metadata as well?)

Edited by jaquestati
  • 7 months later...
Posted
On 01/03/2023 at 17:08, jaquestati said:

EDIT- FINALLY it finished ahaha.. took about 4 days : ) : (
now to figure out what i need to backup so i dont have to waste 4 days reimporting/regrabbing metadata etc.... still not sure of just backing up the database would be enough (that works for plex unsure of how emby deals with missing mount stuff... does it delete the metadata as well?)

Did you find a solution for this? I have had the same issue twice now (3 days to rescan all the metadata)  I keep all the metadata on the SSD and not in the media folders for the same reason as you

Posted

I too was having media removed from library upon a reboot of linux server, when the mnts had not mounted before emby start.

 

I turned of real time monitoring, and this stopped media from being removed from the list. I manually scan a folder when I add new media.

 

There should be a feature where linux mounts do not remove media unless specified.

Posted
14 hours ago, Luke said:

Hi there, let's look at an example:

Thanks.

Sorry, I wasnt looking for a solution to a problem.  I merely offered advice about what I do to overcome the mounting issue and media being removed from library.

  • Thanks 1
  • 8 months later...
Posted (edited)
On 2/21/2023 at 2:48 PM, Luke said:

It should not be removed, and no, it's not a new thing.

You said here that it *is* removed: 

My NFS mount ran into issues and from emby's point of view (via docker), the folder was empty. All library items were removed in Emby. This is to be expected. However, once resolving the NFS issue - when Emby could see the library items again - it needed to fetch the metadata, regenerate the intro markers and video thumbprints. This will take many hours. Emby ideally should be configurable to not delete the files it generates when media is missing/deleted. Or, only delete them after a few days. This has happened a few times now and is quite frustrating

As an aside, could video marker generation (and thumbnail generation), when set to 'as a scheduled task and when media is added' run these tasks at the *end* of the library scan? It's better to have all the media available and *then* run the task, rather than having the media slowly come back online. In general I want these tasks kicked off as soon as new media is added, which is why I've got it on. There is a work around to turn this setting off, scan the libraries and then turn it back on. It works, but would be nice to not need to do so

Edited by rjrudman
Posted

I was actually able to restore from Emby's backup which saved me from having to reprocess my entire library, which was very nice, but still hoping to have a way to get Emby to not delete/delay deleting these files for a while

darkassassin07
Posted

I've recently detailed how to prevent this behavior:

 

 

 

Happy2Play
Posted
9 hours ago, rjrudman said:

Emby's backup which saved me from having to reprocess my entire library,

Yes backups are your friend as it can immediately restore everything that was purged.

Really don't see any way around the issue as the logic has already been mentioned.  Beside never deleting content with a library scan and then you potentially end up with bloated db.

Quote

If the entire mount is unreachable, then it stays in the library and the server assumes it is offline.

But the mount is reachable and some folder underneath that is gone, then the server treats that as content having been deleted.

But as @darkassassin07posted there appears to be a workaround.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...