LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 03: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, 04:05 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
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, 09:25 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,342
Blog Entries: 12

Rep: Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730Reputation: 2730
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, 06: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 03: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 09:37 AM
Restrict download of file of certain size using squid. linuxlover.chaitanya Linux - Server 7 12-06-2008 07:22 PM
To restrict maximum download file size in Squid proxy satishap Linux - Security 3 05-23-2008 03:09 AM
how to restrict max folder size on nfs shares?? j4jaybi Red Hat 1 07-28-2006 01:32 PM
restrict file type & size with vsftpd? zovres Linux - Software 0 06-24-2005 03:23 AM


All times are GMT -5. The time now is 01:00 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