<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ivan Kuznetsov &#187; Inode</title>
	<atom:link href="http://www.ivankuznetsov.com/tag/inode/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ivankuznetsov.com</link>
	<description>Entrepreneur, Ruby on Rails and Ubuntu fanatic, consultant</description>
	<lastBuildDate>Fri, 01 Jul 2011 22:03:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>No space left on device &#8211; running out of Inodes</title>
		<link>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html</link>
		<comments>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:12:56 +0000</pubDate>
		<dc:creator>Ivan Kuznetsov</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[file system]]></category>
		<category><![CDATA[Inode]]></category>
		<category><![CDATA[no space left]]></category>

		<guid isPermaLink="false">http://www.ivankuznetsov.com/?p=238</guid>
		<description><![CDATA[One of our development servers went down today. Problems started with deployment script that claimed that claimed &#8220;No space left on device&#8221;, although partition was not nearly full. If you ever run into such trouble &#8211; most likely you have too many small or 0-sized files on your disk, and while you have enough disk [...]]]></description>
			<content:encoded><![CDATA[<p>One of our development servers went down today. Problems started with deployment script that claimed that claimed &#8220;No space left on device&#8221;, although partition was not nearly full. If you ever run into such trouble &#8211; most likely you have too many small or 0-sized files on your disk, and while you have enough disk space, you have exhausted all available <a href="http://www.linfo.org/inode.html" target="_blank">Inodes</a>. Below is the solution for this problem.</p>
<p><span id="more-238"></span></p>
<p>1. check available disk space to ensure that you still have some</p>
<pre style="padding-left: 30px;">$ df

<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">Filesystem           1K-blocks      Used Available Use% Mounted on</span>
/dev/xvda             33030016  10407780  22622236  32% /
tmpfs                   368748         0    368748   0% /lib/init/rw
varrun                  368748        56    368692   1% /var/run
varlock                 368748         0    368748   0% /var/lock
udev                    368748       108    368640   1% /dev
tmpfs                   368748         0    368748   0% /dev/shm</pre>
<p>2. check available Inodes</p>
<pre style="padding-left: 30px;">$ df -i

<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">Filesystem            Inodes   IUsed   IFree IUse% Mounted on</span>
/dev/xvda            2080768 2080768       0  100% /
tmpfs                  92187       3   92184    1% /lib/init/rw
varrun                 92187      38   92149    1% /var/run
varlock                92187       4   92183    1% /var/lock
udev                   92187    4404   87783    5% /dev
tmpfs                  92187       1   92186    1% /dev/shm</pre>
<div>If you have IUse% at 100 or near, then huge number of small files is the reason for &#8220;No space left on device&#8221; errors.</div>
<p>3. find those little bastards</p>
<pre style="padding-left: 30px;">$ for i in /*; do echo $i; find $i |wc -l; done</pre>
<p>This command will list directories and number of files in them. Once you see a directory with unusually high number of files (or command just hangs over calculation for a long time), repeat the command for that directory to see where exactly the small files are.</p>
<pre style="padding-left: 30px;">$ for i in /home/*; do echo $i; find $i |wc -l; done</pre>
<p>4. once you found the suspect &#8211; just delete the files</p>
<pre style="padding-left: 30px;">$ sudo rm -rf /home/bad_user/directory_with_lots_of_empty_files</pre>
<p>You&#8217;re done. Check the results with df -i command again. You should see something like this:</p>
<pre style="padding-left: 30px;">Filesystem            Inodes   IUsed   IFree IUse% Mounted on

/dev/xvda            2080768  284431 1796337   14% /
tmpfs                  92187       3   92184    1% /lib/init/rw
varrun                 92187      38   92149    1% /var/run
varlock                92187       4   92183    1% /var/lock
udev                   92187    4404   87783    5% /dev
tmpfs                  92187       1   92186    1% /dev/shm</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.ivankuznetsov.com%2F2010%2F02%2Fno-space-left-on-device-running-out-of-inodes.html&amp;title=No%20space%20left%20on%20device%20%26%238211%3B%20running%20out%20of%20Inodes" id="wpa2a_2"><img src="http://www.ivankuznetsov.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

