From owner-freebsd-questions@FreeBSD.ORG Wed Jan 11 16:35:24 2012 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 4BEDB106564A for ; Wed, 11 Jan 2012 16:35:24 +0000 (UTC) (envelope-from me@janh.de) Received: from mxchg03.rrz.uni-hamburg.de (mxchg03.rrz.uni-hamburg.de [134.100.38.113]) by mx1.freebsd.org (Postfix) with ESMTP id EDE268FC15 for ; Wed, 11 Jan 2012 16:35:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mxchg03.rrz.uni-hamburg.de (Postfix) with ESMTP id AB2CF1EE272; Wed, 11 Jan 2012 17:19:57 +0100 (CET) X-Virus-Scanned: by University of Hamburg ( RRZ / mgw02.rrz.uni-hamburg.de ) Received: from mxchg03.rrz.uni-hamburg.de ([127.0.0.1]) by localhost (mxchg03.rrz.uni-hamburg.de [127.0.0.1]) (amavisd-new, port 10324) with ESMTP id MigRxQTgGHeO; Wed, 11 Jan 2012 17:19:57 +0100 (CET) Received: from mailhost.uni-hamburg.de (mailhost.uni-hamburg.de [134.100.38.99]) by mxchg03.rrz.uni-hamburg.de (Postfix) with ESMTPS; Wed, 11 Jan 2012 17:19:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mailhost.uni-hamburg.de (Postfix) with ESMTP id 9827290043; Wed, 11 Jan 2012 17:19:57 +0100 (CET) X-Virus-Scanned: by University of Hamburg (RRZ/mailhost) Received: from mailhost.uni-hamburg.de ([127.0.0.1]) by localhost (mailhost.uni-hamburg.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id drvItovW+H99; Wed, 11 Jan 2012 17:19:57 +0100 (CET) Received: from nb981.math (g224006222.adsl.alicedsl.de [92.224.6.222]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: fmjv004) by mailhost.uni-hamburg.de (Postfix) with ESMTPSA id 4921290002; Wed, 11 Jan 2012 17:19:57 +0100 (CET) Message-ID: <4F0DB6A8.3020308@janh.de> Date: Wed, 11 Jan 2012 17:19:52 +0100 From: Jan Henrik Sylvester User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120106 Thunderbird/9.0 MIME-Version: 1.0 To: Amitabh Kant References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: questions-list freebsd Subject: Re: mkisofs increasing iso size by 100 MB 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, 11 Jan 2012 16:35:24 -0000 On 01/-10/-28163 20:59, Amitabh Kant wrote: > I am trying to customise the bsdinstall auto script. I can mount the iso > (amd64 arch / 9.0 RELEASE) and change the shell script as per my > requirement. Once I try to re-create the iso file using mkisofs utility, > the size of the final iso increases by 100 MB if -J (joliet) mode is used. > If I remove the joliet mode, it still increases by around 97 MB. Even if no > changes are made to any of the files, the result is same. > > The process I have followed is as follows: > # mkdir /usr/iso > # cd /usr/iso > # dd if=/dev/cd0 of=org.iso bs=2048 > # mdconfig -a -t vnode -f org.iso -u 0 > # mount_cd9660 /dev/md0 /mnt > # mkdir staging > # cd staging > # rsync -a /mnt/ . > With Joliet mode > # mkisofs -J -R -V CustomBSD -no-emul-boot -b boot/cdboot -iso-level 3 -o > /usr/iso/my_custom.iso . > Without Joliet mode > # mkisofs -R -V CustomBSD -no-emul-boot -b boot/cdboot -iso-level 3 -o > /usr/iso/my_custom1.iso . > > The original iso is 612M, custom.iso is 712M and custom1.iso is 709M. > > System details: FreeBSD amd64 9.0 RELEASE running inside a virtualbox with > 2GB RAM. > > Where am I going wrong? There are many hardlinked files on the iso images. By the procedure above, you have them included multiple times. From the rsync manpage: "Note that -a does not preserve hardlinks, because finding multiply-linked files is expensive. You must separately specify -H." You will probably want "-cache-inodes" for mkisofs as well (and maybe other options). Or you could look at src/release/amd64/mkisoimages.sh for the use of "makefs -t cd9660". Cheers, Jan Henrik