LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   files limit (https://www.linuxquestions.org/questions/linux-newbie-8/files-limit-4175417745/)

mmhs 07-20-2012 03:05 AM

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

lithos 07-20-2012 03:43 AM

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

mmhs 07-20-2012 03:49 AM

Quote:

Originally Posted by lithos (Post 4733503)
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

hal8000b 07-20-2012 04:04 AM

Quote:

Originally Posted by mmhs (Post 4733473)
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.

eSelix 07-20-2012 04:08 AM

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).

mmhs 07-20-2012 08:20 AM

Quote:

Originally Posted by hal8000b (Post 4733521)
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

wpeckham 07-20-2012 03:42 PM

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.

eSelix 07-23-2012 03:40 AM

Quote:

Originally Posted by mmhs (Post 4733685)
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?


All times are GMT -5. The time now is 02:07 AM.