Last active
January 12, 2016 12:40
-
-
Save shankaraman/b2d98aaa77bd734bd457 to your computer and use it in GitHub Desktop.
Inode Exhaustion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
# Sorry this is a very lame code | |
lst = [] | |
data = os.popen('df -i').readlines() | |
data = data[1].split(' ') | |
for i in data: | |
if i != '': | |
lst.append(i) | |
exhaust_count = int(lst[3]) | |
print "Total free inodes:",exhaust_count | |
count = 0 | |
for i in range(exhaust_count+100): | |
os.system('touch '+str(i)+'.txt') | |
count+=1 | |
print "So far:",count, "Remaining:",exhaust_count-count |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment