How would I limit user storage space?

Saicho

Member
Jan 29, 2008
90
0
0
I'm using this system as a fileserver with Samba on it. I've set up Samba users that I think are tied with user accounts on the actual system. At the moment, the respective home directories are used for the Samba mounting point. Everything works great.

However, I would like to limit the amount of storage available for the users. Is there a way to do this?

There is another thing I would like to do in the long term. I'm using mdadm and have a partitioned raid array. Is there a way to mount /home to the raid array (even my superuser's home) and have it be completely transparent to the users, AND still be able to impose storage limits?

Thanks in advance!

-Saicho
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Filesystem quotas are what you're looking for although I've never actually used them with Samba.

There is another thing I would like to do in the long term. I'm using mdadm and have a partitioned raid array. Is there a way to mount /home to the raid array (even my superuser's home) and have it be completely transparent to the users, AND still be able to impose storage limits?

root's home should always stay at /root and it's not like you should be using it for anything but limited administrative task anyway so there's no reason to f' with that.

But you can mount any partition of the array that you want to /home and no one will be the wiser unless they look at df or mount output. But filesystem quotas are per-filesystem so if you setup quotas on whatever filesystem holds /home and the array they'll be calculated separately.
 

Saicho

Member
Jan 29, 2008
90
0
0
Great!

This should serve my purposes then:

1. Create an array and setup a filesystem at /dev/mda or whatever using mdadm.
2. Mount /home to /dev/mda
3. Enable usrquota on /home
4. Setup quotas for the users
5. Set their home directories to use with Samba

This way, when the users mount their Samba shares on Windows, the files will be created and owned by them, thus utilizing the quota system as well, correct?

Will the users be able to see information about their used/free space?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
That should be about right, you'll have to migrate anything in /home to the new array before mounting over top of it but that's about it. And I believe that Samba will show the amount of quota left instead of the total filesystem free, but I don't know for sure.
 

Saicho

Member
Jan 29, 2008
90
0
0
Thanks for the help! When I set this up I'll let you know if Samba is smart enough =)
 

Saicho

Member
Jan 29, 2008
90
0
0
Yep, Samba is smart enough to report the quota left instead of the total filesystem free! yay