From owner-freebsd-questions@FreeBSD.ORG Sun Mar 2 16:37:59 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 D05461065673 for ; Sun, 2 Mar 2008 16:37:59 +0000 (UTC) (envelope-from zflyer@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.232]) by mx1.freebsd.org (Postfix) with ESMTP id 7CDE98FC15 for ; Sun, 2 Mar 2008 16:37:59 +0000 (UTC) (envelope-from zflyer@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so5929553wxd.7 for ; Sun, 02 Mar 2008 08:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=XMg+cxHVtTmDKJxG1JIKJlmAHD+8j6x2UZMOII8g5v4=; b=PGWcph5XACYmPup7E9QLHFiUHWBmbTf3wy9fN8UillplxkaAP8oSjHde0wKgRnyG9rpIz0scm0dEYGip9SnbEjuk7zLuLeRfhYffBEwtRxQPlgADI92OSRMnOsjESAZiLlKEGY77pj+CXT2IW5OrspllVvHTZt2MdXdpYmgdqik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ksaraj+aYt9qviy7pATN4pZ43T+qISyX3qXKyvLNYsRJI+HDEUCzo77Z6VGEQI5ZGemG286ldbSZ07UnewrnEa2AQxaw2wMsqWoCgqH7YqTyhS3K5KtMyFz4rVBCUfc/XVDGfjwQBRGDSB12wPjAlNfYzmAd9AjhjO4vHDQUB+Q= Received: by 10.101.70.5 with SMTP id x5mr26525314ank.116.1204475878701; Sun, 02 Mar 2008 08:37:58 -0800 (PST) Received: by 10.100.31.20 with HTTP; Sun, 2 Mar 2008 08:37:58 -0800 (PST) Message-ID: <6293ba970803020837s40797f5eqfe72303e6ea5126b@mail.gmail.com> Date: Sun, 2 Mar 2008 11:37:58 -0500 From: Walker To: jhall@vandaliamo.net, freebsd-questions@freebsd.org 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 References: <49540.65.117.48.155.1204406604.squirrel@admintool.trueband.net> Cc: 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 16:37:59 -0000 On Sat, Mar 1, 2008 at 4:23 PM, wrote: > I am working on getting a FreeBSD system to boot from a USB memory stick. FWIW, my cut/paste script for installing 7.0 to a USB flash drive. This is adapted from a post by Ceri Davies (thank you!). ** This assumes the drive is at /dev/da0 and that /dev/md0 is not in use ** # set these; the two mount points should not exist export ISOFILE='/tmp/7.0-RELEASE-i386-disc1.iso' export ISOMNT='/a' export USBMNT='/b' # zero the device for better compression when were done (optional) dd bs=10m if=/dev/zero of=/dev/da0 # mdconfig and mount the media mkdir -m 555 ${ISOMNT} ${USBMNT} mdconfig -a -t vnode -u 0 -f ${ISOFILE} mount -t cd9660 /dev/md0 ${ISOMNT} # label and newfs the flash drive fdisk -BI /dev/da0 bsdlabel -B -w da0s1 newfs -U -L FBSDusb /dev/da0s1a mount /dev/da0s1a ${USBMNT} # install the OS cd ${ISOMNT}/*RELEASE/base DESTDIR=${USBMNT} ./install.sh # install the generic kernel cd ${ISOMNT}/*RELEASE/kernels DESTDIR=${USBMNT} ./install.sh generic rmdir ${USBMNT}/boot/kernel mv ${USBMNT}/boot/GENERIC ${USBMNT}/boot/kernel # set boot0 options boot0cfg -v -B -o noupdate -t 90 da0 # install a fstab; adjust as needed (like /tmp size) cat >> ${USBMNT}/etc/fstab << EOF # Device Mountpoint FStype Options Dump Pass /dev/ufs/FBSDusb / ufs rw,noatime 1 1 md /tmp mfs rw,-s150M,nosuid,noatime 0 0 md /var/run mfs rw,-s4M,nosuid,noatime 0 0 md /var/log mfs rw,-s16M,nosuid,noatime 0 0 /dev/acd0 /cdrom cd9660 ro,noauto,nosuid 0 0 /proc /proc procfs rw,noauto 0 0 /tmp /var/tmp nullfs rw 0 0 EOF # install an rc.conf cat >> ${USBMNT}/etc/rc.conf << EOF ifconfig_DEFAULT="DHCP" ifconfig_fwe0="NOAUTO" ifconfig_plip0="NOAUTO" sshd_enable="YES" syslogd_flags="-vv" sendmail_enable="NONE" EOF # set root password and timezone (optionally add users here as well) chroot ${USBMNT} /bin/sh passwd root tzsetup # clean up cd / umount ${ISOMNT} ${USBMNT} rmdir ${ISOMNT} ${USBMNT} mdconfig -d -u 0 # backup and compress (~ 84MB) (optional) dd bs=10m if=/dev/da0 of=usbflash-freebsd_7.0.img nice bzip2 usbflash-freebsd_7.0.img # done