Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Content loss after power cut
15-11-2019, 17:35
Post: #1
Content loss after power cut
I suffer from occasional power cuts. When I restart my Pi3 and win 10 PC, the content as seen in Linn Kazoo has gone or each album lists contents as "modified ..... item". More often I get "Folder view only"

I can do a rescan, but as the music files are on a mount on a Microsoft network server and there are almost 10,000 albums, it takes around 5 hours to rebuild. I have Startupscan set to false but changing it to true makes no difference

df -h finds the mount without difficulty
Find all posts by this user
Quote this message in a reply
15-11-2019, 19:05
Post: #2
RE: Content loss after power cut
I am surprised that a power cut causes the cache to be lost. Are you running MinimServer on the Pi3 or on Windows?
Find all posts by this user
Quote this message in a reply
15-11-2019, 20:01
Post: #3
RE: Content loss after power cut
(15-11-2019 19:05)simoncn Wrote:  I am surprised that a power cut causes the cache to be lost. Are you running MinimServer on the Pi3 or on Windows?

On the Pi3.
I have a similar (same size music files) set up on another Pi3 but the music is mounted on a USB attached to the second Pi3 - in this case after the power cut I reboot the Pi3 and all the music is there intact on Kazoo..This would lead me to thinking that the problem is the sustainability of a windows network mount??
Find all posts by this user
Quote this message in a reply
16-11-2019, 11:20 (This post was last modified: 16-11-2019 11:20 by simoncn.)
Post: #4
RE: Content loss after power cut
If you are running MinimServer on a Pi3 and your library is on a network mount, the MinimServer cache files are stored on the Pi3 in the minimserver/data directory. These cache files should not be affected if you have a power cut.

The problem might be caused by the path to the network mount changing when you reboot after the power cut. If this were to happen, the cache entries would no longer be valid. What do you have in the MinimServer contentDir property?
Find all posts by this user
Quote this message in a reply
16-11-2019, 14:26
Post: #5
RE: Content loss after power cut
(16-11-2019 11:20)simoncn Wrote:  If you are running MinimServer on a Pi3 and your library is on a network mount, the MinimServer cache files are stored on the Pi3 in the minimserver/data directory. These cache files should not be affected if you have a power cut.

The problem might be caused by the path to the network mount changing when you reboot after the power cut. If this were to happen, the cache entries would no longer be valid. What do you have in the MinimServer contentDir property?

I have set up the mount using
sudo mount -t cifs -o username=x,password=y //192.168.0.xxx/Music /mnt/netmusic

The IP of the Pi3 and the server are fixed. The music files are in /Music on the server

The contentDir is /mnt

The cache file is dated today
Find all posts by this user
Quote this message in a reply
16-11-2019, 15:05
Post: #6
RE: Content loss after power cut
This should be fine. The library files should all be in the path /mnt/netmusic/.... and the cache file should contain entries for this path. If you have startupScan set to false, MinimServer should load the library file information from the cache file when you restart the Pi3 after the power cut and should not attempt to scan the library files. You would see the "modified or deleted" message for any files that were loaded from the cache and don't match the real files on the network mount.

You might have problems (for example, seeing folder view only) if you have startupScan set to true and the /mnt/netmusic directory is not available at the time that MinimServer starts. You can use the delayStart setting to ensure that MinimServer doesn't start scanning until the network mount is available.

As the above doesn't explain what you are seeing, in order to investigate this further I would need to see a debug log from the failed startup after a power cut. Please set the logging level to debug and run with this until the next power cut. After the failed restart, please make a copy of the minimserver.log file and inform me by PM or a post here. I will send you instructions for getting the minimserver.log file to me so that I can look at it.
Find all posts by this user
Quote this message in a reply
16-11-2019, 15:27
Post: #7
RE: Content loss after power cut
(16-11-2019 15:05)simoncn Wrote:  This should be fine. The library files should all be in the path /mnt/netmusic/.... and the cache file should contain entries for this path. If you have startupScan set to false, MinimServer should load the library file information from the cache file when you restart the Pi3 after the power cut and should not attempt to scan the library files. You would see the "modified or deleted" message for any files that were loaded from the cache and don't match the real files on the network mount.

You might have problems (for example, seeing folder view only) if you have startupScan set to true and the /mnt/netmusic directory is not available at the time that MinimServer starts. You can use the delayStart setting to ensure that MinimServer doesn't start scanning until the network mount is available.

As the above doesn't explain what you are seeing, in order to investigate this further I would need to see a debug log from the failed startup after a power cut. Please set the logging level to debug and run with this until the next power cut. After the failed restart, please make a copy of the minimserver.log file and inform me by PM or a post here. I will send you instructions for getting the minimserver.log file to me so that I can look at it.

I think you might be right with the delay between the server re-starting and the Pi restarting. What do I enter in the delayStart to delay for a few minutes?
I have set startupScan to false

I run an auto mount
sudo nano /etc/fstab
//192.168.0.nnn/Music /mnt/netmusic cifs username=x,password=y 0 0

and a 20 second delay
sudo crontab -e
@reboot (sleep 20;/bin/mount -a)&

Or is this doubling up?

I have set logging level to debug and can provoke a power cut
Find all posts by this user
Quote this message in a reply
16-11-2019, 17:40 (This post was last modified: 16-11-2019 17:40 by simoncn.)
Post: #8
RE: Content loss after power cut
The delayStart property is described in this section.

If the network mount is not happening for 20 seconds after boot, you will need to delay MinimServer for longer than this to ensure the network mount is available.

I have an idea about what might be causing the problem you have been seeing. MinimServer has special logic to preserve the cache for a content directory that is empty or not available. However, you are specifying /mnt as the content directory rather than /mnt/netmusic and this has the effect of bypassing this special logic. As a result, it is possible for the mount delay to cause the MinimServer cache for /mnt to be rebuilt with no valid entries for files in /mnt/netmusic. If you change your contentDir setting from /mnt to /mnt/netmusic, this should solve this problem.
Find all posts by this user
Quote this message in a reply
16-11-2019, 19:19
Post: #9
RE: Content loss after power cut
(16-11-2019 17:40)simoncn Wrote:  The delayStart property is described in this section.

If the network mount is not happening for 20 seconds after boot, you will need to delay MinimServer for longer than this to ensure the network mount is available.

I have an idea about what might be causing the problem you have been seeing. MinimServer has special logic to preserve the cache for a content directory that is empty or not available. However, you are specifying /mnt as the content directory rather than /mnt/netmusic and this has the effect of bypassing this special logic. As a result, it is possible for the mount delay to cause the MinimServer cache for /mnt to be rebuilt with no valid entries for files in /mnt/netmusic. If you change your contentDir setting from /mnt to /mnt/netmusic, this should solve this problem.

That sounds hopefully elegant. I will try that and provoke a power-cut after I've cooked dinner - thanks
Find all posts by this user
Quote this message in a reply
17-11-2019, 15:52
Post: #10
RE: Content loss after power cut
I modified delayStart to 60 and ContentDir to /mnt/netmusic with startupscan to false

I did a reboot on the Pi and it took 5 hours to setup the new library of 10,000 albums. To be expected

I did another reboot of the Pi and it all got running again within 2 minutes

The ultimate test was to provoke a power cut. It was not perfect but after an additional reboot of the Pi it all worked perfectly.

Not exactly smooth sailing but thanks to your help it is now a manageable issue. Thanks again
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)