I moved my music library from a 4TB USB drive to an 8TB USB drive. The old drive is now mounted in a sub directory. The library mount point is the same. The time gap between un-mounting of the old drive and the mounting of the new drive was a minute or two. This procedure resulted in the whole of the music library being trashed. I have run the Scan command from a client system, and then I ran Scan on the server machine. The library was not restored.
Is there a way to fix this without deleting the whole library and adding it again? I am not going to do that because there is too much manual labor involved in fixing the thousands of errors Plex will make. I have spent many weeks of labor fixing up the library so that my family that is now out of state can still hear the music they heard at home. Iâm not going to bother repeating the labor if the library cannot be repaired.
Iâm not sure I understand what you did to get to that point.
Have you verified the items are actually pointing to the correct path (e.g. using the exact same mount point)?
Do you still have an old folder linked to your library (potentially one thatâs no longer available)?
If the media is in itâs designated location and the plex service account on your system has permission to see the files, they should be showing as âavailableâ in your library after scanning it.
Thanks for the reply, @tom80H . Yes, same mount point.
I have given the parent directory to the plex group, with read access, and applied the change to all sub directories. I ran the Scan after this, but the library is not restored.
My videos were also transferred from one drive to another, under the same mount point as before. The permissions of the parent directory were identical to those of the music, before I made the change of group. The libraries were unaffected in Plex. Only music is broken, even with the directory and all contents given to the plex group. (My account was added to the plex group long ago.)
Iâm quite confident permissions are not the problem, but I could be wrong.
The mount point is /home/isaiahsellassie/Music. Yes, it has been in fstab for a long time, and always mounts automatically on boot up⊠Ubuntuâs auto mounting of USB drives has been turned off. The directory is accessible and usable to all other apps except Plex. Nothing has been changed except the physical hard drive. The sub directory /JAZZ has the drive mounted under it that used to be mounted under the parent Music.
Is there a way to restore the database from a backup? Would that be easier? I have added only a few albums to the new drive, so I donât mind fixing those again after they are scanned in.
No, ~/Music/JAZZ has a separate physical drive under it. In the old arrangement ~/Music/CLASSICAL had its own physical drive under it.
All of ~/Music is available. It is the only directory added to the Plex library. The sub directories, /JAZZ now and /CLASSICAL before were not added separately. They were scanned as part of ~/Music.
That would be fine. I have not added much after the hard drive change. I donât mind manually fixing those few albums, after they get scanned in. If I can get the library exactly as it was before the hard drive upgrade, that works for me.
After unmounting the drive:
drwxr-xr-x 2 root root 4096 Sep 5 17:04 JAZZ
You were right! I did not change it, but the GUI disk manager runs in sudo mode for mounting and unmounting, so thatâs how it changed I suppose.
Out of curiosity I also checked the parent directory, mounted and unmounted respectively:
drwxrâr-- 65 isaiahsellassie plex 4096 Sep 5 17:04 Music
drwxr-xr-x 3 isaiahsellassie isaiahsellassie 4096 Sep 5 16:50 Music
After correction of permissions, unmounted
drwxr-xr-x 2 isaiahsellassie plex 4096 Sep 5 17:04 JAZZ
I ran the Scan in Plex, but iit stopped as usual after a minute. Library is not restored.
So youâre using the GUI disk manager to do the mounting?
Thatâs going to set a flag and , in spite of the permissions, going to block every username (including Plex) except you.
I really suggest the best way to do this is to make the entries in /etc/fstab for it to mount at boot time.
Doing this means it avoids the GUI mounter and all the problems associated with it.
PLUS, the drive will be mounted before Plex starts and Plex will always find the media there ready for it.
All drives are set to mount at boot time from fstab entries. I use the GUI disk manager only when I am making changes. I used it to format the new drive with EXT4 and mount it in a temporary locationâ ~/Music1 âso as to run rsync on the data. After all the data was copied over, I unmounted the old drive, and mounted the new drive under ~/Music. Then I mounted the old drive temporarily in ~/JAZZ, deleted all other files except the JAZZ sub dir, moved all files from JAZZ sub dir to the root of the drive, deleted the JAZZ sub dir,. Then I unmounted it from ~/JAZZ and mounted it in ~/Music/JAZZ. All this was done with the GUI tool. Except of course the rsync was done from a terminal.
The final step was cleaning up the fstab in a text editor. Then I rebooted and all drives mounted perfectly as written in fstab. This includes ~/Videos which Plex is reading without any issues. It also is a new drive, with the data copied over by rsync. The permissions are identical. How come the video library is working fine, and only music is broken? The same GUI tool was used to mount and unmount.
> # /etc/fstab: static file system information.
> #
> # Use 'blkid' to print the universally unique identifier for a
> # device; this may be used with UUID= as a more robust way to name devices
> # that works even if disks are added and removed. See fstab(5).
> #
> # <file system> <mount point> <type> <options> <dump> <pass>
> # / was on /dev/sda2 during installation
> UUID=913219b3-4363-41e0-8444-c39239cf8de1 / ext4 errors=remount-ro 0 1
> # /boot/efi was on /dev/sda1 during installation
> UUID=8637-7636 /boot/efi vfat umask=0077 0 1
> # swap was on /dev/sdc1 during installation
> UUID=98bc5429-438d-4f1e-911a-1a8757251609 none swap sw 0 0
>
> /dev/disk/by-id/usb-WD_My_Book_25ED_5652474A3753364B-0:0-part1 /home/isaiahsellassie/Music auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Music 0 0
> /dev/disk/by-id/usb-Seagate_BUP_RD_NA7T0H8S-0:0-part1 /home/isaiahsellassie/Music/JAZZ auto nosuid,nodev,nofail,x-gvfs-name=JAZZ,x-gvfs-show 0 0
> /dev/disk/by-id/usb-WD_My_Passport_25E2_575831314442374C44434459-0:0-part1 /home/isaiahsellassie/Videos auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=Videos 0 0
> /dev/disk/by-id/usb-WD_My_Passport_0827_5758393141373552464E4334-0:0-part5 /home/isaiahsellassie/backup auto nosuid,nodev,nofail,x-gvfs-name=backup 0 0
sudo bash
umount /home/isaiahsellassie/Music/JAZZ
chmod 755 JAZZ CLASSICAL
umount /home/isaiahsellassie/Music
chmod 755 Music
mount /home/isaiahsellassie/Music
mount /home/isaiahsellassie/Music/JAZZ
exit
Please correct me if CLASSICAL isnât in the Music directory.
It is in ~/Music/CLASSICAL. It used to be on a separate hard drive mounted in that location. Not any more. Now ~/Music/JAZZ is on its own separate drive.