From owner-freebsd-embedded@FreeBSD.ORG Thu Nov 29 07:52:08 2012 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B80D67DE for ; Thu, 29 Nov 2012 07:52:08 +0000 (UTC) (envelope-from nick@van-laarhoven.org) Received: from vps.van-laarhoven.org (www.hibma.org [178.21.117.90]) by mx1.freebsd.org (Postfix) with ESMTP id 72F668FC12 for ; Thu, 29 Nov 2012 07:52:04 +0000 (UTC) Received: from [10.87.42.16] (unknown [80.187.201.33]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by vps.van-laarhoven.org (Postfix) with ESMTPSA id 965555F20D3; Thu, 29 Nov 2012 08:42:56 +0100 (CET) From: Nick Hibma Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: NanoBSD: Create image sparsely Date: Thu, 29 Nov 2012 08:42:23 +0100 Message-Id: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org> To: =?windows-1252?Q?=93FreeBSD_Embedded_Mailing_List=94?= Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) X-Mailer: Apple Mail (2.1499) X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2012 07:52:08 -0000 In the past I have submitted patches to create images sparsely. There is = however one patch missing still which, with the addition of = NANO_INIT_IMG2, has become much more useful: --- AnyWi/freebsd/nanobsd/nanobsd.sh 2012-11-08 19:48:40.000000000 = +0100 +++ /usr/src/tools/tools/nanobsd/nanobsd.sh 2012-11-06 = 15:24:52.000000000 +0100 @@ -540,7 +540,7 @@ if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then # Duplicate to second image (if present) echo "Duplicating to second image..." - dd if=3D/dev/${MD}s1 of=3D/dev/${MD}s2 bs=3D64k + dd conv=3Dsparse if=3D/dev/${MD}s1 of=3D/dev/${MD}s2 = bs=3D64k mount /dev/${MD}s2a ${MNT} for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab do @@ -569,7 +569,7 @@ =20 if ${do_copyout_partition} ; then echo "Writing out _.disk.image..." - dd if=3D/dev/${MD}s1 of=3D${NANO_DISKIMGDIR}/_.disk.image = bs=3D64k + dd conv=3Dsparse if=3D/dev/${MD}s1 = of=3D${NANO_DISKIMGDIR}/_.disk.image bs=3D64k fi mdconfig -d -u $MD =20 It copies out the image sparsely (conv=3Dsparse). The big advantage = comes when creating many images (I have between 10 and 20 images = simultaneously on my disk). Any objections to this? (*) Nick Hibma nick@van-laarhoven.org