bitmite's picture

I'm running MediaServer on LXC and it's been great, but it seems like the media files aren't getting completely getting deleted when I delete them via a Connected Server in PopOs. Is there somewhere else I should be deleteing these files too? Thanks

Jeremy Davis's picture

Can you explain how you are deleting them? I.e. via what interface? E.g. Webmin, WebDAV-CGI, Jellyfin, SSH, etc. And can you also share why you don't think they're being deleted "properly"?

bitmite's picture

Hey Jemery, I'm deleting them via the PopOs GUI (Connected Server). I don't think they are being deleted properbly because I delete the shows and movies after I watch them, and on the Proxmox UI it now shows almost 75G of 75G the allocated disk space being use, where it should be a lot lower since I don't currently have any movies/tvshows.



Jeremy Davis's picture

Thanks for the extra info, but how are you actually deleting them? You note that you are doing it from a connected server, but how are they connected? E.g. have you mounted the samba share? Or are you mounted the remote filesystem via SSHFS? Or something else? When you delete are you just using commandline (e.g. 'rm /path/to/file') or something else?

As to what is taking up your space, have you double checked to see whether the Promox UI is right? I suggest that you check within the container itself. SSH in and run this:

df -h

Or if you want to interactively look what is taking up the space, install ncdu like this:

apt update
apt install -y ncdu

Then scan the whole filesystem like this:

ncdu /

(It will take a little while initially to scan the whole filesystem).

bitmite's picture

It's connected to the Samba share.

ncdu defenitely helped, thanks! I can now see the deleted files are located here: /srv/storage/.recycle

Is this somthing I could disable, or do I have to delete the files on the MediaServer SSH?


Jeremy Davis's picture

There are a number of options.

Cron job to clean recycle

If you are ok with the recycle "bin" functionality but want to ensure that files are auto cleaned up, you could create a cron job. I.e. to clean up "recycle" files once a week:

apt update
DEBIAN_FRONTEND=noninteractive apt-get install -y tmpreaper
cat > /etc/cron.daily/samba-empty-recycle 

Disable Samba recycle

Alternatively, if you wanted to disable the Samba recycle functionality altogether, comment out (i.e. insert a '#' before commands) these lines in /etc/samba/samba.conf:

    vfs object = recycle
    recycle:touch = yes
    recycle:keeptree = yes
    recycle:versions = yes
    recycle:exclude_dir = tmp quarantine

So that it looks like this:

#    vfs object = recycle
#    recycle:touch = yes
#    recycle:keeptree = yes
#    recycle:versions = yes
#    recycle:exclude_dir = tmp quarantine

Or here is a command that will do it for you:

sed -i "\|recycle| s|^#*|#|" /etc/samba/samba.conf

Finally, restart Samba to apply the updated config:

systemctl restart smbd.service nmbd.service

Mount via alternate method

Another option would be to use an alternate method to access the files from your PopOS system. Seeing as you are sharing files between Linux machines, using a Windows network filesystem could be considered sub-optimal.

You could use NFS. TBH, I don't use it, so aren't super familiar with it, but it shouldn't be too hard to use.

Another option (my personal preference) is SSHFS. You don't need to install anything on the TurnKey server. On your PopOS system, install the client:

apt update
apt install -y sshfs

Then to mount /srv/storage from your TurnKey mediaserver (as root; probably not ideal - you could use an alternate account):

mkdir /media/remote-storage
sshfs /media/remote-storage
bitmite's picture

Thanks Jeremy!

Add new comment