Script to temp create files more than inode limit

HI,

I am from testing background. I have a scenario of a file generation, through cronjob, on a defined path.

After I fill the data as 100 % utilized, my application is generating an empty file on the defined path.

[root@VM1 ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       28G   26G     0 100% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.5G     0  1.5G   0% /dev/shm
[root@VM1 ~]#
[root@VM1 ~]#

But i dont even want to generate an empty file. I want my application to throw an error in case the disk usage is full.

When i checked in the inode limit:

Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     7307264  243248 7064016    4% /
/dev/sda1              26104      35   26069    1% /boot
tmpfs                 221914       1  221913    1% /dev/shm
[root@VM1 ~]#

I want a script to temporary create the files to reach the inode limit so that when i run my application, with 100% disk utilization, it will not generate even an empty file.

If possible, kindly help me out with the solution.

It is not sensible to fill all the inodes on the root filesystem. Your system will probably crash and may never boot again.
Filling any system partition (including root) is not advisible and can damage data files.

Thanks for the reply:

Scenarios is that:
For a user, the application will run the scheduled process and generates the file on the defined path.

As I came to know that there is a limit on number of files that can be created in a particular directory. So Can't I reach that limit. I need a script that can temporarily create files to reach the inode limit and after that i can remove these files when not required.

My main aim is not to create even an empty file even if the disc space is full.

There is no limit on a directory in unix. The inode limit is always on the filesystem. However some modern journal filesystems will just extend the inode limit dynamically.

Worth a look at the "ulimit" commmand within your Shell.

If you manage to use all the inodes on the root filesystem your system may become unusable.