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 07-20-2012, 03:05 AM   #1
mmhs
Member
 
Registered: Oct 2010
Posts: 101

Rep: Reputation: 1
files limit


Hi Guys

how can we limit number of files will be created on a disk ?

e.g, i have a disk with 2 partition how can i limit every partition to allow create only 10 files or directory on each partition ?

thx in advance
 
Old 07-20-2012, 03:43 AM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

I don't know how or if it can be done,
take a look here (I know it's for FAT32 filesystem) and here (NTFS)
Nice table layout of FS.

I hope someone might have some info about Linux FS (ext..), I only found this.

Btw, you could use google yourself.

good luck
 
Old 07-20-2012, 03:49 AM   #3
mmhs
Member
 
Registered: Oct 2010
Posts: 101

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by lithos View Post
Hi,

I don't know how or if it can be done,
take a look here (I know it's for FAT32 filesystem) and here (NTFS)
Nice table layout of FS.

I hope someone might have some info about Linux FS (ext..), I only found this.

Btw, you could use google yourself.

good luck
thx man but my disk file system is ext3
 
Old 07-20-2012, 04:04 AM   #4
hal8000b
Member
 
Registered: Mar 2001
Location: UK
Distribution: Mint 22, Arch, Ubuntu 22.04, Fedora 41
Posts: 195

Rep: Reputation: 23
Quote:
Originally Posted by mmhs View Post
Hi Guys

how can we limit number of files will be created on a disk ?

e.g, i have a disk with 2 partition how can i limit every partition to allow create only 10 files or directory on each partition ?

thx in advance

What do you expect to do by limiting to 10 files on a partition?
This seems to be a very low unusable number.
If this was music or pictures, do you only want to allow 10 tracks or images?

If you only want users to store a small amount of files, then limit the size of their partition,
or their /home partition.
Hope that helps.
 
Old 07-20-2012, 04:08 AM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
I think it can be done by limiting number of inodes on filesystem during creation (option -i and -I in mkfs.ext3) or implementing quotas for inodes for given account or group (for example quotatool on Ubuntu).
 
1 members found this post helpful.
Old 07-20-2012, 08:20 AM   #6
mmhs
Member
 
Registered: Oct 2010
Posts: 101

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by hal8000b View Post
What do you expect to do by limiting to 10 files on a partition?
This seems to be a very low unusable number.
If this was music or pictures, do you only want to allow 10 tracks or images?

If you only want users to store a small amount of files, then limit the size of their partition,
or their /home partition.
Hope that helps.
i have 10 big DB files and i want to reserve all space for them !

i think limiting number of inodes is a good way i think we can do that with mkfs
 
Old 07-20-2012, 03:42 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 6,121

Rep: Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916Reputation: 2916
Or you might exaine the settings...

Have you looked into using the quota system?
I have used it for group, server, and virtual machine quotas, but never for what you are seeking. It might be worth taking a look at.
 
Old 07-23-2012, 03:40 AM   #8
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Quote:
Originally Posted by mmhs View Post
i have 10 big DB files and i want to reserve all space for them
So, no better option would be allowing only acoount associated with database server to create files and disallowing write access for others?
 
  


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
How to limit the total size of core files and automatically clean old core files? sadasreddy Linux - Embedded & Single-board computer 1 05-27-2011 11:51 AM
Apache .htaccess <files> and <limit> nathan2225 Linux - Software 0 10-22-2007 04:59 AM
new maximum open files limit - ignored? brycen Red Hat 1 08-06-2006 08:28 AM
Does samba limit the size of files? aztek Debian 2 06-14-2006 12:53 AM
limit and delete syslog files cccc Debian 9 07-15-2005 06:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:04 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
Open Source Consulting | Domain Registration