Proper way to handle removable drives

Issue #820 resolved
Petr Nejedly repo owner created an issue

Currently removable drives are not supported in a useable way. Here is the proposal to fix it (more at http://forum.serviio.org/viewtopic.php?f=8&t=17794&p=95510#p95499)

  • On initial scan (or forced refresh scan) we will skip folders that are not available at the time (check the folder root path)
  • we will not start delta scan for the missing folders either
  • we do not the "Keep the folder updated" flag anymore
  • we should check in background for the missing folders (if there are any) to become available again, at which time we will run manual scan (for that folder only) and register the folder with delta scan processors; this check will only happen if automatic updates are on.

Comments (11)

  1. Former user Account Deleted

    It would be inconsistent to do an initial scan on available folders at startup even if automatic updates are off, but not do the same when an unavailable folder becomes available when automatic updates are on. I would expect to plugin a removable drive at any time and have the contents available to me even if I do not want the drives folders updated for changes after plugin.

    I believe the last line should read: •we should check in background for the missing folders (if there are any) to become available again, at which time we will run manual scan (for that folder only) and if automatic updates are on, also register the folder with delta scan processors.

  2. Petr Nejedly reporter

    The problem is that the file system poking (checks) will most likely prevent NASes from spinning off the drives / going to sleep. There are people with these setups, and they normally achieve disk spin-off by disabling automatic updates.

    Btw, Serviio will not do the initial scan when automatic updates are off anyway (it'll only do that if there is a DB update with a new version or the first time the folder is added (at which point the drive is presumably attached))

  3. Former user Account Deleted

    Now I'm confused. The problem we are trying to fix, is that, when "global auto-updates" are on, at Serviio start-up, previously scanned shared folders that are then "unavailable", have their library contents deleted by an "initial scan" even if the "update icon" is "off". The simple solution is to honor the "update icon", and only do any type of scan if it is on. The alternative solution proposed was to replace the icon with a drive availability check which would enable/disable updates. Given the spin down problem that requires "global auto-updates" to be off (and prevents internal drives from being updated, which is the primary goal) that alternative is negated.

    The reported associated problem (See http://forum.serviio.org/viewtopic.php?f=8&t=17794#p95338) is that attached drives that are slow to start up, may be identified as "unavailable" requiring forced updates after start-up. My attached Seagate drive sleeps after being idle for a few minutes, but I have not had that problem so I don't understand the problem or know enough to propose a solution, but if your "check" solution will wake up a drive perhaps that or a delay will work.

  4. Petr Nejedly reporter

    This ticket will make sure that:

    • when global updates are on:
      • we don't remove any data for drives that are currently not available (disconnected, slow start)
      • we will do a check for the drive later availability and run the scan when it's available
    • when global updates are off:
      • we don't do any initial scan (unless there is DB update via installer)
      • we don't check for drives to become available (the next manual scan will check for the drive availability then and there)
      • this basically doesn't change anything to the users in the "global updates off" scenario, as they have to Force refresh to get updates

    Does this cover it?

  5. Former user Account Deleted

    Isn't that the same as the original solution before you added " this check will only happen if automatic updates are on." ?

    Giving this some thought, is there not some way of determining if an update would remove all the contents of a shared folder and in that case disable the update? Seems to me that you currently check a folder for its files, so why not do that in 2 steps and if the check finds no files are present in a folder at startup, assume it is disconnected and do not delete them in the second step. That would eliminate all need to check availability, and would leave the last file set registered for any unavailable drive until it is removed from the shared folder list.

  6. Petr Nejedly reporter

    That is too difficult to implement. I've finished this original suggestion, so let's see how it performs in the next beta.

  7. Former user Account Deleted

    OK.
    So to confirm, 1. if I set global update on, will all attached drives update, and any unattached update when they are attached ? 2. will sleeping drives will be kept awake by the check? 3. if an attached drive doing delta scan is detached, will that be seen by the check so its contents will be retained in the library? Hopefully yes,no,yes?

  8. Log in to comment