May 18, 20242 yr The workaround on how to make Unraid shares with quota. It will work with Hikvision cameras well. 1. Make the directory where you will store .img files for shares. I prefer to do this on cache (/mnt/cache), in the folder "system", to keep access fast. However, you can choose "/mnt/user" if you want, it is "more Unraid way". "cameras" is the name of folder where to store *.img files. Type the command in the terminal: mkdir -p /mnt/cache/system/cameras 2. Create .img files with the size (quota) you want. In my case, it is the 10 GB, but you can type any another size: fallocate -l10g /mnt/cache/system/cameras/51.img fallocate -l10g /mnt/cache/system/cameras/52.img fallocate -l10g /mnt/cache/system/cameras/53.img 3. Make the filesystems in the .imgs. I prefer ext4, but you can choose btrfs if you know why you need it - it will work as well: mkfs.ext4 /mnt/cache/system/cameras/51.img mkfs.ext4 /mnt/cache/system/cameras/52.img mkfs.ext4 /mnt/cache/system/cameras/53.img 4. Go to your Unraid Web GUI, to the tab "Shares". And make required shares, using "Add share" button. Enter your "Share name:", for example, "camera51". "Primary storage (for new files and folders):" - "cache" - actually, it does not matter, but I prefer to set "cache". Press "Add share" button. After creation, go to the section "NFS Security Settings" a bit below and choose "Export:" - "yes". Press Apply. Note 1: Hikvision works better with NFS, however, you can share Samba as well in the "SMB Security Settings" section. Note 2: If you have no NFS section - press "Add share" button, or read this official instruction: https://unraid.net/fr/blog/deploying-an-unraid-nfs-server Repeat this step as much as you made images (in my case I have camera51, camera52, camera53 shares). You should have one "share" for each one .img 5. Mount your .imgs in the corresponding shared folders. Double-check that no errors during the mounts, don't move to the next steps while you do not fix them. Pay attention - your file system (ext4) in mount should correspond to mkfs you did on step 3: mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/51.img /mnt/user/camera51/ mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/52.img /mnt/user/camera52/ mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/53.img /mnt/user/camera53/ It would be better to mount these folders to cache (/mnt/cache/camera51, ...), however, if somebody makes share on the array instead of cache it will not work. So, the "user" is more safe. 6. Add folder mount commands to the start script. Edit /boot/config/go and add to the end: # mount .imgs for cameras (sleep 20 && /sbin/mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/51.img /mnt/user/camera51/) & (sleep 20 && /sbin/mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/52.img /mnt/user/camera52/) & (sleep 20 && /sbin/mount -r -t ext4 -o loop,rw /mnt/cache/system/cameras/53.img /mnt/user/camera53/) & Where "sleep 20" is - wait 20 seconds while the system mounts all necessary drives and services, after which it will mount your .imgs. The "&" at the end sends these tasks to the background and allows the system to continue loading. If your system doesn't mount disks - check "mount" again for errors or try to set a higher number for "sleep", for example, 60. I know that this is not the best solution. Appreciate it if you could suggest better. However, it is work. 7. Optional: reboot Unraid to be sure that everything working properly, and .imgs mounts automatically. Congratulations! That's all. You have made quota shares in Unraid. Only for Hikvision: 8. ext4 makes "/lost+found" folder on the new drive automatically. It is a trouble, because you can't format drive on your Hikvision cameras. Drive must be empty. So delete "/lost+found" folders in each created shares: rmdir /mnt/user/camera51/lost+found rmdir /mnt/user/camera51/lost+found rmdir /mnt/user/camera51/lost+found 9. Assign your nfs drives to the Hikvision cameras, like this: Format drive. If the format fails - try this workaround: go to Unraid WebGUI, "Shares" -> your share. Edit "Minimum free space:", for example, set it to 1GB. Press "Apply'. This forces Unraid to reload share services, including NFS. After this Hikvison camera is able to format a drive, even despite the wrong free size. Yes, it is Hikvision, trouble with network drives existed a dozen+ years ago. Get luck! I would appreciate any improvements you can suggest. Edited May 19, 20242 yr by Nick Kos
August 20, 20241 yr On 9/1/2023 at 1:02 PM, Black_SwanNL said: +1 Storage is always an issue with kids. They don't seem to grasp the fact that "a computer" can get full. I want to allow them acces to my server to write stuff onto it so it will be save. School projects and what not. I've setup the family pc with storage restrictions per account and it works like a charm, basic windows stuff. Only problem with the family pc: no redundancy and not really easy if one wants to remotely acces the files per laptop. So space on the server would be THE option. But with the kids filling up there storage space and having to clean up their storage multiple times a year, I'm not giving them acces to multiple TB of storage. +1
October 28, 20241 yr +1 Would really love to see this implemented. Considering using Unraid for backups, will have to monitor closely.
January 1, 20251 yr +1, very much want to see this feature and I'll go one step further: In addition to being able to enforce a max size for a share, i'd also appreciate the ability to set a max GB of primary storage utilization for that share before it spills over to secondary storage. This would be especially helpful for shares where the mover is set to Array->Cachce for performance reasons, but where I want to control the max amount of data that can be kept on cache on a per-share basis.
January 11, 20251 yr Just putting in my request for this feature too. By default, the ONLY way to do this is to set specific disks for shares, but it's extremely limiting and depends on the size\amount of disks
February 2, 20251 yr +1 it should have been a basic feature for a long time, but it's still missing. Let it happen guys, please!
March 4, 20251 yr +1 As the "IT guy" of the family, this would help me a lot allocating quotas to my family members. It`s not feasible to use a 3.5 ( or 2.5 ) bay / sata connection on order to work around a feature that should be in a nas solution. Edited March 4, 20251 yr by Dasee
April 14, 20251 yr +1 I am actually quite shocked that it's not already been implemented. I can't even think of another NAS product that can't do this...
April 25, 20251 yr On 5/19/2024 at 12:22 AM, Nick Kos said: The workaround on how to make Unraid shares with quota. It will work with Hikvision cameras well. Works great for Hikvision, thank you so much! One thing I have done is used "User Scripts" app from the unraid store and added the mount "At Startup of Array" so it will always mount the drive once the array has started- #!/bin/bash mount -r -t ext4 -o loop,rw /mnt/xxxxxx/cctv.img /mnt/user/cctv/ echo "mounted"
April 25, 20251 yr Community Expert 37 minutes ago, kramwell said: One thing I have done is used "User Scripts" app from the unraid store and added the mount "At Startup of Array" so it will always mount the drive once the array has started- You might want to consider adding a 'logger' command to the script to make sure entries get added to the syslog - it can help with any debugging later when you forget you have this script running
April 25, 20251 yr 6 hours ago, itimpi said: You might want to consider adding a 'logger' command to the script to make sure entries get added to the syslog - it can help with any debugging later when you forget you have this script running great idea! thank you!!
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.