Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Aug 2007 08:42:38 -0400
From:      "fbsd2" <>
To:        "Ross Penner" <>, "User questions" <>
Subject:   RE: Installing from USB Flash Drive
Message-ID:  <>
In-Reply-To: <op.twd8jds0q910fd@localhost>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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.

#Purpose =3D Use to transfer the FreeBSD install cd1 to=20
#          a bootable 1GB USB flash drive so it can be used to install =
#          First fetch the FreeBSD 6.2-RELEASE-i386-disc1.iso to your
#          hard drive /usr. Then execute this script from the command =
# fbsd2usb /usr/6.2-RELEASE-i386-disc1.iso =
# 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

set -u

if [ $# -lt 2 ]; then
    echo "Usage: $0 source-iso-path output-img-path"
    exit 1

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 ###"
dd if=3D/dev/zero of=3D${imgoutfile} count=3D${SECTS}
echo "### Initializing image File completed ###"

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 ###"

( cd ${tmpdir}/iso && find . -print -depth | cpio -dump ${tmpdir}/img )

echo "### Completed Copying files to the image ###"

if [ ${serial} -eq 2 ]; then
        echo "-D" > ${tmpdir}/img/boot.config
        echo 'console=3D"comconsole, vidconsole"' >> =
elif [ ${serial} -eq 1 ]; then
        echo "-h" > ${tmpdir}/img/boot.config
        echo 'console=3D"comconsole"' >> ${tmpdir}/img/boot/loader.conf

echo " "
echo "### Started writing image to flash drive now ###"
echo "### This will take about 30 minutes ###"
dd if=3D${imgoutfile} of=3D/dev/da0 bs=3D1m
echo "### Completed writing image to flash drive at ###"

cleanup() {
    umount ${tmpdir}/iso
    mdconfig -d -u ${isodev}
    umount ${tmpdir}/img
    mdconfig -d -u ${imgdev}
    rm -rf ${tmpdir}=20


ls -lh ${imgoutfile}

echo "### Script finished ###"

-----Original Message-----
From: =
[]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
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
#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 =
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.


sig ho!
_______________________________________________ mailing list
To unsubscribe, send any mail to =

Want to link to this message? Use this URL: <>