From owner-freebsd-questions@FreeBSD.ORG Wed Mar 12 18:56:35 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2D12106566C for ; Wed, 12 Mar 2008 18:56:35 +0000 (UTC) (envelope-from aturetta@bestunion.it) Received: from aa002msb.fastweb.it (aa002msb.fastweb.it [85.18.95.81]) by mx1.freebsd.org (Postfix) with ESMTP id 57F7F8FC14 for ; Wed, 12 Mar 2008 18:56:35 +0000 (UTC) (envelope-from aturetta@bestunion.it) Received: from mail.bestunion.it (85.18.250.114) by aa002msb.fastweb.it (8.0.013.5) id 47CFF4A800C03B36 for freebsd-questions@freebsd.org; Wed, 12 Mar 2008 19:44:35 +0100 Received: from [192.168.33.30] (nbcommit.home.commit.it [192.168.33.30] (may be forged)) (authenticated bits=0) by mail.bestunion.it (8.14.2/8.14.2) with ESMTP id m2CIiYW5088638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 12 Mar 2008 19:44:35 +0100 (CET) (envelope-from aturetta@bestunion.it) Message-ID: <47D82486.5060402@bestunion.it> Date: Wed, 12 Mar 2008 19:44:22 +0100 From: Angelo Turetta User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.92.1, clamav-milter version 0.92.1 on mail.bestunion.it X-Virus-Status: Clean Subject: UFS2 optimization for many small files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2008 18:56:36 -0000 I recently upgraded the disk of my mail server. The server was initially installed with a single 36GB RAID1 volume with FreeBSD 5 (summer 2004). Over the years I upgraded to FreeBSD 6, and some months ago I added another 36GB RAID1 volume and one 72GB RAID1 volume. I then proceeded to copy my cyrus-imapd partition from /usr/local/mail (on /dev/da0s1f) to the new 76GB /mail (/dev/da2s1d). During this copy I noticed the disk usage of the mailboxes (as reported by du(8)) growing about 20% larger in the process. Please note that cyrus stores mailboxes with 1 file per message, 1 directory per IMAP-folder, and the moved files are in the order of the hundred-thousands, with half of them less than 8 KB large. I tried understanding where the difference was, but I cannot work-out any cause in the file systems: [root@mail /data]# disklabel da0s1 # /dev/da0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 524288 0 4.2BSD 2048 16384 32776 b: 4142832 524288 swap c: 71119692 0 unused 0 0 # "raw" part, don't edit d: 4194304 4667120 4.2BSD 2048 16384 28552 e: 1048576 8861424 4.2BSD 2048 16384 8 f: 61209692 9910000 4.2BSD 2048 16384 28552 [root@mail /data]# disklabel da2s1 # /dev/da2s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 142253248 0 unused 0 0 # "raw" part, don't edit d: 142253248 0 4.2BSD 2048 16384 28552 What can I look at, now? Should I decide to reformat my disk, what newfs parameters you'd advice for my case? Thanks, Angelo. PS: here follows the disk definitions: why the disk formatted during the initial FreeBSD5 setup (da0) has a different geometry than the one formatted later with FreeBSD6 (da1, hardware identical to da0)? Maybe this is influencing the block occupation? --------------------------------------------------------------------- [root@mail /data]# fdisk /dev/da0 ******* Working on device /dev/da0 ******* parameters extracted from in-core disklabel are: cylinders=4427 heads=255 sectors/track=63 (16065 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=4427 heads=255 sectors/track=63 (16065 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 71119692 (34726 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: ----------------------------------------------------------------------- [root@mail /data]# fdisk /dev/da1 ******* Working on device /dev/da1 ******* parameters extracted from in-core disklabel are: cylinders=8716 heads=255 sectors/track=32 (8160 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=8716 heads=255 sectors/track=32 (8160 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 32, size 71122528 (34727 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 32 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: ----------------------------------------------------------------------- [root@mail /data]# fdisk /dev/da2 ******* Working on device /dev/da2 ******* parameters extracted from in-core disklabel are: cylinders=17433 heads=255 sectors/track=32 (8160 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=17433 heads=255 sectors/track=32 (8160 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 32, size 142253248 (69459 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 254/ sector 32 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: