Difference between revisions of "OpenBSD readonly root"

From WTFwiki
Jump to navigation Jump to search
(New page: = Theory = In a lot of situations, you'll find yourself not wanting to check filesystems, thereby<br /> facilitating hard power-downs with ~no data loss. I've come across this case a few...)
 
(add some notes to the ro-root page)
Line 5: Line 5:
 
mostly in the end-user or volatile-power routing environments.  Most often, I've done this<br />
 
mostly in the end-user or volatile-power routing environments.  Most often, I've done this<br />
 
on [http://www.soekris.com/ Soekris] [http://www.soekris.com/net4801.htm net4801] devices.<br />
 
on [http://www.soekris.com/ Soekris] [http://www.soekris.com/net4801.htm net4801] devices.<br />
 +
We'll show an example of how to do it on a net4801, which is the same procedure for a net5501,<br/>
 +
and we'll be using OpenBSD 4.6 for the example.<br/>
 
<br />
 
<br />
 
To perform such a magic trick, you need to do a bit more planning.  It's not as easy to run some<br />
 
To perform such a magic trick, you need to do a bit more planning.  It's not as easy to run some<br />
Line 15: Line 17:
 
= Practice =
 
= Practice =
  
Details here include modifications to config files (/etc/rc, in particular) to make this work.
+
== Installation ==
 +
Perform a PXE-boot standard OpenBSD 4.6 i386 install, the following differences apply:<br/>
 +
* Press ^P at the 5-second BIOS countdown, then "boot f0" to boot from the first ethernet port.
 +
* Interrupt the loader after it gives you a prompt (type anything, it stops the counter).
 +
* Type the following, in this order:
 +
 
 +
  stty com0 19200
 +
  set tty com0
 +
  boot /bsd.rd
 +
 
 +
You should now be booting a kernel and be tossed into the OpenBSD installer.. look elsewhere<br/>
 +
for instructions on how to properly setup PXE booting for OpenBSD, or maybe I'll document it<br/>
 +
someday.<br/>
 +
<br/>
 +
* When installing, you should partition your CF card with 1 giant / partition, and *no swap*
 +
* It'll ask you later on if you want to change the console to com0, tell it yes and choose 19200 to match the soekris BIOS settings.<br/>
 +
* Once installed, reboot into your installation and do basic post-install configuration, including setting up network interfaces, adding packages, configuring sudo, etc.. the idea is to have a fully installed system that just needs configuration.
 +
<br/>
 +
Login and 'sudo ksh' if you haven't already: you'll need to perform a number of steps,<br/>
 +
which I'll detail below.. another time ;)

Revision as of 13:42, 3 December 2009

Theory

In a lot of situations, you'll find yourself not wanting to check filesystems, thereby
facilitating hard power-downs with ~no data loss. I've come across this case a few times,
mostly in the end-user or volatile-power routing environments. Most often, I've done this
on Soekris net4801 devices.
We'll show an example of how to do it on a net4801, which is the same procedure for a net5501,
and we'll be using OpenBSD 4.6 for the example.

To perform such a magic trick, you need to do a bit more planning. It's not as easy to run some
services in a configuration like this, since they need areas to write to. Even worse is when they
need to write data that you actually want to keep. In this case, I like to avoid the RO root
scenario, because it adds some awkward complexity that involves a regular mount-writable/sync/remount-ro
cycle. In general though, most services you can get away with just providing them ramdisk scratch
space.

Practice

Installation

Perform a PXE-boot standard OpenBSD 4.6 i386 install, the following differences apply:

  • Press ^P at the 5-second BIOS countdown, then "boot f0" to boot from the first ethernet port.
  • Interrupt the loader after it gives you a prompt (type anything, it stops the counter).
  • Type the following, in this order:
 stty com0 19200
 set tty com0
 boot /bsd.rd

You should now be booting a kernel and be tossed into the OpenBSD installer.. look elsewhere
for instructions on how to properly setup PXE booting for OpenBSD, or maybe I'll document it
someday.

  • When installing, you should partition your CF card with 1 giant / partition, and *no swap*
  • It'll ask you later on if you want to change the console to com0, tell it yes and choose 19200 to match the soekris BIOS settings.
  • Once installed, reboot into your installation and do basic post-install configuration, including setting up network interfaces, adding packages, configuring sudo, etc.. the idea is to have a fully installed system that just needs configuration.


Login and 'sudo ksh' if you haven't already: you'll need to perform a number of steps,
which I'll detail below.. another time ;)