[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenBSD Overtake - Solution?!

Mario Ohnewald wrote:
> Hello!
> I just had a cool idea!
> I have a Debian box at a root-server hoster such as schlund or hetzner.
> They wont install OpenBSD on my box for me, which i can understand.
> I posted a mail a few days ago, how i could install OpenBSD whilest i am
> running Linux.
> Well, that aint possibel, BUT, what about the following:
> 1.) Disable Swap
> 2.) remove Swap
> 3.) create OpenBSD File System

>From within Linux?
Might be doable...but I'd bet against it.  It MIGHT be able to read a
ffs file system (for all those about to respond to me: no, I really
don't care.  Not one bit), but I suspect there is no disklabel utility
in Linux.

> 4.) Copy/Rsync a OpenBSD system onto it.
> 5.) Edit ip/hostname/driver, etc..
> 6.) write bootloader.

heh.  he said "write a bootloader" hehheh

> What do you think?
> Is it that easy?

heh.  he said "write a boot loader" and "easy".  heh hehe heh.

Unless I missed something, don't think so.  There are at least two
doozies of steps in there...and at least one you neglected (writing
'installboot' that installs OpenBSD's PBR and runs on Linux).  If you
gloss over them, you might as well just simplify your task and say,
"Well, just load OpenBSD on the machine!"

I came up with an idea the other day, but it's really ugly.  No, I'm not
going to flesh it out any better than what follows, if you don't get it,
you can't do it.  I think I get it and I suspect it is highly unlikely
I'd get it right. :)

Prep a very tiny, very minimal OpenBSD system at the front of a hard
disk with similar geometry to your target system (i.e., if you have a
20G drive on the target, don't use a 200M HD, but probably anything
larger than 500M will work).  Config the thing so the network will work
on your target system.  dd the head of this drive (starting at the first
sector, so you get the MBR and partition table, working out to the end
of your OpenBSD partition.) to a file.  Put that file on the target
system.  dd it over the head top of the Linux system, hit the reset
button (DON'T bother shutting it down).  Once this is done, you could
(in theory) boot OpenBSD.  You can now login by remote, edit the OpenBSD
fdisk partition to cover the entire disk, then add additional partitions
 through disklabel.  Your "bootstrap" partition becomes your root

The problem I see with this is if they Linux system opted to write to
what it thought was the Linux file system, corrupting the OpenBSD file
system, and probably crashing in the process (might be solved by seeing
if you could mount those partitions RO).  Ok, there's a lot of other
things that could go wrong, personally, I try to avoid things that
require me to be right on the first try 8)  OBVIOUSLY, you'd have to
test this and practice many times before you do this, I suspect your
"ISP" won't be too fond of you asking your machine to be reimaged

You might be able to wiggle an OpenBSD partition into your swap
partition, or depending on the partitioning, you might be able to
colapse your entire Linux install into its root partition and free up
the rest of the partitions for OpenBSD, and do something similar, but
your image would have to more closely match the destination machine
(i.e., EXACT same spot on the disk).

If the above isn't very clear, I would suggest just assuming the answer
is "no".  You will have to absolutely understand the OpenBSD boot
process to get this to work.  I don't think anyone is going to be
wanting to make an "official" way to do this, and I really don't want to
spend any time on it.  (it is kinda an interesting puzzle, if I were
bored out of my skull, it would be fun to persue, but I am FAR from bored.)

(This sounds like something that was explained to me a while back:
apparently, some ISPs lease the user a complete machine, but it isn't a
full-service system at all.  You blow the install, they reimage it back
to "default".  You maintain the thing.  They do nothing else for you.
Price was attractive, but this is not at all a traditional full-service