LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2011, 02:16 AM   #1
hk_centos
LQ Newbie
 
Registered: Jun 2011
Posts: 22

Rep: Reputation: Disabled
how to restrict directory size ?


HI ALL,


I need to know how to limit directory size.

As example,
I have directory in /root called as "shared". i already shared this directory using NFS. i want to limit this directory size into 20 GB (20*1024*1024). That means "shared" directory reserved 20 GB disk space from the HDD.

how can i solve this problem ?,

Someone told me about disk quota. I don't hv a knowledge to apply this into my problem...

Regards,
HK
 
Old 08-05-2011, 03:05 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Easiest way: put it on a 20G partition by itself.

Different way: implement group quotas, make sure
the dir in question has sticky groups all the way
through and implement a quota on the group.


Cheers,
Tink
 
Old 08-05-2011, 08:25 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 12,152
Blog Entries: 14

Rep: Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081Reputation: 3081
Using quotas is the best way.

Here's a good intro to quotas.

http://www.yolinux.com/TUTORIALS/Lin...ialQuotas.html
 
Old 08-09-2011, 05:42 AM   #4
salemeni
Member
 
Registered: Aug 2011
Posts: 64

Rep: Reputation: Disabled
Post

Hi
Try to write a script to check size of this directory and modify acces rights.


to get size
du -h --max-depth=0 directroy/ |cut -f1

generics array

Last edited by salemeni; 12-06-2011 at 02:54 AM.
 
0 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to restrict the perl array maximum size? ashok.g Programming 7 02-09-2010 08:37 AM
Restrict download of file of certain size using squid. linuxlover.chaitanya Linux - Server 7 12-06-2008 06:22 PM
To restrict maximum download file size in Squid proxy satishap Linux - Security 3 05-23-2008 02:09 AM
how to restrict max folder size on nfs shares?? j4jaybi Red Hat 1 07-28-2006 12:32 PM
restrict file type & size with vsftpd? zovres Linux - Software 0 06-24-2005 02:23 AM


All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration