From owner-freebsd-stable@FreeBSD.ORG Wed Mar 11 04:21:41 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4A27106564A for ; Wed, 11 Mar 2009 04:21:41 +0000 (UTC) (envelope-from andrew@modulus.org) Received: from email.octopus.com.au (email.octopus.com.au [122.100.2.232]) by mx1.freebsd.org (Postfix) with ESMTP id 84B748FC16 for ; Wed, 11 Mar 2009 04:21:41 +0000 (UTC) (envelope-from andrew@modulus.org) Received: by email.octopus.com.au (Postfix, from userid 1002) id 509F317E96; Wed, 11 Mar 2009 15:21:49 +1100 (EST) X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on email.octopus.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=10.0 tests=ALL_TRUSTED autolearn=failed version=3.2.3 Received: from [10.1.50.60] (ppp121-44-4-80.lns10.syd7.internode.on.net [121.44.4.80]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: admin@email.octopus.com.au) by email.octopus.com.au (Postfix) with ESMTP id 3A6E617E8F; Wed, 11 Mar 2009 15:21:45 +1100 (EST) Message-ID: <49B73BBE.3020302@modulus.org> Date: Wed, 11 Mar 2009 15:19:10 +1100 From: Andrew Snow User-Agent: Thunderbird 2.0.0.14 (X11/20080523) MIME-Version: 1.0 To: Clifton Royston , freebsd-stable@freebsd.org References: <20090311032557.GA7735@lava.net> In-Reply-To: <20090311032557.GA7735@lava.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Installing FreeBSD from USB flash drive - some experiments X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2009 04:21:42 -0000 Here's the steps I use to create a 1GB USB image: # dd if=/dev/zero of=bootable.image bs=1m count=1 oseek=1000 conv=sparse # mdconfig -a -t vnode -f bootable.image -u 0 # newfs -m 0 -o space -n /dev/md0 # mount /dev/md0 /mnt # cd /usr/src # make installworld DESTDIR=/mnt # make distribution DESTDIR=/mnt # make installkernel DESTDIR=/mnt # umount /mnt At this point you have a file "bootable.image" but instead of actually making that a bootable dd image, I choose to create a dump file which is a bit more flexible as you can restore it to a USB stick of any size. # dump -0 -C 8 -f - /dev/md0 | gzip -9 > bootable.dump.gz # mdconfig -d -u 0 At this point, you have a dump file which you can use to create a bootable USB as follows: Assuming the USB stick is /dev/da0 ! # dd if=/dev/zero of=/dev/da0 bs=16k # fdisk -BI /dev/da0 # disklabel -B -w /dev/da0s1 # newfs -m 0 -o space -n /dev/da0s1a # mount -o noatime,async /dev/da0s1a /mnt # gzcat bootable.dump.gz | ( cd /mnt ; restore -rvf - ) # umount /mnt Hope that helps - Andrew