shell hack - inode table full

shell hack - inode table full

a shell script, that create folder recusively,

it don't take much disk space, but it will use up inode table, after that you can't create new folder/file,

play it, but don't fucked yourself with it ...


------

code

    hack_inode_full.sh:

#! /bin/bash

# a bad and malicious program to create folder recursively,
# if you change the loop to infinite, then it will use up the inode of disk, and it is so deep recurisive that you can't even use 'rm -rf' to remove the folder,you can only write another program to remove folder from inner to top,

# define the deepth
declare n=5

echo -e "total deep:\t $n"
cd /tmp

while [ $n -gt 0 ];do
	mkdir adir
	cd adir
	touch afile
	n=$(($n-1))
done

exit 0
 

------

猜你喜欢

转载自kuchaguangjie.iteye.com/blog/1541821
今日推荐