From owner-freebsd-questions@FreeBSD.ORG Sat Aug 4 12:42:38 2007 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 A1D7916A417 for ; Sat, 4 Aug 2007 12:42:38 +0000 (UTC) (envelope-from fbsd2@a1poweruser.com) Received: from mail-03.name-services.com (Mail-03.name-services.com [64.74.223.58]) by mx1.freebsd.org (Postfix) with ESMTP id A5FE313C428 for ; Sat, 4 Aug 2007 12:42:38 +0000 (UTC) (envelope-from fbsd2@a1poweruser.com) Received: from laptop ([76.190.247.202]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.3959); Sat, 4 Aug 2007 05:45:25 -0700 From: "fbsd2" To: "Ross Penner" , "User questions" Date: Sat, 4 Aug 2007 08:42:38 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-OriginalArrivalTime: 04 Aug 2007 12:45:25.0189 (UTC) FILETIME=[540BF750:01C7D695] Cc: Subject: RE: Installing from USB Flash Drive X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: fbsd2@a1poweruser.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Aug 2007 12:42:38 -0000 I was really taken with the idea for using a USB flash stick disk drive = to install FreeBSD from. I used the script from the mentioned URL below = as the starting point. After some changes to the script I got it to = work. I was able to boot off the USB flash stick disk drive, But then = was faced with a show stopper. During the sysinstall process after it = asks for hard drive fdisk and bsdlable info it asks you for where to get = the install files from (IE: cdrom, remote ftp, floppy, dos partition, = ECT) there is no option to tell the sysinstall program to use USB-dd as = source location.=20 So in summary, this idea is un-usable until the sysinstall program gets = updated to include an option to use USB-dd as an install source. This = brings to light another problem. That is using floppies to install = FreeBSD from. PC manufactures are no longer building systems with = floppies drives included. Combining the FreeBSD floppy images to a = single USB-dd image would be away to continue to offer this method of = installing FreeBSD. Included below is my working script to populate a 1GB USB flash stick = disk with the FreeBSD cd1 iso file. #!/bin/sh #Purpose =3D Use to transfer the FreeBSD install cd1 to=20 # a bootable 1GB USB flash drive so it can be used to install = from.=20 # First fetch the FreeBSD 6.2-RELEASE-i386-disc1.iso to your # hard drive /usr. Then execute this script from the command = line # fbsd2usb /usr/6.2-RELEASE-i386-disc1.iso = /usr/6.2-RELEASE-i386-disc1.img # Change system bios to boot from USB-dd and away you go.=20 # NOTE: This script has to be run from root and your 1GB USB flash drive # has to be plugged in before running this script.=20 # On the command line enter fbsd2usb iso-path img-path # You can set some variables here. Edit them to fit your needs. # Set serial variable to 0 if you don't want serial console at all, # 1 if you want comconsole and 2 if you want comconsole and vidconsole serial=3D0 set -u if [ $# -lt 2 ]; then echo "Usage: $0 source-iso-path output-img-path" exit 1 fi isoimage=3D$1; shift imgoutfile=3D$1; shift # Temp directory to be used later #export tmpdir=3D$(mktemp -d -t fbsdmount) export tmpdir=3D$(mktemp -d /usr/fbsdmount) export isodev=3D$(mdconfig -a -t vnode -f ${isoimage}) ISOSIZE=3D$(du -k ${isoimage} | awk '{print $1}') SECTS=3D$((($ISOSIZE + ($ISOSIZE/5))*4)) #SECTS=3D$((($ISOSIZE + ($ISOSIZE/5))*2)) echo " " echo "### Initializing image File started ###" echo "### This will take about 4 minutes ###" date dd if=3D/dev/zero of=3D${imgoutfile} count=3D${SECTS} echo "### Initializing image File completed ###" date echo " " ls -l ${imgoutfile} export imgdev=3D$(mdconfig -a -t vnode -f ${imgoutfile}) bsdlabel -w -B ${imgdev} newfs -O1 /dev/${imgdev}a mkdir -p ${tmpdir}/iso ${tmpdir}/img mount -t cd9660 /dev/${isodev} ${tmpdir}/iso mount /dev/${imgdev}a ${tmpdir}/img echo " " echo "### Started Copying files to the image now ###" echo "### This will take about 15 minutes ###" date ( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img ) echo "### Completed Copying files to the image ###" date if [ ${serial} -eq 2 ]; then echo "-D" > ${tmpdir}/img/boot.config echo 'console=3D"comconsole, vidconsole"' >> = ${tmpdir}/img/boot/loader.conf elif [ ${serial} -eq 1 ]; then echo "-h" > ${tmpdir}/img/boot.config echo 'console=3D"comconsole"' >> ${tmpdir}/img/boot/loader.conf fi echo " " echo "### Started writing image to flash drive now ###" echo "### This will take about 30 minutes ###" date dd if=3D${imgoutfile} of=3D/dev/da0 bs=3D1m echo "### Completed writing image to flash drive at ###" date cleanup() { umount ${tmpdir}/iso mdconfig -d -u ${isodev} umount ${tmpdir}/img mdconfig -d -u ${imgdev} rm -rf ${tmpdir}=20 } cleanup ls -lh ${imgoutfile} echo "### Script finished ###" -----Original Message----- From: owner-freebsd-questions@freebsd.org = [mailto:owner-freebsd-questions@freebsd.org]On Behalf Of Ross Penner Sent: Wednesday, August 01, 2007 2:34 PM To: User questions Subject: Installing from USB Flash Drive Hi everybody, I'm trying to install a system on a machine that doesn't have an optical = drive. I plan on using a USB flash drive to do the job and found a=20 messages from hackers@freebsd.org=20 (http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg55434.html)=20 about just such a thing. The script provided converts the CD image into=20 one suitable for a flashmemory stick. I used and coverted it without=20 issue. The instructions say to use dd to prepare the flash drive so=20 executed #dd if=3Dflashbsd.iso of=3D/dev/da0 I'm not entirely confident that that was the correct procedure, as I'm=20 quite unfamilar with dd. Unfortunetly, I can't seem to get the drive to=20 boot. I can mount the filesystem so it seems that prepareing the drive = was=20 succesful. I'm using a via chipset and yes, the bios is set to boot from = USB-FDD. I used the 6.2 boot only image. Thanks for any insight you can provide me. Ross -- sig ho! _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to = "freebsd-questions-unsubscribe@freebsd.org"