LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Did I hit the max inode limit? (https://www.linuxquestions.org/questions/linux-general-1/did-i-hit-the-max-inode-limit-912156/)

the_gripmaster 11-06-2011 08:08 AM

Did I hit the max inode limit?
 
Had some fun testing the limits of Linux filesystem (All non-pseudo partitions are ext4). Here is what is did, separated into sections of code for easier interpretation:

Code:

[root@scarecrow mystuffz]# mkdir -p /tmp/mystuffz
[root@scarecrow mystuffz]# cd /tmp/mystuffz
[root@scarecrow mystuffz]# for i in $(seq 1 3000000); do touch file$i.{txt,dat,log}; done
touch: cannot touch `file217120.txt': No space left on device
touch: cannot touch `file217120.dat': No space left on device
touch: cannot touch `file217120.log': No space left on device
touch: cannot touch `file217121.txt': No space left on device
touch: cannot touch `file217121.dat': No space left on device
^C

But there is ample space left:
Code:

[root@scarecrow mystuffz]# df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                9.9G  584M  8.8G  7% /
udev                  3.0G  4.0K  3.0G  1% /dev
tmpfs                3.0G  644K  3.0G  1% /dev/shm
tmpfs                3.0G  764K  3.0G  1% /run
/dev/mapper/vg_main-lv_root
                      9.9G  584M  8.8G  7% /
tmpfs                3.0G    0  3.0G  0% /sys/fs/cgroup
tmpfs                3.0G    0  3.0G  0% /media
/dev/md0              485M  67M  394M  15% /boot
/dev/mapper/vg_main-lv_var
                      12G  763M  11G  7% /var
/dev/mapper/vg_main-lv_virtualization
                      197G  99G  89G  53% /virtualization
/dev/mapper/vg_main-lv_home
                      25G  7.9G  16G  34% /home
/dev/mapper/vg_main-lv_opt
                      7.9G  415M  7.1G  6% /opt
/dev/mapper/vg_main-lv_usr
                      20G  4.8G  14G  26% /usr
/dev/mapper/vg_main-lv_tmp
                      9.9G  754M  8.7G  8% /tmp
/dev/mapper/vg_main-lv_tmp
                      9.9G  754M  8.7G  8% /tmp
/dev/mapper/vg_main-lv_var
                      12G  763M  11G  7% /var/tmp
/dev/mapper/vg_main-lv_home
                      25G  7.9G  16G  34% /home

OK, let's create another file in this /tmp partition:
Code:

[root@scarecrow mystuffz]# cd ..
[root@scarecrow tmp]# touch file
touch: cannot touch `file': No space left on device
[root@scarecrow tmp]# echo $?
1

Let's try creating a file in another partition:
Code:

[root@scarecrow tmp]# cd ~
[root@scarecrow ~]# touch file
[root@scarecrow ~]# echo $?
0

So, did I hit the inode limit for /tmp partition?

TobiSGD 11-06-2011 08:12 AM

Seems to be so, yes. You can test that with
Code:

df -i

the_gripmaster 11-06-2011 08:45 AM

Quote:

Originally Posted by TobiSGD (Post 4517227)
Seems to be so, yes. You can test that with
Code:

df -i

Thanks. I can try this troubleshooting trick on some sysadmins. I bet many sysadmins can't figure this out.


All times are GMT -5. The time now is 12:43 AM.