rootfs full after rsync to 'sleeping' USB device?

  • Hello,


    I am pretty new to OMV (had QNAP for years) and I am still in 'experiencing and testing' mode.


    Today I ran into a full rootfs after starting rsync to backup some data on an USB external HDD which is connected all the time to the NAS and mounted to /srv/dev-disk-by-label-backup/.
    The command executed was: /usr/bin/rsync -av /srv/dev.../media/ /srv/dev-disk-by-label/media/


    I found out that although the external USB drive was never removed from the NAS it seems to be unmounted or in some sort of an unknown state probably due to automatic spindown. It does not show up in the WebIF Drives section and I have to click on the 'Search' button to make it reappear.


    My questions are: How can I prevent such a behaviour (accidently backing up data to the rootfs because of a 'sleeping' device) and how could that even happen? Shouldn't the drive reappear automatically if a process is trying to accessing it?


    Thank you in advance


    Regards
    Michael

  • I see several ways:


    - what makes the mount disappear? find the root of this and a remedy
    - use rsnapshot (a sophisticated script with exceptions, generations, ...) it does not start without the proper path mounted
    - write a batchfile that checks for an item e.g. a directory that you know must exist on your drive and do not start if the check fails
    - look into automount (overkill IMO)


    btw. if I use rsync for backup I use the "--delete" option

    • Offizieller Beitrag

    You need to check that the drive is mounted before you start transferring files to it. Perhaps in the script that runs the rsync commands to do the backups.


    Some quick googling gave this method:


    if grep -qs '/mnt/foo ' /proc/mounts; then
    echo "It's mounted."
    else
    echo "It's not mounted."
    fi


    USB is great for attended backups to removable media. When you can check that the drive is mounted before the backup starts. But I would never use it for unattended backups. If there is a problem you crash the root filesystem. USB is convenient but not reliable.

    Be smart - be lazy. Clone your rootfs.
    OMV 5: 9 x Odroid HC2 + 1 x Odroid HC1 + 1 x Raspberry Pi 4

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!