Date: Sat, 1 Mar 2008 22:11:04 -0500 From: John Nielsen <john@jnielsen.net> To: freebsd-questions@freebsd.org Cc: jhall@vandaliamo.net Subject: Re: Booting from Memory Stick Message-ID: <200803012211.04629.john@jnielsen.net> In-Reply-To: <49540.65.117.48.155.1204406604.squirrel@admintool.trueband.net> References: <49540.65.117.48.155.1204406604.squirrel@admintool.trueband.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803012211.04629.john>