Losing Database on Computer Restart

  • weaver4

    weaver4 - 2011-02-26

    When I start my computer the database is empty.  I will set up MediaTomb with three directories; everything runs great.  But when I restart my system all of my directories and their content is gone.

    I have MediaTomb running on Ubuntu 10.10 and I have all of my content on an external USB drive.  I have Mediatomb running as an service.

    I think the problem may be that the MediaTomb service starts before my Ubuntu System detects my usb drive.  Media Tomb does not see the content so it deletes the entries in the Database; just a guess.

    How do I fix this?

  • weaver4

    weaver4 - 2011-02-26

    I tried running it from my .profile and not as a service.  Same problem.

  • BT

    BT - 2011-02-27

    Have you enabled inotify or timed scan? Inotify scan might remove your files if they are not available when MediaTomb is started.

  • weaver4

    weaver4 - 2011-02-27

    I am using inotify.

    What I finally ended up doing was removing it as a server.  I then wrote a script that would sleep for 60 seconds and then start mediatomb and then added this script to my .profile.

    Here is the script; called mediatombstart

    #! /bin/sh
    echo "Starting MediaTomb"
    # wait for usb drive to be seen
    sleep 60
    # start MediaTomb
    echo "starting Mediatomb" > MediaTombLog.txt

    .profile line (don't forget the & at the end); I put this as the end of my .profile.

    # start media tomb
    mediatombstart &

    There is probably a better way but this seems to work.  Maybe this will help someone else.

  • Jeremy Nickurak

    Jeremy Nickurak - 2012-11-11

    I have my files added by inotify, and lost my database too.

    Any progress on fixing this?

  • Jin

    Jin - 2012-11-11

    Are you sure that your database is located in persistent storage and not on some RAM drive / in a volatile directory?

  • Andreas Pritschet

    This "little" incident happened to me quite recently as well using Xubuntu 14.04 (64bit).

    In my setup mediatomb in the default way as it is shipped with Ubuntu: service run by user mediatomb. Just for fun the database is not located in /etc/mediatomb but somewhere in my home, which is persistant and where the user mediatomb has access (otherwise there would be no database to be lost).
    My setup differs from the initial author by one detail: my media is located on local hard drives that are mounted correctly in /etc/fstab.

    As I have encountered this issue on multiple occasions in the past, but more frequently recently, I'd like to ask whether sending the system to suspend oder hibernate mode (or restoring the system from these modes) might have an influence?

  • Lyall Pearce

    Lyall Pearce - 2015-08-11

    Having your content on a USB drive is the problem.
    Especially with inotify or periodic scan.
    MediaTomb notices the media is not there, and deletes everything until the next timed scan. inotify won't work because the directory is not there to monitor.
    You need to start MediaTomb after the USB drive(s) have mounted or move your media to a permanent disk or turn off notify/scan and rely on manual refreshes.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks