From owner-freebsd-questions@FreeBSD.ORG Thu Sep 27 10:45:10 2007 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 4712116A421 for ; Thu, 27 Sep 2007 10:45:10 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from mail.itu.dk (pluto.itu.dk [130.226.142.18]) by mx1.freebsd.org (Postfix) with ESMTP id 1120913C467 for ; Thu, 27 Sep 2007 10:45:09 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from localhost (unknown [10.0.0.3]) by mail.itu.dk (Postfix) with ESMTP id E4B2D36F715 for ; Thu, 27 Sep 2007 12:31:23 +0200 (CEST) X-Virus-Scanned: amavisd-new at itu.dk Received: from superman.itu.dk ([130.226.142.5]) by localhost (daredevil.itu.dk [130.226.142.26]) (amavisd-new, port 10024) with ESMTP id 5ZF6Q4DmMMxJ for ; Thu, 27 Sep 2007 12:31:18 +0200 (CEST) Received: from [192.168.1.5] (stud1-15.itu.dk [130.226.140.15]) by superman.itu.dk (Postfix) with ESMTP id 3B9839E6C3 for ; Thu, 27 Sep 2007 12:31:12 +0200 (CEST) Message-ID: <46FB866E.5040900@cederstrand.dk> Date: Thu, 27 Sep 2007 12:31:10 +0200 From: Erik Cederstrand User-Agent: Thunderbird 2.0.0.5 (X11/20070723) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: gzip compression problems 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: Thu, 27 Sep 2007 10:45:10 -0000 Hi! I'm trying to create a custom disk image for installing on a server. The plan is to PXE boot the server and dd the image to the hard-disk of the server. The gzipped files I need for the server are 45MB. However, when I create a 4GB image, stick the same files in there and gzip the image, the resulting file is 251MB. Most of the image is just empty space, so I was expecting the gzipped image to be roughly 45MB. What's going on? I used the following commands to create the image: # dd if=/dev/zero of=/path/to/diskimg bs=1k count=4m # mdconfig -a -t vnode -f /path/to/diskimg -u 4 # fdisk -BI -b /boot/mbr md4 # bsdlabel -B -b /boot/boot -R md4s1 /path/to/disklayout # newfs /dev/md4s1a # mount /dev/md4s1a /mnt/ # make installworld DESTDIR=/mnt # make distribution DESTDIR=/mnt # make installkernel DESTDIR=/mnt # umount /mnt # fsck -t ufs /dev/md4s1a # mdconfig -d -u 4 The contents of /path/to/disklayout: # /dev/md4s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 3G 16 4.2BSD 2048 16384 8 b: 500M * swap c: * * unused 0 0 Thanks, Erik