DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 2nd November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Question How to create a portable, bootable OpenBSD -NOT INSTALLER-?

I want to create a bootable OpenBSD on a Flash USB or portable hard-disk, BUT I want to access it from any computer; NO don't mean access over internet, I mean I have the flash with OpenBSD on it and can boot it up and work just fine on any other pc not only the one on which the installment occur.

something like a PERSISTENT live linux, I want a persistent live OpenBSD?

any ideas?

I am new to BSD, so please try to clarify your info/ideas/advice
Reply With Quote
  #2   (View Single Post)  
Old 2nd November 2014
ibara's Avatar
ibara ibara is offline
Future Defcon 201 speaker
 
Join Date: Jan 2014
Posts: 631
Default

Install OpenBSD to the external drive like you would an internal drive.
Done.
Reply With Quote
  #3   (View Single Post)  
Old 2nd November 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,297
Default

Quote:
Originally Posted by Crypto333 View Post
I want to create a bootable OpenBSD on a Flash USB or portable hard-disk, BUT I want to access it from any computer; NO don't mean access over internet, I mean I have the flash with OpenBSD on it and can boot it up and work just fine on any other pc not only the one on which the installment occur.
Welcome!

As long as you move to a computer which is capable of booting from USB, what you propose is indeed possible. In fact, this is what we commonly suggest when people ask about compatible hardware -- simply install OpenBSD to a USB flash drive, & empirically test.

Section 14.17.3 of the official FAQ may give you additional information.
Reply With Quote
  #4   (View Single Post)  
Old 2nd November 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,506
Default

It is simple

Before you boot up the OpenBSD installer, insert your USB stick or drive. Then install OpenBSD to the USB stick or drive instead of your regular hard disk drive.

The tricky part is to know how OpenBSD "sees', or as which /dev/sd? device it detects your Flash USB drive.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 2nd November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

Hello, and welcome!

It's easy. USB mass storage devices look and feel like SCSI disk drives. If the BIOS can boot from USB, then you can boot a USB stick that you have installed onto.

Instructions for installing are the same as on any other disk drive -- the only caveat is knowing which sd(4) device number the stick is assigned by the RAMDISK installation kernel.

The OpenBSD FAQ has a specific guide: FAQ 14.17.3. Let us know if you have any specific questions after giving it a try.
Reply With Quote
  #6   (View Single Post)  
Old 8th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Default

Thank you all first.
Selecting my USB was really easy, the problem was with the "dhcp" on the other device or something like that, so my problem is with this "hostname.if(5)" in "/etc0".
how can I fix that considering the fact "Different target machines will likely have different NICs. You could create a bunch of hostname.if(5) files in /etc, each containing just dhcp, for all the NICs you are likely to encounter (fxp0, re0, rl0, bge0, bnx0, em0, etc.) on USB-bootable machines, plus maybe sample wireless config files as well. OpenBSD will ignore all hostname.if(5) files for devices not present at boot time.
You may wish to have a copy of the install files and maybe any desired package .tgz files so you can use the drive as an install media (boot bsd.rd instead of letting it boot normally)" is a bit advanced and confusing for me?
Reply With Quote
  #7   (View Single Post)  
Old 8th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

You can either:
or
Here's an example of a script. It's a fragment of an old script I last used with OpenBSD-5.0, when I was regularly producing live media for CD and DVD. It will need further adaptation -- for instance, it assumes that if you are using WiFi, you are using a default SSID without WPA or WEP encryption.
Code:
# run dhclient on all NICs.  Ignore lo0, pflog0, and enc0
# virtual drivers.

echo 'looking for DHCP servers... Use ^C if needed to stop search'
for NIC in \$(ifconfig | awk -F ":" '/ mtu / {print \$1}')
do
if [ x"\$NIC" == x"lo0" -o x"\$NIC" == x"pflog0" -o x"\$NIC" == x"enc0" ]
  then x=x # null execution
  else
     ifconfig \$NIC | grep -q "status: inactive" \
        && echo skipping \$NIC: status: inactive
     ifconfig \$NIC | grep -q "status: no carrier" \
        && echo skipping \$NIC: status: no carrier
     ifconfig \$NIC | grep -q "status: active" && dhclient \$NIC
     ifconfig \$NIC | grep -q "status:" || dhclient \$NIC 
fi
done
Reply With Quote
  #8   (View Single Post)  
Old 8th November 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,297
Default

Quote:
Originally Posted by Crypto333 View Post
You may wish to have a copy of the install files and maybe any desired package .tgz files so you can use the drive as an install media (boot bsd.rd instead of letting it boot normally)" is a bit advanced and confusing for me?
In addition to jggimi's comments above, you may want to look at Section 4.14 of the official FAQ which discusses ways of customizing the install process.

Unattended installation functionality was added nearly a year ag which was discussed in this article on undeadly.

Last edited by ocicat; 8th November 2014 at 05:58 PM. Reason: Added reference to undeadly article...
Reply With Quote
  #9   (View Single Post)  
Old 12th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Default why?

Quote:
Originally Posted by jggimi View Post
You can either:
or
Here's an example of a script. It's a fragment of an old script I last used with OpenBSD-5.0, when I was regularly producing live media for CD and DVD. It will need further adaptation -- for instance, it assumes that if you are using WiFi, you are using a default SSID without WPA or WEP encryption.
Code:
# run dhclient on all NICs.  Ignore lo0, pflog0, and enc0
# virtual drivers.

echo 'looking for DHCP servers... Use ^C if needed to stop search'
for NIC in \$(ifconfig | awk -F ":" '/ mtu / {print \$1}')
do
if [ x"\$NIC" == x"lo0" -o x"\$NIC" == x"pflog0" -o x"\$NIC" == x"enc0" ]
  then x=x # null execution
  else
     ifconfig \$NIC | grep -q "status: inactive" \
        && echo skipping \$NIC: status: inactive
     ifconfig \$NIC | grep -q "status: no carrier" \
        && echo skipping \$NIC: status: no carrier
     ifconfig \$NIC | grep -q "status: active" && dhclient \$NIC
     ifconfig \$NIC | grep -q "status:" || dhclient \$NIC 
fi
done
why "Ignore lo0, pflog0, and enc0"?
what does "script a solution in rc.local(8)" exactly mean ?
Reply With Quote
Old 12th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Default

my issue is that I can't even startup with it on a different computer due to the dhcp issue.
what to do?
Reply With Quote
Old 12th November 2014
rocket357's Avatar
rocket357 rocket357 is offline
Real Name: Jonathon
Wannabe OpenBSD porter
 
Join Date: Jun 2010
Location: 127.0.0.1
Posts: 429
Default

Quote:
Originally Posted by Crypto333 View Post
You may wish to have a copy of the install files and maybe any desired package .tgz files so you can use the drive as an install media (boot bsd.rd instead of letting it boot normally)" is a bit advanced and confusing for me?
To address this specifically, you can boot up the usb key and do the following:

mkdir -p /`uname -r`/`uname -m`/

Then download the kernels and install sets from pub/OpenBSD/`uname -r`/`uname -m`/{*.tgz,bsd*} and put them in the directory you created. Then, when you boot later, you can choose bsd.rd (the ramdisk "installer" kernel) at the boot prompt, then select "disk" and give it the path /5.5/amd64 (for instance) for the path to the tgz files. That will pull them off the local usb key rather than re-download them.
__________________
Linux/Network-Security Engineer by Profession. OpenBSD user by choice.
Reply With Quote
Old 12th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

Quote:
Originally Posted by Crypto333 View Post
why "Ignore lo0, pflog0, and enc0"?
These are pseudo devices, not real NICs. lo(4) is for loopback traffic, pflog(4) is for optional logging of Packet Filter ("PF") rules applied to network traffic, and enc(4) is for use with filtering or analyzing packets entering or exiting ipsec(4) encryption.

There are other pseudo devices, but if they are used they get created later and are not present at boot time.
Quote:
what does "script a solution in rc.local(8)" exactly mean ?
As described in that man page link, but perhaps insufficiently clearly, /etc/rc is a large script executed during a normal boot, before first log on. If the /etc/rc.local file exists, the script in /etc/rc will execute it.

Admins can use /etc/rc.local for any local, customized procedures they need to have run at boot, before first log on.
Quote:
Originally Posted by Crypto333 View Post
my issue is that I can't even startup with it on a different computer due to the dhcp issue.
what to do?
Manually locate the NIC with ifconfig(8). then issue a dhclient(8) command. This is what the script fragment above actually automates.

Because it does not address wireless NICs, the script does not set SSID name, WPA/WPA2 or (if needed) WEP passphrases. If you are using WiFi, you can set those with ifconfig(8)'s nwid, wpakey, or if needed nwkey.

Last edited by jggimi; 12th November 2014 at 06:28 PM. Reason: typo, clarity
Reply With Quote
Old 13th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Question

http://oi59.tinypic.com/2s9qi5w.jpg

this is basically what shows up when I try to boot from other pc, and it seems I need to get though it before I apply any of your complicated solutions.

simply how can I solve this issue? HELP!

Last edited by ocicat; 14th November 2014 at 01:59 AM. Reason: Please use [url] & [/url] tags to post links.
Reply With Quote
Old 14th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

Wow. A panic during kernel boot, long before you get to init(8) starting up. These messages are produced by OpenBSD in PCI bus management routines for three architechtures: amd64, i386, and sparc64. Its a message I have never seen before, and I found it in the kernel source code by keyword searching. *

If I'm not mistaken, this is a message stating that the hardware does not have Message Signalled Interrupt (MSI) capabilities its Peripheral Component Interconnect (PCI) bus, and the kernel cannot continue operation.

If this is a virtual machine, then there is a problem with its PCI emulation as configured, and the virtual machine configuration may be able to be altered. If this is physical hardware, there may be a BIOS setting that can be adjusted.

---

* /usr/src/sys/arch/{amd64,i386,sparc64}/pci/pci_machdep.c

Last edited by jggimi; 14th November 2014 at 01:29 AM. Reason: clarity, source code footnote
Reply With Quote
Old 14th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

OpenBSD's PCI interrupt mapping is documented here pci_intr_map(9)

While the documentation is designed for the kernel developer, it indicates that pci_intr_disestablish is normally called when a PCI connected device is detached.
Reply With Quote
Old 14th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Default

Quote:
Originally Posted by jggimi View Post
Wow. A panic during kernel boot, long before you get to init(8) starting up. These messages are produced by OpenBSD in PCI bus management routines for three architechtures: amd64, i386, and sparc64. Its a message I have never seen before, and I found it in the kernel source code by keyword searching. *

If I'm not mistaken, this is a message stating that the hardware does not have Message Signalled Interrupt (MSI) capabilities its Peripheral Component Interconnect (PCI) bus, and the kernel cannot continue operation.

If this is a virtual machine, then there is a problem with its PCI emulation as configured, and the virtual machine configuration may be able to be altered. If this is physical hardware, there may be a BIOS setting that can be adjusted.

---

* /usr/src/sys/arch/{amd64,i386,sparc64}/pci/pci_machdep.c
it's my actual computer not a virtual machine
Reply With Quote
Old 14th November 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,354
Default

I can't find any reports of this particular panic, searching the bugs@, misc@, and tech@ mailing lists. The closest match I found was this one from the end of 2012, but its a different MSI-based panic and this one was determined to have a hardware problem as the root cause -- a failing/failed NIC.
Reply With Quote
Old 14th November 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,506
Default

If you are using OpenBSD 5.6 release you could try a snapshot from OpenBSD current and see whether that still panics:
ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/ or ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Old 14th November 2014
Crypto333 Crypto333 is offline
Port Guard
 
Join Date: Oct 2014
Posts: 25
Exclamation try

Quote:
Originally Posted by J65nko View Post
If you are using OpenBSD 5.6 release you could try a snapshot from OpenBSD current and see whether that still panics:
ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/amd64/ or ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/
I will try this version I was using OpenBSD 5.5
Reply With Quote
Old 15th November 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,506
Default

If you are new to OpenBSD I would suggest to first try OpenBSD 5.6 release. If that panics too, you could try a snapshot of what will become OpenBSD 5.7.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Tags
live, openbsd, portable

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
Create a partition for OpenBSD in a multi-boot OS environment cravuhaw2C OpenBSD Installation and Upgrading 9 14th July 2014 09:16 AM
Bootable OpenBSD system image tetra_user OpenBSD Installation and Upgrading 3 23rd June 2014 07:08 AM
OpenBSD OpenBSD forked to create Bitrig J65nko News 32 26th July 2012 07:38 AM
How to Create a Bootable CD from an .iso file rtwingfield FreeBSD Installation and Upgrading 4 22nd June 2010 10:08 AM
OpenBSD: create user sh script J65nko Guides 3 31st January 2010 08:29 PM


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


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