October 8, 200916 yr All, Is there a way to limit the size of a share? Say I create one called /stuff can I limit it to a size of say 5 gigs, but I still wanted this share's data spread across all the drives in my array. Thanks for your help
October 8, 200916 yr All, Is there a way to limit the size of a share? Say I create one called /stuff can I limit it to a size of say 5 gigs, but I still wanted this share's data spread across all the drives in my array. Thanks for your help There is no way to use all drives, yet limit the size of data put on a user share. My idea would be to limit the user share to specific drives of a specific size via the include field. 5 drives of 1GB each in the include field.
October 8, 200916 yr Author Yup, that's exactly what I have now, i just have share called /stuff that I have just included 1 single drive thats 1tb. But I really only wanted it limited to about 500gig but spread across multiple drives. Oh well, that would be a great feature though!
October 8, 200916 yr How about creating a 5 Gig iso image and mounting it as a loopback and sharing it via samba? Like Joe L.'s new plugin for unMENU does? http://lime-technology.com/forum/index.php?topic=2595.msg39653#msg39653 Would that work? Cheers, Matt
October 8, 200916 yr How about creating a 5 Gig iso image and mounting it as a loopback and sharing it via samba? Like Joe L.'s new plugin for unMENU does? http://lime-technology.com/forum/index.php?topic=2595.msg39653#msg39653 Would that work? Cheers, Matt That will certainly work, but it will not be split across several disks as originally requested.
October 8, 200916 yr That will certainly work, but it will not be split across several disks as originally requested. Oops, I was reading his most recent post about having a 1tb drive and wanting to limit the share to 500 gigs. I missed that he still wanted it across multiple drives. my next question would be: Is there a particular reason why the share needs to be on separate disks? Could you re-organiza data on the array such that the 500 gigs could be utilized off a single disk using a loopback file, instead of across multiple? Cheers, Matt
October 8, 200916 yr If it is sufficient to all be on one disk, you could try something like this (I'm using /mnt/disk1 as the host disk for the file, but it could be any disk.) Step 1. create a mount point (an empty directory). To make things easy, this could be an empty /stuff folder on one of your disks. It is already a user-share, so it will be visible on the LAN. If this folder is not already a user share, configure it now. You want to see it on the LAN before continuing. mkdir /mnt/disk1/stuff Step 2. Create a file on the disk to hold the "restricted space-file-system" This only needs to be done once. It will take quite a while to run. You can go to a different telnet session and type "ls -l /mnt/disk1/res_space.img" to watch it as it grows. dd if=/dev/zero of=/mnt/disk1/res_space.img bs=1M count=500000 Step 3. Set up a loop device to be able to access the file as if it was a block device. (If you are already using /dev/loop0, use /dev/loop1 instead) losetup /dev/loop0 /mnt/disk1/res_space.img Step 4. Create a reiser file system on the new loop device. This will create a file-system in the file you created. Answer "y" when prompted. mkreiserfs /dev/loop0 Step 5. Mount the file-system on the mount point mount -t reiserfs -o noatime,nodiratime /dev/loop0 /mnt/disk1/stuff At this point, you are done. You should see the /stuff share on the LAN, and it will hold at most 500Gig of stuff. Now... the tricky part. If you attempt to stop the array, disk1 will be busy, unable to be un-mounted, and ALL YOUR OTHER DISKS will show as UNFORMATTED. Do not panic. Before attempting to stop the array, you must un-mount the file system and take down the loop. umount /mnt/disk1/stuff losetup -d /dev/loop0 Once those steps are done you can stop the array cleanly. If you forget, just log in and perform those steps, then press "Stop" once more. The array should then stop. What ever you do, do not press the "Format" button when all your disks are showing as un-formatted. You will hate yourself in the morning when you think back at how you specifically asked all your data be erased by re-formatting all your disks. You have been warned... The next time you start the array, you will need to only type losetup /dev/loop0 /mnt/disk1/res_space.img and mount -t reiserfs -o noatime,nodiratime /dev/loop0 /mnt/disk1/stuff to get it back, because the res_space.img file will already be there, and already have a file-system in it, and the mount point directory already will exist. Joe L.
October 8, 200916 yr Another option that is a bit more involved but more flexible is to enable user accounts and quotas in the general Linux way.
October 8, 200916 yr Another option that is a bit more involved but more flexible is to enable user accounts and quotas in the general Linux way. You are correct... it is a "bit more involved." I'm not 100% sure, but I think that implementing "quotas" has to involve a rebuild of a custom kernel, since "Quotas" are not enabled in the kernel in the .config file distributed with unRAID. You would also need to install the "quota" management software package, as it is not included in unRAID either. Certainly possible, but not with a few commands typed at the Linux prompt. Joe L.
October 8, 200916 yr You mean everyone doesn't run on a full slackware install with customized kernels?
October 8, 200916 yr Far easier to just limit it to 1 500GB disk. Can't see the reason to spread 500GB of data onto multiple disks, yet limit it to only 500GB of data. Second to the single disk.. is quotas. Sounds like it quotas might be want is wanted if there is a family and common area's shared. I would like to know the reason for this kind of request.
October 9, 200916 yr Author Ok, so I won't be going through all of that to get it done, but never the less thank you Joe for that work around! Quotas would almost be the way to go here. As for my reasoning The only purpose for having it spread across multiple disk is to limit my losses if more than 1 disk failed at one time(or before i had a chance to replace 1 failed drive) The main reason is I want to have higher density disk in my system, bays are limited. But I would like to have specialized shares for specific purposes and keep those share sizes in check so they dont utilize all my space. Beside general user quota like behavior. Take Apple Time machine as an example, it will try and use all available space to store backups. If my system is composed of a bunch of 4 tb drives(exaggeration) . I don't want to dedicate a whole 4tb drive to backups, 1 TB would work just fine. My guess to implement this logic you would put it in the same code tree where you are doing the user share data layout (High water mark, min free space,etc..). I could also see the problem of not doing a strict enforcement of a rule like this to preserve efficiency. But that would be OK. Ex.. if within a single copy operation you send multiple files/directories of total size 5gig to a share that has a limit of 10 gigs but already has 8 gigs in it, the copy operation would succeed. BUT now the share is full and no more writes can apply.. Well now my mind is going and thinking about all sorts of issues,but possible solutions to the problems and I just finished doing all that the office so i need a break
October 9, 200916 yr The only purpose for having it spread across multiple disk is to limit my losses if more than 1 disk failed at one time(or before i had a chance to replace 1 failed drive) One advantage of unRAID over other RAID solutions that is perhaps not highlighted enough is the fact that unRAID data drives are each an independent file system. There are a number of different drive failure scenarios, some more serious than others. Some we would call catastrophic, a head crash or a failure to spin up, and all is lost. But in other failures, and I think much more commonly, there is usually still some access to the drive. When a traditional RAID drive fails, no matter what the failure type, the entire contents are considered lost (at least in our market, where data recovery companies are not really feasible). But with unRAID drives, EVEN if the drive is considered failed, the chances are very good that most or much of the data is still fully accessible, and that makes a huge difference. We can't guarantee that unRAID drives won't have catastrophic failures, but catastrophic losses are much less likely. The other point I would like to make is, if the data is really important, then you really should be backing it up elsewhere. Splitting the data across multiple drives may provide a small comfort in limiting data loss, but is only protective against a drive failure scenario, and won't help you at all if the computer is stolen, burned up, buried or crushed in an earthquake, vandalized with a bat, etc.
October 9, 200916 yr f within a single copy operation you send multiple files/directories of total size 5gig to a share that has a limit of 10 gigs but already has 8 gigs in it, the copy operation would succeed. BUT now the share is full and no more writes can apply.. Seems like quotas are the way to go or keep a spare drive in house.
Archived
This topic is now archived and is closed to further replies.