Jump to content

Hard drive died - how do I find what content is missing?


Go to solution Solved by Guest,

Recommended Posts

StiffUpperNailTypo
Posted

My server has 4 hard-drives, 1 of which has died so I've lost a few terabytes of movies and shows. Is there a way to scan my library to check what media has been lost? 

Perhaps to have it marked as missing or something so I can make a list of what I need to download again when I get my new harddrives. 

Posted
22 minutes ago, StiffUpperNailTypo said:

My server has 4 hard-drives, 1 of which has died so I've lost a few terabytes of movies and shows. Is there a way to scan my library to check what media has been lost? 

Perhaps to have it marked as missing or something so I can make a list of what I need to download again when I get my new harddrives. 

Are each of the hard drives attached independently? So the disk that died has its own drive letter/mount point? If so, and if you know what the letter/mount point is, then you can query library.db for anything matching that path root.

  • Solution
Posted

@StiffUpperNailTypoI took a look at library.db and tried to put a useful query together for you. There are a lot of columns available in that table, but at a basis this should give you a starting point.

select Name,ProductionYear,ProviderIds,Path from MediaItems where MediaType IS NOT NULL AND Path like 'E:\share\video\Music Videos%';

Here's the schema in case you want something else from that table:

Id INTEGER PRIMARY KEY AUTOINCREMENT, 
guid GUID, 
type INT NOT NULL, 
data BLOB NULL, 
ParentId INT,
Path TEXT NULL,
StartDate INT,
EndDate INT,
IsMovie BIT,
CommunityRating Float,
CustomRating Text,
IndexNumber INT,
IsLocked BIT,
Name Text,
OfficialRating Text,
MediaType INT,
Overview Text,
ParentIndexNumber INT,
PremiereDate INT,
ProductionYear INT,
Genres Text,
SortName Text,
ForcedSortName Text,
RunTimeTicks BIGINT,
DateCreated INT,
DateModified INT,
IsSeries BIT,
IsRepeat BIT,
PreferredMetadataLanguage Text,
PreferredMetadataCountryCode Text,
DateLastRefreshed INT,
DateLastSaved INT,
IsInMixedFolder BIT,
LockedFields Text,
Studios Text,
Tags Text,
IsFolder BIT,
InheritedParentalRatingValue INT,
UnratedType INT,
TopParentId INT,
CriticRating Float,
PresentationUniqueKey Text,
OriginalTitle Text,
IsVirtualItem BIT,
SeriesName Text,
Album Text,
AlbumId INT,
SeriesId INT,
Tagline Text,
ProviderIds Text,
Images Text,
ProductionLocations Text,
TotalBitrate INT,
ExtraType INT,
Artists Text,
AlbumArtists Text,
SeriesPresentationUniqueKey Text,
ExternalId Text,
OwnerId INT,
Width INT,
Height INT,
Size INT,
Container TEXT,
Status INT,
DisplayOrder INT,
ThreeDFormat INT,
UserDataKeyId INT, ChannelNumber Text NULL, Composers Text NULL, Filename Text NULL, RemoteTrailers INT NULL, SortIndexNumber INT NULL, SortParentIndexNumber INT NULL, IndexNumberEnd INT NULL, IsKids BIT NULL, IsSports BIT NULL, IsNews BIT NULL,
FOREIGN KEY (UserDataKeyId) REFERENCES UserDataKeys2(Id)

 

StiffUpperNailTypo
Posted

Yes, the drives are all separate. I will have a look when i am home from work and try running this query. 

 

Thank you for the query, ill get back to you with results.

rbjtech
Posted

Another way is to look at the log file at the time of the scheduled scan after the drive went missing.

You should see lots of 'item missing - deleting entry' type logs.  If you filter these - then that will also be a list to work from. 

  • Thanks 1
StiffUpperNailTypo
Posted
On 14/06/2023 at 22:47, andrewds said:

@StiffUpperNailTypoI took a look at library.db and tried to put a useful query together for you. There are a lot of columns available in that table, but at a basis this should give you a starting point.

select Name,ProductionYear,ProviderIds,Path from MediaItems where MediaType IS NOT NULL AND Path like 'E:\share\video\Music Videos%';

Here's the schema in case you want something else from that table:

Id INTEGER PRIMARY KEY AUTOINCREMENT, 
guid GUID, 
type INT NOT NULL, 
data BLOB NULL, 
ParentId INT,
Path TEXT NULL,
StartDate INT,
EndDate INT,
IsMovie BIT,
CommunityRating Float,
CustomRating Text,
IndexNumber INT,
IsLocked BIT,
Name Text,
OfficialRating Text,
MediaType INT,
Overview Text,
ParentIndexNumber INT,
PremiereDate INT,
ProductionYear INT,
Genres Text,
SortName Text,
ForcedSortName Text,
RunTimeTicks BIGINT,
DateCreated INT,
DateModified INT,
IsSeries BIT,
IsRepeat BIT,
PreferredMetadataLanguage Text,
PreferredMetadataCountryCode Text,
DateLastRefreshed INT,
DateLastSaved INT,
IsInMixedFolder BIT,
LockedFields Text,
Studios Text,
Tags Text,
IsFolder BIT,
InheritedParentalRatingValue INT,
UnratedType INT,
TopParentId INT,
CriticRating Float,
PresentationUniqueKey Text,
OriginalTitle Text,
IsVirtualItem BIT,
SeriesName Text,
Album Text,
AlbumId INT,
SeriesId INT,
Tagline Text,
ProviderIds Text,
Images Text,
ProductionLocations Text,
TotalBitrate INT,
ExtraType INT,
Artists Text,
AlbumArtists Text,
SeriesPresentationUniqueKey Text,
ExternalId Text,
OwnerId INT,
Width INT,
Height INT,
Size INT,
Container TEXT,
Status INT,
DisplayOrder INT,
ThreeDFormat INT,
UserDataKeyId INT, ChannelNumber Text NULL, Composers Text NULL, Filename Text NULL, RemoteTrailers INT NULL, SortIndexNumber INT NULL, SortParentIndexNumber INT NULL, IndexNumberEnd INT NULL, IsKids BIT NULL, IsSports BIT NULL, IsNews BIT NULL,
FOREIGN KEY (UserDataKeyId) REFERENCES UserDataKeys2(Id)

 

That worked. 5500 movies/episodes are missing... thank you

  • Thanks 1

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...