Set quota on dir

How can I set a certain quota for a dir say to 1GB. I want to use this dir for storing footage from a security cam.
Thanks

Linux has a quota system that you can install, though it might be overkill for your needs. It’ll also be a bit more complicated if you want to apply the quota to a directory, rather than a whole file system.

Have you considered what to do when the limit is reached?

once the limit is reached the software of the sec cam will overwrite, that’s what the documentation says…

Is this parameter not set by the cam software?

it is but I want to restrict the available space…

Besides using the quota system as indicated above alternative is to create a container file with 1G size and just share that to the Camera.

1 Like

The container file is a good idea. (Wish I’d thought of it :slight_smile: )

Take a look here for an example of how to create one.

omg - this sounds good but a little challenging. I see one issue, for some reason I can’t direct the Reolink FTP dir to any /media/ dir. It always stays in the /home … I’ll tinker around a bit and see how it goes. Thanks!

Sounds like you are using sftp, which you setup via sshd a, and if I remember correctly it’s locked to user home folder in OSMC.

only FTP is supported w/ this cam

ok, are you using the ftp server in MyOSMC->App store, I’ll have a look again at it, had similar issues when I first came to OSMC.

I am using it, yes

Since vsftpd doesn’t allow symlinks there is another solution:

mkdir /home/osmc/camera-storage
mount -o bind /media/path/way/to/your/storage/location /home/osmc/camera-storage none defaults,bind 0 0

This should work if you change the “first path” to your path, and if you want it working after a reboot you can add this in fstab::

sudo nano /etc/fstab

add this line at the bottom:

/media/path/way/to/your/storage/location /home/osmc/camera-storage none defaults,bind 0 0

Same goes here to change the first path to reflect your local path. Close and save the file with the key combination CTRL+x, y, ENTER

You might need to edit /etc/vsftpd.conf to:

sudo nano /etc/vsftpd.conf

add this line at the bottom:

allow_writeable_chroot=YES

Then CTRL+x,y,ENTER

Restart the ftp server and try:

systemctl restart vsftpd

he, thanks - this looks good. Will this also work with the file image container?

Now I’ve never done an Image container, and not read the article you got recommended. But I guess you mount that image file to you filesystem, like /media/cam_container is actually a mount of /path/to/container/file.
If that’s how it works then you should use the /media/cam_container as “first path” in the solution I suggested.

Ok, got something to do now. Will report back – eow

Hmm, I’m gettin sudo mount -o bind /media/extHDD/Cam /home/osmc/Cam none defaults,bind 0 0 mount: bad usage

From the command line, try:

sudo mount -o bind /media/extHDD/Cam /home/osmc/Cam

sorry for the extra info, copy pasted the line from a fstab example

ok, that works – so you’re saying none defaults,bind 0 0 needs to go to the fstab line?