From owner-freebsd-questions Sun Oct 18 21:57:18 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA16969 for freebsd-questions-outgoing; Sun, 18 Oct 1998 21:57:18 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from allegro.lemis.com (allegro.lemis.com [192.109.197.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA16963 for ; Sun, 18 Oct 1998 21:57:15 -0700 (PDT) (envelope-from grog@freebie.lemis.com) Received: from freebie.lemis.com (freebie.lemis.com [192.109.197.137]) by allegro.lemis.com (8.9.1/8.9.0) with ESMTP id OAA06271; Mon, 19 Oct 1998 14:26:11 +0930 (CST) Received: (from grog@localhost) by freebie.lemis.com (8.9.1/8.9.0) id OAA06430; Mon, 19 Oct 1998 14:25:30 +0930 (CST) Message-ID: <19981019142530.F4015@freebie.lemis.com> Date: Mon, 19 Oct 1998 14:25:30 +0930 From: Greg Lehey To: Graeme Tait , freebsd-questions@FreeBSD.ORG Cc: info@boatbooks.com Subject: Re: Out of inodes with many small files on disk References: <362A620D.33DC@echidna.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <362A620D.33DC@echidna.com>; from Graeme Tait on Sun, Oct 18, 1998 at 02:47:57PM -0700 WWW-Home-Page: http://www.lemis.com/~grog Organization: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sunday, 18 October 1998 at 14:47:57 -0700, Graeme Tait wrote: > Hi, I have a situation where I want to more-or-less fill a disk with tiny files. > Most are a little under 1k, which I understand is the default minimum fragment > size. > > When I was expanding a gzipped archive of such files onto the destination drive, I > got the message "out of inodes". The disk concerned is ~500MB with a single > partition (/dev/wd1s1e in the df -ik listing below). The "out of inodes" condition > arose with about 50% of the disk occupied with the small files. The files are > stored in what I hope is a reasonably intelligent structure, like > > dir1/dir2/file You could expect this. An inode is the metadata for a file; it describes the file to the system, so you have one inode per file. > with at most a few thousand files per dir2, and a few hundred dir2 per dir1. > > What do I need to do to make it possible to fill the disk with such minimal-size > files? First, decide how many you're likely to have, and how big they are. You can probably save a lot of space by choosing a fragment size of 512 bytes, which will imply the > Will it be necessary to repartition the disk? No. > How can I predict if I will run out of inodes before filling a disk (or partition > within a multi-partition disk). The term you're looking for is "file system". The number of inodes needed is equal to the number of files. > Filesystem 1K-blocks Used Avail Capacity iused ifree %iused Mounted on > /dev/wd0s1a 31775 16705 12528 57% 936 6742 12% / > /dev/wd0s1f 277527 241099 14226 94% 19598 49520 28% /usr > /dev/wd0s1e 29727 1221 26128 4% 155 7523 2% /var > procfs 4 4 0 100% 37 143 21% /proc > /dev/wd1s1e 510575 297237 172492 63% 130558 0 100% /ddrive I presume you're looking at /dev/wd1s1e. You could use the following command to set the fragment size to 512 bytes, block size to 4k (needed if you have 512 byte fragments), and the number of file data bytes per inode to 512: # newfs -f 512 -b 4096 -i 512 /dev/rwd1s1e Note that this will completely wipe out any data on the partition; make sure to back up first. Greg -- See complete headers for address, home page and phone numbers finger grog@lemis.com for PGP public key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message