From owner-freebsd-questions@FreeBSD.ORG Sun Mar 2 03:11:07 2008 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 F2B661065672 for ; Sun, 2 Mar 2008 03:11:07 +0000 (UTC) (envelope-from john@jnielsen.net) Received: from ns1.jnielsen.net (ns1.jnielsen.net [69.55.238.237]) by mx1.freebsd.org (Postfix) with ESMTP id D4DBB8FC1F for ; Sun, 2 Mar 2008 03:11:07 +0000 (UTC) (envelope-from john@jnielsen.net) Received: from [192.168.3.245] (jn@stealth.jnielsen.net [74.218.226.254]) (authenticated bits=0) by ns1.jnielsen.net (8.12.9p2/8.12.9) with ESMTP id m223B5Zl010820; Sat, 1 Mar 2008 22:11:06 -0500 (EST) (envelope-from john@jnielsen.net) From: John Nielsen To: freebsd-questions@freebsd.org Date: Sat, 1 Mar 2008 22:11:04 -0500 User-Agent: KMail/1.9.7 References: <49540.65.117.48.155.1204406604.squirrel@admintool.trueband.net> In-Reply-To: <49540.65.117.48.155.1204406604.squirrel@admintool.trueband.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803012211.04629.john@jnielsen.net> X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on ns1.jnielsen.net X-Virus-Status: Clean Cc: jhall@vandaliamo.net Subject: Re: Booting from Memory Stick 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: Sun, 02 Mar 2008 03:11:08 -0000 On Saturday 01 March 2008 04:23:24 pm jhall@vandaliamo.net wrote: > I am working on getting a FreeBSD system to boot from a USB memory > stick. > > Would it be possible to install the operating system using the > following: > > cd /usr/src > make DESTDIR=/mnt/usbdisk world > boot0cfg -v -B -o noupdate da0 > > Or, is there an easier way to do this? I know you've gotten some other responses, but I wanted to chime in and say that I've done this (just today, actually) using an approach similar to what you're outlining. In a nutshell: (assuming USB stick is da0, you don't care about what's on it, and you want to use the whole thing with one partition and no swap) ##prepare the destination disk, including boot blocks, and mount fdisk -BI /dev/da0 #ignore the GEOM not found message bsdlabel -wB /dev/da0s1 newfs -U -L mystick /dev/da0s1a #optional flags for softupdates and label mount /dev/ufs/mystick /mnt ##prepare obj tree (skip if you already have one with the kernel you want) cd /usr/src make buildworld make KERNCONF=MYUSBKERNEL #or GENERIC, whatever ##install to the stick cd /usr/src make KERNCONF=MYUSBKERNEL DESTDIR=/mnt installkernel make DESTDIR=/mnt installworld mergemaster -i -D /mnt #review list, answer yes to followup ?'s ##The only other thing that's required is an fstab file: echo "/dev/ufs/mystick / ufs rw 1 1" >> /mnt/etc/fstab ##and don't forget to un-mount the stick when you're done umount /mnt That's a bit quick and dirty, obviously, but you can boot from the stick and have a complete system at this point. Setup of the root password, users, groups, hostname, interfaces, timezone, etc not included. Sysinstall or manual config (either from the initial host or after booting from the stick) can get you the rest of the way. Or you may discover that one of the other approaches suggested is easier. :) JN