Recommended Posts

I need to limit an nfs share for a particular user to 200 GB.  I created a dedicated username and was trying to find a way to set a quota, but failed in my effort.


Using unRAID server pro 5.0.6 right now.


The reason I need the quota is a firmware bug in my new Hikvision IP camera.  It is allergic to shares over 200 GB.


Could also use SMB, if that is easier.

Link to comment

Are you saying it is impossible even from the command line?  This has been a feature of *nix since before the Carter presidency.

If you are clever enough maybe you can do it from the command line. I don't know. It is not a feature of unRAID. The users defined in the unRAID webGUI can't even login to the command line. They can own files, but can only access them over the network.
Link to comment

If you have a spare drive, you can create a 200GB partition and share with this plugin:

But you would have to be on v6.


Another thing you could probably do along those lines if you're good with Linux. I'm not but I have seen bits and pieces on the forum.


Partition a drive with 200GB and another partition to use the rest of the drive if you wanted. You couldn't use this in the array, but you could probably mount each partition and share them using smb-extra.conf


The mounting would have to be redone on bootup using the go script. Probably got some of this wrong, and can't really help on the details without doing some research myself, so will leave that to you or maybe one of the real experts will chime in.

Link to comment

could you create a share, limited to one disk that had a minimum space free:

eg 1TB disk with minimum space 800GB


Other shares could also use the drive so it isn't wasted space?

(or is this an unpaid 6 only option?)

No that is in v5, but it's the same idea dgaschk had. In the end, any other share using that drive would impact the "quota". In your example, if another share wrote 100GB to the drive, then the disk would have 900GB free, so the "quota" would shrink to 900GB - 800GB = 100GB.


And so on.

Link to comment

The 200GB partition idea should work though.  I don't know how big your Cache drive is, but if it's 500GB or more, you could shrink the first partition by 200, then carve a new one at the end, size 200GB.  It will have to be mounted through the command line only though, and you may have to run reiserfsck on the Cache partition to correct its file system size (not sure).

Link to comment

Having the exact same issues with hikvision cameras and Unraid.

The issue is basically with Hikvision but considering they haven't solved it in years, i doubt much progress will happen there. I've literally found hundreds of user postings on this issue. It's rather appalling Hikvision doesn't seem to care. These are not cheap cameras.


Having "Quota" available in the Unraid build would help a lot already as i would be able to restrict a user/share by quota then.

Link to comment
  • 3 weeks later...

I can confirm that Hikvision IP cameras need quotas.  Their logic is essentially to pre-fill the storage you give them with sparse files... and they fill it up till full.... so you need to set some reasonable quota to stop an entire drive/share from being filled.

Link to comment
  • 2 months later...

Is this likely to work on unRAID?


## Create an image file to your preferred size

fallocate -l 50G /data/security/patio.img


## Format the image file as ext3

mkfs -t ext3 -q /data/security/patio.img -F


##Add the NFS mount to your FSTAB to mount the image at your NFS location (/etc/FSTAB)

/data/security/patio.img /data/security/patio ext3 rw,loop,usrquota,grpquota 0 0


Link to comment

What am I doing wrong?  File size is zero.  Prior to this I stopped the array, unmounted everything, then created a mount point and mounted the drive under /mnt/disk2.

root@tower:/mnt/disk2/cameraBasementStairs# fallocate -l 50G ./cameraBasementStairs.img

root@tower:/mnt/disk2/cameraBasementStairs# ls -lh
total 0
-rw-r--r-- 1 root root 0 2015-08-15 11:36 cameraBasementStairs.img

root@tower:/mnt/disk2/cameraBasementStairs# stat cameraBasementStairs.img 
  File: `cameraBasementStairs.img'
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: 861h/2145d	Inode: 1530        Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-08-15 11:36:35.000000000 -0400
Modify: 2015-08-15 11:36:35.000000000 -0400
Change: 2015-08-15 11:36:35.000000000 -0400

Link to comment
  • 4 weeks later...

Is the disk XFS?



root@rack:/mnt/disk8# ls
root@rack:/mnt/disk8# du -a
0   .
root@rack:/mnt/disk8# fallocate -l 50GB stor.img
root@rack:/mnt/disk8# ls -l
total 48828128
-rw-r--r-- 1 root root 50000000000 Sep 13 12:58 stor.img
root@rack:/mnt/disk8# du -a
48828128   ./stor.img
48828128   .

Link to comment

Is the disk XFS?



It is whatever Unraid Server Pro 5.0.6 defaults to.  The disk it is on is part of the array, if that is what you are asking.


In any case, I ended up creating a 50 Gig file full of zeros using dd.  Then I put an ext3 filesystem in the file.


How would I export that file through NFS?  I have tried mounting it in fstab, and exporting it via NFS in /etc/exports, but somehow fstab gets overwritten when I reboot.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.