Date: Thu, 29 Nov 2012 07:27:05 -0700 From: Warner Losh <imp@bsdimp.com> To: Nick Hibma <nick@van-laarhoven.org> Cc: =?windows-1252?Q?=93FreeBSD_Embedded_Mailing_List=94?= <freebsd-embedded@FreeBSD.org> Subject: Re: NanoBSD: Create image sparsely Message-ID: <AC27719A-28AD-4567-A9F6-69195C2C1C98@bsdimp.com> In-Reply-To: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org> References: <42654855-CF29-488A-A645-2A280FC9D074@van-laarhoven.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Looks good to me, go ahead. Warner On Nov 29, 2012, at 12:42 AM, Nick Hibma wrote: > 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: >=20 > --- 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). >=20 > Any objections to this? (*) >=20 > Nick Hibma > nick@van-laarhoven.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AC27719A-28AD-4567-A9F6-69195C2C1C98>