running out of inodes
Hi
I have the following issue related to inode quantity on ext3 file system. Structure of /home file system looks like there is a lot of small files. I have free space on my file system but don't have free inodes and I can't write to it. Can I expand inodes on this file system (/home) ? Output from 'df -h' cmd. Code:
[root@redhat5 ~]# df -h Code:
[root@redhat5 ~]# df -i Code:
[root@redhat5 ~]# mount Code:
[root@redhat5 jakubn]# touch file2.txt |
Hi,
I think there are many files (probably few bytes, may be of zero byte) in any of the home directories of users which has fully used the inodes of the /home file system. In order to save yourself always remember to have quota enabled. Anyways, try to use the below commands to find any files which you feel would be junk. Code:
find . -size 0 # looks for zero size files |
As far as I know it is not possible the change the amount of inodes. You have to backup your files and reformat with a higher amount of inodes if you want to keep a big number of small files.
|
I think he's right; there's no 'amend inode cnt' option in http://linux.die.net/man/8/tune2fs, so you'll have to backup your stuff & use http://linux.die.net/man/8/mkfs.ext3
|
I understand now and made some testing to make sure.
I can expand ext3 filesystem online by using 'resize2fs' cmd. Tests relate /share file system. Code:
[root@centos11 /]# df -h Code:
[root@centos11 share]# ls -la Code:
[root@centos11 /]# lvextend -L+1G /dev/rootvg/share Code:
[root@centos11 /]# df -h Code:
[root@centos11 /]# resize2fs -p /dev/mapper/rootvg-storage Code:
[root@centos11 /]# ls -la /share Code:
[root@centos11 /]# df -i Code:
[root@centos11 /]# mkfs -t ext3 -m 1 -v -N 800000 /dev/rootvg/storage Code:
[root@centos11 share]# ls -la /share Code:
[root@centos11 share]# df -i I was wonderingt is there other file system type that allows expanding inode quantity on the fly and without reformatting entire fs? thx for help. |
I don't understand how to calc inodes to bytes storage.
Knowledge : ------------ When ext3 file system is created, specific number of inodes is created. Questions : ----------- - what decides how many inodes will be created on file system if not specified ? thx for help. |
Quote:
But, if in case you feel like you can try something like the below mke2fs command. Code:
mke2fs -N 10000 /dev/sda1 But, I still doubt this would solve you issue, as if there is some script/process which is continuously creating files (and thus consuming lnodes) will again haunt you. By the way, did you tried my suggestion posted here. |
Have a more in depth read of http://linux.die.net/man/8/mkfs.ext3, with particular ref to -b, -i, -O, -T options. See also the refs to the relevant conf file.
|
'chrism01' I understand mkfs command but have two question.
From quote below I don't understand the difference between -d vs -I. Quote:
----------- 1. If I create fs with this cmd `mkfs -t ext3 -N 700000 -d 2048 /dev/mapper/rootvg-homelv`, it will create 800000 inodes and block size of 2048 B ? 2. If I create fs with `mkfs -t ext3 -d 2048 -i 65536 /dev/mapper/rootvg-homelv`, does it mean that 65536 B will be block size of this fs ? thx for help. |
If you have "a tremendous number of small files," consider porting the applications in question to use a relational database, instead.
|
Quote:
Quote:
Anyway, I'd start by discovering your current block size http://www.cyberciti.biz/tips/determ...isk-quota.html. For a modern distro, I'd expect a default of 4096. Compare this to avg size of files in qn. I'd prob not mess with this. Then, I'd ignore -i switch and just use -N Quote:
HTH |
Yes I meant
Quote:
|
Temp. solution?
"man proc" on my RHEL 5.3 x32bit VM shows:
/proc/sys/fs/inode-max This file contains the maximum number of in-memory inodes. On some (2.4) systems, it may not be present. This value should be 3-4 times larger than the value in file-max, since stdin, stdout and network sockets also need an inode to handle them. When you regularly run out of inodes, you need to increase this value. and: /proc/sys/fs/inode-state This file contains seven numbers: nr_inodes, nr_free_inodes, preshrink and four dummy values. nr_inodes is the number of inodes the system has allocated. This can be slightly more than inode-max because Linux allocates them one page full at a time. nr_free_inodes represents the number of free inodes. preshrink is non-zero when the nr_inodes > inode-max and the system needs to prune the inode list instead of allocating more. So you could use adjust this using sysctl for persistence or just change it on the fly to get you by until you can address the underlying issue as suggested above? Haven't tried it to know if you can do it on the fly and whatnot...Just a thought... The /proc/fs/inode-max file doesn't exist on mine though, but it is a 2.6 kernel, maybe it's outdated or not applicable...? |
All times are GMT -5. The time now is 03:03 PM. |