Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Jan 2010 21:40:10 +0800
From:      Fbsd1 <fbsd1@a1poweruser.com>
To:        Christoph Kukulies <kuku@kukulies.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Cannot boot FreeBSD (8.0) from USB stick (Dell Inspiron 9400)
Message-ID:  <4B59AABA.6030301@a1poweruser.com>
In-Reply-To: <4B5861E1.7030800@kukulies.org>
References:  <4B581838.8010107@kukulies.org> <4B586142.3020404@a1poweruser.com> <4B5861E1.7030800@kukulies.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Christoph Kukulies wrote:
> Fbsd1 schrieb:
>> Christoph Kukulies wrote:
>>> I installed FreeBSD 8.0 on an USB-stick and was able to boot it on my 
>>> Desktop PC and install 8.0
>>> from it.

DO YOU MEAN YOU INSTALLED THE 8.0 ISO ON A USB STICK. BOOTED FROM IT AS 
INSTALL SOURCE AND INSTALLED 8.0 ON A DESKTOP PC TO THE MOTHERBOARD 
CABLED HARD DRIVE??? OR DO YOU MEAN YOU INSTALLED 8.0 ON A DESKTOP PC TO 
ANOTHER USB STICK???


>>>
>>> Now I plugged the same stick into my Dell Inspiron 9400 and the USB 
>>> stick (2GB) is not even listed in the F12 Bios boot menu.

YOU MEAN YOU PLUGGED THE STICK WITH THE ISO INSTALLED ON IT THAT THE 
DESKTOP BOOTED FROM???

>>>
>>> Any clues?
>>>
>>> -- 
>>> Christoph
>>>
>>>
>> Older pc's have bios which do not have option to boot from USB stick.
>> I think that is so in your case. Check mfg website for bios update.
>> If not you are SOL. (shit outof luck)
> 
> I can boot USB sticks in general from that notebook/BIOS. That Dell 9400 
> isn't that old. Today I tried an another USB stick (16GB) an Ubuntu 9.04 
> boot image and it worked fine. I saw the boot device under F12 in the 
> bootable device menu.
> It's definitely not the BIOS. Could be some partition problem (active 
> partition?). 
 > Why is it part #4 btw, that FreeBSD resides in and not part #1 ?

LETS NOT GET CONFUSED WITH MSDOS /FREEBSD TERMS. IN FREEBSD A SLICE IS 
WHAT MSDOS CALLS A PARTITION. IN FREEBSD A PARTITION IS A FILE SYSTEM 
SUCH AS /, /USR, /VAR WITH IN THE SLICE. A SLICE IS MARKED AS ACTIVE 
MEANING ITS BOOTABLE. THE MBR (MASTER BOOT RECORD)PARTITION TABLE IS 
REALLY FREEBSD SLICE TABLE. FROM YOUR STATEMENT ABOVE YOU HAVE A 
MOTHERBOARD CABLED HARD DRIVE WITH 4 PARTITIONS/SLICES DEFINED IN THE 
MBR PARTITION TABLE. THE FIRST 3 PARTITIONS COULD BE HOLDING OTHER 
OPERATING SYSTEMS THAT YOU MAY WANT TO BOOT FROM. IS THIS CORRECT?

 > I followed some FreeBSD howto, if I'm not wrong, to bring the ISO
> to the USB stick. Think it was a tool from HP to write it to the stick.
> 
> -- 
> Christoph
> 
>


Here is some thing for you to check. When you plug your USB stick into a
running freebsd system a bunch of messages are printed on the root
console. One of those messages contain the Revision level of the 2.0
standard used by the micro code in the usb stick. I have found through
testing different non-branded and branded sticks that the Revision level
makes a very large difference in whether you can boot from the stick.
Sticks that show Rev 2.00/0.00 or 2.00/1.00 will never boot. Only sticks
that show Rev 2.00/2.00 are bootable. Now since only one of my 4 pc's is
new enough to have bios option to boot from usb stick I do not know if
these results are dependent on my particular Acer TravelMate 4220 pc bios.

Please let me know what usb stick Revision levels you can boot from on 
both your desktop and laptop. I would think if the stick is bootable on 
desktop it should also boot on the laptop.

Here is the script I use to put the disc-1 iso on usb stick so I can use 
the stick as source media to install from. When booting from usb stick 
as install source and installing onto another usb stack as the target 
you have to have both sticks plugged in before booting. When you are in 
sysinstall fdisk check the stick size to verify you have chosen the 
correct da stick as target. You can find yourself fdisking your source 
stick by mistake. If you don't get prompt to chose da0 or da1 before 
fdisk starts then you have to tell sysinstall to re-probe devices by 
using options rescan (*) off the main menu,  move highlight bar by using 
arrow keys and hit space bar to rescan. Then you should get prompt 
containing both da devices before fdisk.


I have used this command to to write zeros to the usb stick MBR
dd if=/dev/zero of=/dev/da0 count=1
and this command to display the MBR
dd if=/dev/da0 count=1 | od -c

I also notice that fdisk does not allocate space on usb sticks as i 
would expect. It always allocates a free space before and after the full 
stick single slice. It also never get the size of the stick correct. A 
2GB stick is shown as 1.7GB and 4GB stick is shown as 3.7GB. Do you see 
the same thing happening with your usb sticks?


#!/bin/sh
#Purpose = Use to transfer the FreeBSD install cd1 to
#          a bootable 1GB USB flash drive so it can be used to install 
from.
#          First fetch the FreeBSD 7.1-RELEASE-i386-disc1.iso to your
#          hard drive /usr. Then execute this script from the command line
# fbsd2usb /usr/7.1-RELEASE-i386-disc1.iso /usr/7.1-RELEASE-i386-disc1.img
# Change system bios to boot from USB-dd and away you go.

# NOTE: This script has to be run from root and your 1GB USB flash drive
#       has to be plugged in before running this script.

# 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=0

set -u

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

isoimage=$1; shift
imgoutfile=$1; shift

# Temp  directory to be used later
#export tmpdir=$(mktemp -d -t fbsdmount)
export tmpdir=$(mktemp -d /usr/fbsdmount)

export isodev=$(mdconfig -a -t vnode -f ${isoimage})

ISOSIZE=$(du -k ${isoimage} | awk '{print $1}')
SECTS=$((($ISOSIZE + ($ISOSIZE/5))*4))
#SECTS=$((($ISOSIZE + ($ISOSIZE/5))*2))

echo " "
echo "### Initializing image File started ###"
echo "### This will take about 1 minute ###"
date
dd if=/dev/zero of=${imgoutfile} count=${SECTS}
echo "### Initializing image File completed ###"
date

echo " "
ls -l ${imgoutfile}
export imgdev=$(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 6 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="comconsole, vidconsole"' >> 
${tmpdir}/img/boot/loader.conf
elif [ ${serial} -eq 1 ]; then
         echo "-h" > ${tmpdir}/img/boot.config
         echo 'console="comconsole"' >> ${tmpdir}/img/boot/loader.conf
fi

echo " "
echo "### Started writing image to flash drive now ###"
echo "### This will take about 16 minutes ###"
date
dd if=${imgoutfile} of=/dev/da0 bs=1m
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}
}

cleanup

ls -lh ${imgoutfile}

echo "### Script finished ###"





Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4B59AABA.6030301>