Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 2004 21:30:08 +0200
From:      Jan-Espen Pettersen <sigsegv@leakingmemory.org>
To:        freebsd-current@freebsd.org
Cc:        sigsegv@leakingmemory.org
Subject:   out of inodes on md /tmp
Message-ID:  <4106AD40.5020500@leakingmemory.org>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig83FCFEE4AB9F6C38C6FB791A
Content-Type: multipart/mixed;
 boundary="------------090803090006030100070509"

This is a multi-part message in MIME format.
--------------090803090006030100070509
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

I ran into a problem when having a lot of small files in a memory disk
filesystem /tmp, which is now turned on by default through
/etc/defaults/rc.conf and /etc/rc.d/tmp . This caused /tmp to quickly
run out of inodes. In this case it was a cvs update over ssh that
triggered the problem.

One way to solve this is to increase the size of /tmp (this was also
required to solve my problem, since at least 130M was required for cvs
update to complete). But increasing the size of /tmp to 512M was not
enough to get a sufficient number of inodes. Therefore I suggest a
change to /etc/rc.d/tmp and /etc/defaults/rc.conf to let bytes-per-inode
be a configureable option through /etc/rc.conf

The diff I have attached to this message is what I've used for a few
days now. It seems to work for me. I don't know how many people who
actually need such an option, since this is relatively easy to work
around by other means.

from (log) messages:
Jul 24 11:34:02 endeavour kernel: pid 15026 (cvs), uid 1001 inumber 1407
on /tmp: out of inodes



--------------090803090006030100070509
Content-Type: text/plain;
 name="md_tmp.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="md_tmp.diff"

Index: etc/defaults/rc.conf
===================================================================
RCS file: /usr/ncvs/src/etc/defaults/rc.conf,v
retrieving revision 1.211
diff -u -r1.211 rc.conf
--- etc/defaults/rc.conf	18 Jul 2004 18:01:47 -0000	1.211
+++ etc/defaults/rc.conf	24 Jul 2004 10:35:47 -0000
@@ -40,6 +40,7 @@
 removable_interfaces=""	# Removable network interfaces for /etc/pccard_ether.
 tmpmfs="AUTO"		# Set to YES to always create an mfs /tmp, NO to never
 tmpsize="20m"		# Size of mfs /tmp if created
+tmpbpi="DEFAULT"	# Bytes-per-inode of mfs /tmp if created
 varmfs="AUTO"		# Set to YES to always create an mfs /var, NO to never
 varsize="32m"		# Size of mfs /var if created
 populate_var="AUTO"	# Set to YES to always (re)populate /var, NO to never
Index: etc/rc.d/tmp
===================================================================
RCS file: /usr/ncvs/src/etc/rc.d/tmp,v
retrieving revision 1.32
diff -u -r1.32 tmp
--- etc/rc.d/tmp	23 Mar 2004 23:22:35 -0000	1.32
+++ etc/rc.d/tmp	24 Jul 2004 11:06:45 -0000
@@ -35,15 +35,27 @@
 
 name="tmp"
 
+md_bpi=""
+
 load_rc_config $name
 
+if [ -n "$tmpbpi" ]; then
+	case "$tmpbpi" in
+	[Dd][Ee][Ff][Aa][Uu][Ll][Tt])
+		;;
+	*)
+		md_bpi="$tmpbpi"
+		;;
+	esac
+fi
+
 # If we do not have a writable /tmp, create a memory
 # filesystem for /tmp.  If /tmp is a symlink (e.g. to /var/tmp,
 # then it should already be writable).
 #
 case "${tmpmfs}" in
 [Yy][Ee][Ss])
-	mount_md ${tmpsize} /tmp
+	mount_md ${tmpsize} /tmp ${md_bpi}
 	chmod 01777 /tmp
 	;;
 [Nn][Oo])
@@ -57,7 +69,7 @@
 			echo "dropping into shell, ^D to continue anyway."
 			/bin/sh
 		else
-			mount_md ${tmpsize} /tmp
+			mount_md ${tmpsize} /tmp ${md_bpi}
 			chmod 01777 /tmp
 		fi
 	fi


--------------090803090006030100070509--

--------------enig83FCFEE4AB9F6C38C6FB791A
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBBq1BH90qNYni6VoRAvFHAJ9p/j3jsSmL4SrOtUcszDacIL+yogCgleQ7
1IA/HagrC//S6rSWmIKHXoM=
=6ybh
-----END PGP SIGNATURE-----

--------------enig83FCFEE4AB9F6C38C6FB791A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4106AD40.5020500>