DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 14th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 227
Default Installing OpenBSD from a USB flash drive

I wanted to upgrade a 5.5-i386 machine to 5.6-i386 with a fresh installation and a new disk partition layout. There were no blank CD's in the house but there was an old USB thumb drive that might do the trick. The FAQ has a section - Creating a bootable install flash drive from Unix - but I suspect that installation method would require network access. Unfortunately, the target machine's wpi(4) network interface requires an fw_update(1) with non-free firmware before it is usable.

This method creates a bootable USB installation device (yeah, I said "installation device" (hey, it's been a long day)) from the contents of the install56.iso CD image.

First, inspect the USB device:

From $ dmesg
sd1: 247MB, 512 bytes/sector, 506880 sectors

This one is ancient and barely has enough capacity but it will work.

Then as root: (in the following, be sure to replace values in red with values from your USB drive)
Code:
vnconfig vnd0 install56.iso
mount /dev/vnd0a /mnt
tar xzf /mnt/5.6/i386/base56.tgz -C /tmp/
dd if=/dev/zero of=disk.img bs=512 count=506880
vnconfig vnd1 disk.img
fdisk -y -f /tmp/usr/mdec/mbr -i vnd1
echo "a\n\n\n\n\nw\nq\n" | disklabel -E vnd1 
newfs /dev/rvnd1a
mkdir /mnt2
mount /dev/vnd1a /mnt2
cp -r /mnt/* /mnt2/
installboot -r /mnt2 vnd1 /tmp/usr/mdec/biosboot /tmp/usr/mdec/boot
dd bs=512 count=506880 if=disk.img of=/dev/rsd1c
umount /mnt
umount /mnt2
vnconfig -u vnd1
vnconfig -u vnd0
rmdir /mnt2
rm disk.img
And that seems to work.
Reply With Quote
  #2   (View Single Post)  
Old 14th February 2015
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,021
Default

I may be missing something here but why not use

install56.fs

with

# # dd if=/location/install56.fs of=/dev/rsd1c bs=1m? This assumes the drive is recognized as sd1.

See the FAQ for more details.

After the install, reformat the usb drive

# newfs -t msdos sd1c

Download the firmware (assuming you have access to a second computer) and copy it to the thumb drive. Load the firmware on the new OpenBSD 5.6 install from the thumb drive, configure wireless and go from there.

What would be kinda of neat would be to mount the image loopback and insert the needed firmware. The Debian developers also share the OpenBSD view on distributing proprietary firmware and have an install option where the firmware can be accessed from removable media (floppy, usb thrumb drives and CD's). I wonder if it is possible to escape to a command prompt during the OpenBSD install and mount a usb drive and load the firmware for a network install?

Last edited by shep; 14th February 2015 at 04:14 PM. Reason: handbook -> FAQ per jggimi's Politically Correct Prodding
Reply With Quote
  #3   (View Single Post)  
Old 14th February 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,791
Default

Quote:
Originally Posted by shep View Post
See the handbook ...
we call it a FAQ.
Quote:
I wonder if it is possible to escape to a command prompt during the OpenBSD install and mount a usb drive and load the firmware for a network install?
Yes, but the RAMDISK kernel has very limited freespace on that ramdisk. A post-install fw_update(1) is much easier.
Reply With Quote
  #4   (View Single Post)  
Old 14th February 2015
ibara's Avatar
ibara ibara is offline
vBSDcon 2017 troublemaker
 
Join Date: Jan 2014
Posts: 450
Default

Quote:
Originally Posted by shep View Post
I wonder if it is possible to escape to a command prompt during the OpenBSD install and mount a usb drive and load the firmware for a network install?
Yes. Lots of people do this. You can drop to a shell by typing ! anywhere in the installer.
Reply With Quote
  #5   (View Single Post)  
Old 14th February 2015
hanzer's Avatar
hanzer hanzer is offline
Real Name: Adam Jensen
just passing through
 
Join Date: Oct 2013
Location: EST USA
Posts: 227
Default

Quote:
Originally Posted by shep View Post
I may be missing something here but why not use install56.fs
Oh geez, I'm retarded. When I saw that in the FAQ, for some bizarre reason I assumed install56.fs was a floppy image meant to be used in some kind of network install. If it's a full install image for a USB device, the method I posted is kind of pointless.

I think I will spend the next Friday the 13th in bed.
Reply With Quote
  #6   (View Single Post)  
Old 14th February 2015
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,021
Default

Quote:
I assumed install56.fs was a floppy image
I think it is a reasonable mistake. Most USB install images are suffixed with *.img The full USB install images were recently made available in OpenBSD and for some reason the project choose to use the same *.fs suffix as the floppy images.
Reply With Quote
  #7   (View Single Post)  
Old 14th February 2015
bsd-keith bsd-keith is offline
Real Name: Keith
Open Source Software user
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 136
Default

Don't sweat it hanzer, that's a neat bit of code for someone new to OBSD.
__________________
Linux since 1999, & now an OpenBSD user.
Reply With Quote
  #8   (View Single Post)  
Old 14th February 2015
ibara's Avatar
ibara ibara is offline
vBSDcon 2017 troublemaker
 
Join Date: Jan 2014
Posts: 450
Default

Quote:
Originally Posted by hanzer View Post
I assumed install56.fs was a floppy image meant to be used in some kind of network install.
That would be floppyXX.fs
Also, check file sizes:
floppy57.fs 13-Feb-2015 14:25 1.4M
install57.fs 13-Feb-2015 14:25 280M

There's also a minirootXX.fs that is a USB installer where you bring your own sets (such as http install).
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I correctly mount a flash drive in OpenBSD? Justin_i OpenBSD General 5 22nd October 2011 05:01 AM
Creating USB flash drive drive image from FreeBSD disc1.iso FBSD Guides 1 10th February 2010 04:42 PM
Installing packages from USB drive (OpenBSD 4.5) divadgnol67 OpenBSD Packages and Ports 26 30th July 2009 04:21 PM
which Flash Drive I must buy for FreeBSD and OpenBSD mfaridi General Hardware 18 22nd October 2008 07:43 PM
USB flash drive criglerj NetBSD General 1 26th July 2008 01:25 AM


All times are GMT. The time now is 10:43 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick