Maximum number of directories
Hi all,
What is the maximum number of directories ext4 can hold in a tree layout with a depth of ~160 and each directory node having then a couple to couple dozen subdirectories?
I was creating such a (crazy?) tree and hit -ENOSPC at ~31 million directories created in total with df showing only 40% use:
Filesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/data 477277612K 177766152K 275621952K 40% /data
Some lines from tune2fs made me think it should hold more, but obviously I was mistaken? Or it is a bug?
Inode count: 29868032 Free inodes: 29848131
Regards,
Tvrtko
Hi,
Quoted 5 lines · Tvrtko Ursulin
I was creating such a (crazy?) tree and hit
-ENOSPCat ~31 million directories created in total with df showing only 40% use:Inode count: 29868032 Free inodes: 29848131
Since, each directory will use a inode entry, there is some mismatch with ~31 million directories and 19901 inodes in use. The inode usage count should be much larger. You have max 29 million inodes available
- so max can be 29 million directories.
Try $blk
Regards.
Quoted 8 lines · On Monday 04 February 2013 18:49:54 Prashant Shah wrote:
Hi,
On Mon, Feb 4, 2013 at 4:25 PM, Tvrtko Ursulin
Quoted 3 lines · <[email protected]> wrote:
I was creating such a (crazy?) tree and hit
-ENOSPCat ~31 million directories created in total with df showing only 40% use:
Quoted 7 lines
Quoted 2 lines
Inode count: 29868032 Free inodes: 29848131Since, each directory will use a inode entry, there is some mismatch with ~31 million directories and 19901 inodes in use. The inode usage count should be much larger. You have max 29 million inodes available
- so max can be 29 million directories.
Yeah, I totally forgot about the inode situation on ext filesystems. So is tune2fs giving wrong stats for live (mounted) filesystems?
Quoted 1 line
Try $blk
What is that?
Thanks,
Tvrtko
Hi,
Quoted 3 lines · Tvrtko Ursulin
Quoted 1 line
Try $blk
What is that?
Typo :)
Regards.
Quoted 18 lines · Tvrtko Ursulin
Date: Mon, 04 Feb 2013 13:36:29 +0000
From: Tvrtko Ursulin <[email protected]>
To: Prashant Shah <[email protected]>
Cc: [email protected]
Subject: Re: Maximum number of directoriesQuoted 11 lines · On Monday 04 February 2013 18:49:54 Prashant Shah wrote:
Hi,
On Mon, Feb 4, 2013 at 4:25 PM, Tvrtko Ursulin
Quoted 5 lines · <[email protected]> wrote:
I was creating such a (crazy?) tree and hit
-ENOSPCat ~31 million directories created in total with df showing only 40% use:Inode count: 29868032 Free inodes: 29848131
Quoted 7 lines
Quoted 4 lines
Since, each directory will use a inode entry, there is some mismatch with ~31 million directories and 19901 inodes in use. The inode usage count should be much larger. You have max 29 million inodes available
- so max can be 29 million directories.Yeah, I totally forgot about the inode situation on ext filesystems. So is tune2fs giving wrong stats for live (mounted) filesystems?
Not sure what situation you're referring to. Directory as any other file is represented by an inode and there is a limited number of inodes in the file system.
Using tune2fs on live/mounted file system is bad idea and the information might not be correct (exactly for this reason it is _NOT_ recommended to run fsck on live file system). Use 'df -i' if you want to get information about inode count.
And to answer your previous question, yes the number of directory entries is limited. The number depends on the size of the directory entries (the name of the file) and the size of the file system block. From my calculation on 4k file system it can hold 3870945 files with 255B long filenames in the single directory in the ideal case, please correct me if I am wrong.
Unfortunately the problem might appear as the directory hash tree gets more fragmented which will limit the number of directory entries it can hold - this can be fixed with e2fsck -D.
Thanks!
-Lukas
Hi,
Quoted 24 lines · On Tuesday 05 February 2013 14:06:14 Lukáš Czerner wrote:
Quoted 23 lines · Tvrtko Ursulin
Date: Mon, 04 Feb 2013 13:36:29 +0000
From: Tvrtko Ursulin <[email protected]>
To: Prashant Shah <[email protected]>
Cc: [email protected]
Subject: Re: Maximum number of directoriesQuoted 15 lines · On Monday 04 February 2013 18:49:54 Prashant Shah wrote:
Hi,
On Mon, Feb 4, 2013 at 4:25 PM, Tvrtko Ursulin
Quoted 5 lines · <[email protected]> wrote:
I was creating such a (crazy?) tree and hit
-ENOSPCat ~31 million directories created in total with df showing only 40% use:Inode count: 29868032 Free inodes: 29848131Since, each directory will use a inode entry, there is some mismatch with ~31 million directories and 19901 inodes in use. The inode usage count should be much larger. You have max 29 million inodes available
- so max can be 29 million directories.
Quoted 6 lines
Quoted 2 lines
Yeah, I totally forgot about the inode situation on ext filesystems. So is tune2fs giving wrong stats for live (mounted) filesystems?
Not sure what situation you're referring to. Directory as any other file is represented by an inode and there is a limited number of inodes in the file system.
The situation that inode blocks are statically allocated at mkfs time.
Quoted 4 lines
Using tune2fs on live/mounted file system is bad idea and the information might not be correct (exactly for this reason it is _NOT_ recommended to run fsck on live file system). Use 'df -i' if you want to get information about inode count.
Yes, later I figured out that tune2fs -l does not give current stats for live filesystems. I did not expect that to be dangerous though. And I also forgot about 'df -i'. Thing is, I did not hit this limit since the previous century so guess I subconsciously assumed inode limits are an outdated concept. :)
Regards,
Tvrtko
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 34 lines · Tvrtko Ursulin
Date: Tue, 05 Feb 2013 14:30:24 +0000
From: Tvrtko Ursulin <[email protected]>
To: Lukáš Czerner <[email protected]>
Cc: Prashant Shah <[email protected]>, [email protected]
Subject: Re: Maximum number of directoriesHi,
Quoted 24 lines · On Tuesday 05 February 2013 14:06:14 Lukáš Czerner wrote:
Quoted 23 lines · Tvrtko Ursulin
Date: Mon, 04 Feb 2013 13:36:29 +0000
From: Tvrtko Ursulin <[email protected]>
To: Prashant Shah <[email protected]>
Cc: [email protected]
Subject: Re: Maximum number of directoriesQuoted 15 lines · On Monday 04 February 2013 18:49:54 Prashant Shah wrote:
Hi,
On Mon, Feb 4, 2013 at 4:25 PM, Tvrtko Ursulin
Quoted 5 lines · <[email protected]> wrote:
I was creating such a (crazy?) tree and hit
-ENOSPCat ~31 million directories created in total with df showing only 40% use:Inode count: 29868032 Free inodes: 29848131Since, each directory will use a inode entry, there is some mismatch with ~31 million directories and 19901 inodes in use. The inode usage count should be much larger. You have max 29 million inodes available
- so max can be 29 million directories.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Yeah, I totally forgot about the inode situation on ext filesystems. So is tune2fs giving wrong stats for live (mounted) filesystems?
Not sure what situation you're referring to. Directory as any other file is represented by an inode and there is a limited number of inodes in the file system.
The situation that inode blocks are statically allocated at mkfs time.
Yes, that is true.
Quoted 10 lines
Quoted 5 lines
Using tune2fs on live/mounted file system is bad idea and the information might not be correct (exactly for this reason it is _NOT_ recommended to run fsck on live file system). Use 'df -i' if you want to get information about inode count.
Yes, later I figured out that tune2fs -l does not give current stats for live filesystems. I did not expect that to be dangerous though. And I also forgot about 'df -i'. Thing is, I did not hit this limit since the previous century so guess I subconsciously assumed inode limits are an outdated concept. :)
Running tune2fs -l on live file system is not dangerous, I did not said that. Running fsck on live file system on the other hand _is_ dangerous.
-Lukas
Quoted 6 lines
Regards,
Tvrtko
Quoted 11 lines · On Tuesday 05 February 2013 15:43:51 Lukáš Czerner wrote:
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
Yeah, I totally forgot about the inode situation on ext filesystems. So is
tune2fs giving wrong stats for live (mounted) filesystems?Not sure what situation you're referring to. Directory as any other file is represented by an inode and there is a limited number of inodes in the file system.
The situation that inode blocks are statically allocated at mkfs time.
Yes, that is true.
Indeed it is. :)
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Using tune2fs on live/mounted file system is bad idea and the information might not be correct (exactly for this reason it is _NOT_ recommended to run fsck on live file system). Use 'df -i' if you want to get information about inode count.
Quoted 8 lines
Quoted 5 lines
Yes, later I figured out that tune2fs -l does not give current stats for live filesystems. I did not expect that to be dangerous though. And I also forgot about 'df -i'. Thing is, I did not hit this limit since the previous century so guess I subconsciously assumed inode limits are an outdated concept. :)
Running tune2fs -l on live file system is not dangerous, I did not said that. Running fsck on live file system on the other hand _is_ dangerous.
:) Neither have I said I was running fsck or anything other than 'tune2fs -l'.
Regards,
Tvrtko
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html