From nobody@FreeBSD.org  Sun Dec  4 02:00:25 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E8811065677
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  4 Dec 2011 02:00:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id DABD58FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  4 Dec 2011 02:00:20 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pB420KOe089797
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 4 Dec 2011 02:00:20 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pB420Kf5089796;
	Sun, 4 Dec 2011 02:00:20 GMT
	(envelope-from nobody)
Message-Id: <201112040200.pB420Kf5089796@red.freebsd.org>
Date: Sun, 4 Dec 2011 02:00:20 GMT
From: Patrick Barletta <teamdest@pbarletta.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Small disk sizes with 4k sectors have far too few inodes in RC2
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         163051
>Category:       misc
>Synopsis:       Small disk sizes with 4k sectors have far too few inodes in RC2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 04 10:13:48 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue Jan 24 04:10:09 UTC 2012
>Originator:     Patrick Barletta
>Release:        9.0 RC2
>Organization:
Blazenet.org
>Environment:
FreeBSD loki 9.0-RC2 FreeBSD 9.0-RC2 #0: Sat Nov 12 18:35:25 UTC 2011     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
When installing a 9.0 system to a small disk (such as might be used on a virtual machine), so few inodes are allocated that after the installation of the ports tree and possibly one or two trivial operations, no inodes are left free. Supposedly this is a problem related to the switchover to 4k sectors from 512 byte ones, but I have not verified that. The solution may be as simple as change the inode allocation density when installing on small system drives (in this case, a 5GB VMDK drive under vSphere 5)
>How-To-Repeat:
Install FreeBSD 9.0 RC2 on a small system partition (Under 8 GB or so).
>Fix:
Possibly change the inode allocation density when running newfs on the system at installation.

>Release-Note:
>Audit-Trail:

From: Jason Bacon <bacon@uwm.edu>
To: bug-followup@FreeBSD.org, teamdest@pbarletta.com
Cc:  
Subject: Re: misc/163051: Small disk sizes with 4k sectors have far too few
 inodes in RC2
Date: Tue, 03 Jan 2012 11:54:59 -0600

 I've run into the same issue on RC3, and would argue for higher severity 
 and priority.  There does not seem to be a workaround in the 
 installation process (e.g. the ability to add newfs flags during 
 partitioning), and this prevents the completion of a desktop 
 installation on a 10 gig VDI under VirtualBox.  Below is output after a 
 basic XFCE setup and only a few applications:
 
 Filesystem   1K-blocks      Used    Avail Capacity iused    ifree 
 %iused  Mounted on
 /dev/ada0a      515612    222640   251724    47%    2054    31224    6%   /
 devfs                1         1        0   100%       0        0  
 100%   /dev
 /dev/ada0d     1031708     32700   916472     3%    2671    63375    
 4%   /var
 /dev/ada0e      515612      4184   470180     1%      20    33258    
 0%   /tmp
 /dev/ada0f     7220888   3761132  2882088    57%  440632    32966   
 93%   /usr
 procfs               4         4        0   100%       1        0  
 100%   /proc
 
 I agree that a simple check for disk size in the installer would be a 
 reasonable solution.
 
 Cheers,
 
 -- 
 
 -----------------------------------------------
    Jason W. Bacon
    Systems Programmer
    UITS High Performance Computing Group
    University of Wisconsin Milwaukee
    bacon@uwm.edu
 -----------------------------------------------
 
 

From: Jason Bacon <jwbacon@tds.net>
To: bug-followup@FreeBSD.org, teamdest@pbarletta.com
Cc:  
Subject: Re: misc/163051: Small disk sizes with 4k sectors have far too few
 inodes in RC2
Date: Mon, 23 Jan 2012 21:40:57 -0600

 FWIW: I've used this script to work around the issue until greater 
 control is available in the installer:
 
 #!/bin/sh -e
 
 ##########################################################################
 #   This script reformats /var, /tmp, and /usr with different FS
 #   parameters.  It was written for the purpose of increasing the number
 #   of inodes on a FreeBSD 9.0 system with a small disk (such as a
 #   VirtualBox VDI).  FreeBSD 9.0 uses a large default block size,
 #   resulting in too few inodes on /usr for a typical desktop system.
 #
 #   This script must be edited to suit your system.  It was tested on
 #   a 10G VDI with the following partitions:
 #
 #   /     ada0p2    1G
 #   SWAP  ada0p3    1G
 #   /var  ada0p4    512M
 #   /tmp  ada0p5    512M
 #   /usr  ada0p6    7G
 #
 #   On this system, the script increased inodes on /usr from about 500,000
 #   to about 3,000,000 (using 4096 byte blocks and 512 byte fragments).
 #
 #   It assumes you have enough space on / to store gzipped tarballs of
 #   /var, /tmp, and /usr.  For a fresh installation with a ports tree
 #   but no ports installed, this requires about 300mb.
 #
 #   I do not recommend using this script on anything but a fresh
 #   installation.  Doing so could result in loss of data.
 ##########################################################################
 
 # Edit these parameters to match your needs and partitions
 block_size=4096
 fragment_size=512
 var_dev=/dev/ada0p4
 tmp_dev=/dev/ada0p5
 usr_dev=/dev/ada0p6
 
 cd /
 
 if [ ! -e var.tgz ]; then
      printf "Packing /var...\n"
      tar zcf var.tgz --exclude var/.sujournal var
      df -i /var
 
      umount /var
      newfs -b $block_size -f $fragment_size $var_dev
      mount /var
 
      printf "Unpacking...\n"
      tar zxf var.tgz
      df -i /var
 fi
 
 if [ ! -e tmp.tgz ]; then
      printf "Packing /tmp...\n"
      tar zcf tmp.tgz --exclude tmp/.sujournal tmp
      df -i /tmp
 
      umount /tmp
      newfs -b $block_size -f $fragment_size $tmp_dev
      mount /tmp
 
      printf "Unpacking...\n"
      tar zxf tmp.tgz
      df -i /tmp
 fi
 
 if [ ! -e usr1.tgz ]; then
      # Back up commands and libs needed to unpack after reformatting
      printf "Backing up up /usr/bin and /usr/lib\n"
      cp -R /usr/lib /usr.lib
      cp -R /usr/bin /usr.bin
 
      printf "Packing /usr...\n"
      tar zcf usr.tgz --exclude usr/.sujournal usr
      df -i /usr
 
      # Reformat
      umount /usr
      newfs -b $block_size -f $fragment_size $usr_dev
      mount /usr
 
      # Commands and libs needed to unpack were in /usr, so use backups
      printf "Unpacking...\n"
      export PATH=${PATH}:/usr.bin
      export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr.lib
      tar zxf usr.tgz
      df -i /usr
 fi
 
>Unformatted:
