Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Maximun number of files per directory!!!!!

  1. #1

    Default Maximun number of files per directory!!!!!

    Dear all,
    I would like to ask you if there is any maximum allowed number of files per folder in linux (without risking it to lose everything).
    I am using openuse 11.4 with latest kde (4.6?).

    I am trying something fast and dirty and it might be that one folder will contain like 10^6 files.

    Is there is anything I should be warned about that? Of course filesystem security is still the most important.

    Best Regards
    Alex

  2. #2
    Join Date
    Jun 2008
    Location
    Berlin
    Posts
    2,061

    Default Re: Maximun number of files per directory!!!!!

    Ext4 - Linux Kernel Newbies

    2.3. Sub directory scalability

    Right now the maximum possible number of sub directories contained in a single directory in Ext3 is 32000. Ext4 breaks that limit and allows a unlimited number of sub directories.
    Edit: I assume that means the maximum number of files per directory is unlimited too.

  3. #3
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: Maximun number of files per directory!!!!!

    On 04/28/2011 02:36 PM, alaios wrote:
    >
    > Dear all,
    > I would like to ask you if there is any maximum allowed number of files
    > per folder in linux (without risking it to lose everything).


    there is no risk if you have all of your data backed up to an off
    machine location, right?

    how many? discover google:http://tinyurl.com/3wzbgdd

    Have a lot of fun!

    --
    CAVEAT: http://is.gd/bpoMD
    [openSUSE 11.3 + KDE4.5.5 + Thunderbird3.1.8 via NNTP]
    HACK Everything -> http://www.youtube.com/watch?v=j5b4CCe9pS8&NR=1

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Maximun number of files per directory!!!!!

    Actually you don't risk data loss. The mkdir syscall will just fail when the limit is reached. Unless you're ignoring the error return from the call.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Maximun number of files per directory!!!!!

    On 2011-04-28 14:36, alaios wrote:
    >
    > Dear all,
    > I would like to ask you if there is any maximum allowed number of files
    > per folder in linux (without risking it to lose everything).


    It depends on what filesystem you use.

    > I am trying something fast and dirty and it might be that one folder
    > will contain like 10^6 files.


    No problem.

    > Is there is anything I should be warned about that? Of course
    > filesystem security is still the most important.


    Some filesystem types are faster than others in that situation. Reiserfs is
    the best, xfs follows - IMO. But R is in the decline.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,118

    Default Re: Maximun number of files per directory!!!!!

    And it may of course depend on the type of the file system. The others assume Ext4, which might be what you have there, but you fail to tell (and there are allways people who think that non Linux file systems behave exectly the same as Linux native ones).
    Henk van Velden

  7. #7

    Default Re: Maximun number of files per directory!!!!!

    ext4 ofc

  8. #8
    Join Date
    Jun 2008
    Location
    Berlin
    Posts
    2,061

    Default Re: Maximun number of files per directory!!!!!

    Quote Originally Posted by alaios
    ext4 ofc
    Then just go ahead and have a lot of fun. :-)

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,118

    Default Re: Maximun number of files per directory!!!!!

    Quote Originally Posted by alaios View Post
    ext4 ofc
    When you have been longer on the forums, you would know nothing is "of course"

    I have seen here people with problems who only after 10 or more posts revealed that they where having this on a FAT file system, which explained everything.
    Henk van Velden

  10. #10

    Default Re: Maximun number of files per directory!!!!!

    Quote Originally Posted by hcvv View Post
    When you have been longer on the forums, you would know nothing is "of course"

    I have seen here people with problems who only after 10 or more posts revealed that they where having this on a FAT file system, which explained everything.
    of course you are right
    Cheers
    Alex

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •