Files seem to be saving to wrong storage device (LUKS)

  • I couldn't login to my web interface and upon further inspection I found out it was because my root drive is full.

    I think this is because my files are being save to the wrong storage device even tough they are being saved to "/srv/dev-disk-by-label-OMV"

    My drive is LUKS encrypted and I'm using the encryption plugin


    Below is some bash output that should be useful

    My file system: https://pastebin.com/Y2Qu486m

    Filtered to min of 1G: https://pastebin.com/iizr7Rzm with deeper indexation

    Output of:



    Thank you all for taking a look

  • KM0201

    Hat das Thema freigeschaltet.
  • This problem usually involves two possibilities:


    1) Some type of device is mounted to srv/dev-disk-by-label-OMV and the files are written to the mounted device.


    2) There is no device mounted to srv/dev-disk-by-label-OMV and the files are written to the mountpoint directory, filling up the rootfs.


    You need to be sure that some device is in fact mounted there before writing there.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 7.x on headless Chenbro NR12000 1U 1x 8m Quad Core E3-1220 3.1GHz 32GB ECC RAM.

    • Offizieller Beitrag

    If you use du with the -x option it will not evaluate directories in other file systems. So in case of 1) it should show very small size for /srv and in case of 2) it should show a very large size.


    But it could be that this is not working, if the device was not mounted during copying and has been mounted since then.

  • Thank you both for the replies

    This is indeed what I figured be the case sometimes I reboot the device and I have to remount the enrypted partition, but I have some docker containers(/auto backups) that really like writing files to the filesystem so they'll end up on the on the wrong device.

    If you use du with the -x option it will not evaluate directories in other file systems. So in case of 1) it should show very small size for /srv and in case of 2) it should show a very large size.


    But it could be that this is not working, if the device was not mounted during copying and has been mounted since then.

    Sadly the case seems to be the latter but it is good to know I assesed the problem right.

    sudo du / -h --max-depth=1 -x

    1.7M /srv

    6.5G /var

    4.0K /mnt

    7.2M /etc

    4.0K /export

    1.7G /usr

    482M /portainer

    160K /home

    16K /lost+found

    4.0K /media

    41M /opt

    4.0K /sharedfolders

    48K /root

    8.6G /



    Any clue how to create a bash script to copy all the files to the right device with the same path?

    My search engine skills as of the moment don't seem to be able to locate me a way to check if a file exists on the root file system or another one.

    I figure attaching another external storage device and rsyncing then deleting and syncing back should do it but i'd obviously preffer a solution that i could setup as a cron job and just run once a month.

    As i'm planning to deploy one of these at my mothers house to have off site backups.

  • For now i fixed it by moving all my files to another hdd and then moving them back, leaving this here for the search engine surfers

    Code
    rsync -r /srv/full-device-name /mnt/media/
    rm -rf /srv/full-device-name
    rsync -r /mnt/media /srv/full-device-name

    If anyone has a more permanent solution please let me know as this is bound to happen again, and this is far for ideal

    • Offizieller Beitrag

    Not sure what you want to achieve. Is the target a two-way-sync?


    If so, have a look at unison. It has a GUI, but can also run from CLI


    unison -batch -ui text folder1 folder2

Jetzt mitmachen!

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