Mon Oct 13, 2014 9:21 pm by normanw18
Hi I have some input with regard to how to solve the problem of the Serviio index entries being removed when an external hard is being used to store video, pictures and music files.
I have a 2TB Western Digital usb drive (MyPassport). I run Windows 7 and I run Linux Manjaro.
Windows 7.
I don't seem to have any problem running the hard drive under Windows 7 , except that one must not unplug the hard drive, before stopping Serviio, as Serviio will on it's next scan for file changes start removing all the entries as Serviio cannot find the existing files.
Linux - Manjaro
Here we encounter a bigger problem but with, I believe, a very workable solution.
You can add the drive to the Fstab which will then mount the drive at boot time. This has the draw back that should the drive be unmounted or if the usb drive is unplugged, before stopping Serviio, then Serviio will on it's next scan for file changes start removing all the entries as Serviio cannot find the existing files.
PLEASE NOTE: the name 'mypassport' used below must be replaced with the name that you use for your mount point. Please read the man pages for systemd.mount and systemd.unit for proper naming conventions and the various options used here.
1. If serviio is not auto started at boot then issue the following command which will then start serviio at boot.
systemctl enable serviio
2. Create a mount point
mkdir /mnt/mypassport
3. Backup serviio.service (/usr/lib/systemd/system)
4. Add the following entries in 'serviio.service' under [Unit]
#The following statement binds the mounted drive to Serviio - So should the drive be unplugged Serviio will stop running.
BindsTo=mypassport.mount
#The following statement ensures that Serviio only starts if the the drive is mounted. So no drive no Serviio.
After=mypassport.mount
5. Create a file in '/usr/lib/systemd/system' with the name mypassport.mount. Add the following statements.
[Mount]
# The following statement specifies which device is associated with the mount point. Replace 'sdc1' with your own device.
What=/dev/sdc1
# The following statement takes an absolute path of a directory of the mount point.
Where=mypassport
That all.
If the drive is unplugged, the mount point is removed and serviio stopped. If the drive is then plugged back in, the mount point is recreated but serviio will have to be manually restarted, which can be done with the 'systemctl start serviio' command.
Could Serviio be changed to automount the required drive before it starts a scan for new / changed files? The serviio console could have an option that specifies if a drive should be automounted or that it must be mounted otherwise serviio will not run.
It is strange that an erroneous message is displayed (Folder '/mydirectory/myfile' is either not an existing directory or cannot be read due to access rights' ) when the drive has been unplugged. More accurate interpretation of error messages would be helpful.