Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-30-2003, 05:24 AM   #1
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
limiting the size of a directory

How to limit the size of a directory
Old 06-30-2003, 05:35 AM   #2
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
man quota


Create a partition, the size you want to limit this directory to, then mount your new partition on that mount point.

For example, you want /home to not exceed 4GB, so create/resize your root partition using something like:
And then after the new partition is created:
mount -t ext3 /dev/hdx /home

You will of course need to copy everything over first, so I suggest:
mount -t ext3 /dev/hdx /mnt/temp
cp -a /home /mnt/temp
And finally:
umount /mnt/temp
telinit 1
rm -r /home (be ultra sure you want this, and be VERY VERY careful... I don't suggest this way FYI)
mount -t ext3 /dev/hdx /home
If it works, make changes to /etc/fstab:
/dev/hdx /home ext3 defaults 1 1
And finally:
telinit 3 (or 5 depending on your needs, again, if you understand this, go ahead, but BE very careful, if you don't understand it, don't do it use quotes instead as it's more 'proper' for your needs most likely).


Last edited by MasterC; 06-30-2003 at 05:37 AM.


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
limiting the size of emails that can be sent with sendmail nazzymac Linux - Networking 3 10-30-2003 01:45 PM
Limiting the size of a log file ganninu Linux - General 1 09-18-2003 08:23 AM
Limiting local users to their home directory. beatlelane Linux - Security 4 09-08-2003 12:00 AM
Limiting Access_log Size John Webb Linux - General 2 07-24-2003 07:06 PM
limiting the size of each directory sophie Linux - Newbie 1 07-24-2003 11:49 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:58 PM.

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