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 1st December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default Installed OpenBSD, and wiped out MBR

Well, all you OpenBSD-ers here made me think I should play with it a bit, so I did one practice install on a VM, then decided to put it on a laptop. It's a laptop without anything important on it, so I figured if worst came to worst, I'd redo everything.
So, I installed OpenBSD, thought I did it right, but when I went to boot I got something like device0, part0, no O/S. I thought I had set the first partition as active to boot--it has a Fedora install. So, dd-ed (is that a word) a Fedora 21 beta to a USB and booted up--it seemed like everything was there, but I was ready to try Fedora 21 anyway so installed it. (I believe I could have recovered everything by just booting it from a live or rescue something and installing grub, but didn't try.)
When I booted the new Fedora install, I added a custom.cfg to its grub to boot my existing FreeBSD-10.1 on it and the new OpenBSD. Rebooted, and OpenBSD booted without problem.
So, I'm a bit annoyed at myself because I'm not sure what I overlooked. Of course, you may say to me, Are you OK with losing your original Fedora install? To which I answer

http://srobb.net/again.mp4


(I've been looking for an excuse to post that all day. And for those of you on the FreeBSD forums, I'll be looking for an excuse there, too).
Reply With Quote
  #2   (View Single Post)  
Old 1st December 2014
ibara's Avatar
ibara ibara is offline
GNU gold linker
 
Join Date: Jan 2014
Posts: 604
Default

Dual booting is hard. I think the FAQ does a good job with hammering that point home.
Though it seems like problem solved for now though until you realize the error of your ways and only have OpenBSD on the laptop.
And yes, dd'ed is a word.
Reply With Quote
  #3   (View Single Post)  
Old 1st December 2014
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Package Pilot
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 208
Default

Quote:
Originally Posted by ibara View Post
Dual booting is hard.
Dual booting some distros and OpenBSD is hard. Dual booting Slackware and OpenBSD is dead simple. I use the Slackware DVD to create an OpenBSD partition (type A6) when I first install Slackware. Then I boot-up my PC and install OpenBSD to the partition. Re-boot back into Slackware and edit my /etc/lilo.conf and add this to the end of it.
other = /dev/sda4
label = OpenBSD
table = /dev/sda
Then run lilo and reboot. Partition sda1 is swap, sda2 is /, and sda3 is /home.
__________________
hitest

Last edited by hitest; 1st December 2014 at 02:28 PM.
Reply With Quote
  #4   (View Single Post)  
Old 1st December 2014
ibara's Avatar
ibara ibara is offline
GNU gold linker
 
Join Date: Jan 2014
Posts: 604
Default

Quote:
Originally Posted by hitest View Post
Dual booting Slackware and OpenBSD is dead simple.
Only because you understand the steps involved; don't conflate the non-triviality of the process with your understanding.
Reply With Quote
  #5   (View Single Post)  
Old 1st December 2014
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Package Pilot
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 208
Default

Quote:
Originally Posted by ibara View Post
Only because you understand the steps involved; don't conflate the non-triviality of the process with your understanding.
Not my intention. Only a rebuttal. My point was that lilo plays very well indeed with OpenBSD.
__________________
hitest
Reply With Quote
  #6   (View Single Post)  
Old 1st December 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,292
Default

I have a dual-boot workstation. It has a small WXP partition for two rarely used applications. So rare, I haven't used either application in more then three years, and if I ever need the disk space then the second OS will be removed. I happen to use sysutils/grub as the workstation's boot manager.
Reply With Quote
  #7   (View Single Post)  
Old 1st December 2014
hitest's Avatar
hitest hitest is offline
Real Name: George Nielsen
Package Pilot
 
Join Date: Sep 2008
Location: B.C., Canada
Posts: 208
Cool

Quote:
Originally Posted by jggimi View Post
I happen to use sysutils/grub as the workstation's boot manager.
Cool. Thanks for the information.
__________________
hitest
Reply With Quote
  #8   (View Single Post)  
Old 1st December 2014
shep shep is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,152
Default

To avoid confusion, OpenBSD's grub port is version 0.97 aka "Grub1"

Grub1 and Lilo both fit into the first two disk sectors.

Grub2, used in recent Fedora versions, occupies the first 4 sectors. If the installation of a second OS overwrites Sectors 3 and 4 of Grub2 you will have problems.
Reply With Quote
  #9   (View Single Post)  
Old 1st December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

With all this talk about how hard it is, I feel that I should have booted with a live CD, mounted the Fedora partition, and reinstalled Grub. As it is, I believe that would have fixed it but have no proof.

It doesn't seem that difficult to me, though after my experience, I'd be more leery doing it with something that I was really afraid of losing. I think I just missed some step or another, especially since googling the error message I got didn't give me any hits--maybe one of those Just Me (TM) things.

At any rate, I was pleasantly surprised that synaptics worked out of the box. I would probably put it on my zenbook too, but it doesn't seem to recognize that machine's wireless card. I installed openbox for my window manager--at some point, I'll have to go back to the thread that was on here about customizing the dwm dwm.c file and try with that.

I dutifully sent in my dmesg. Ah--one thing, which I don't know if it was just a slightly off install or not, but before the wireless worked, I first had to run fw_update (Is that the command--I'm going by memory, I'd have to google it and I'm sort of on my way out.)
Reply With Quote
Old 2nd December 2014
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: New Zealand
Posts: 2,200
Default

This is somewhat uncanny, as I've experienced *exactly* the same problem yesterday, except in my case it was even worse, since I selected "Whole disk", hoping it might mean "Use free space on disk" (stop laughing), and it went ahead and immediately wrote the MBR. Destroying my Linux system.

I managed to get it back with testdisk by the way; so no harm done except 2 hours of wasted time :-/

The OpenBSD installer is *not* very forgiving.

Bonus points for Spaced reference!
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
Old 2nd December 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,292
Default

Quote:
Originally Posted by Carpetsmoker View Post
..I selected "Whole disk", hoping it might mean "Use free space on disk" (stop laughing)
Uh... I'm not laughing. But I'm reminded of another meme.

Reply With Quote
Old 2nd December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

Ok, The Princess Bride reference did make me laugh out loud. (Hopefully my little spaced video did the same for at least a few people.)
Reply With Quote
Old 4th December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

Actually, I suspect it's fairly easy, it's just that there's no easy to find documentation about it.
http://www.openbsd.org/faq/faq4.html#InstDisks

gives a nice step by step for working with your disk, but only if it's the only system. I could swear that older docs give a far clearer explanation--they're probably old as I vaguely remember it talking about sharing a 10 GB disk or something like that. The things I had to fumble with were making sure I was only working with my OpenBSD partition, which I managed, and not overwriting the MBR which I didn't.

Maybe it's my google skills (lacking) or maybe it's just deliberate, but for a system that is famous for good docs, I'm a bit surprised that it's hard to find. The multibooting section gives almost no information about it, it just talks about the bootloader.
http://www.openbsd.org/faq/faq4.html#Multibooting

Googling, I saw a thread from awhile back here, where someone asked someone else to write a wiki and the first person said you're flying before you can walk or something like that. Not that the first person should write a wiki, but, (bold for someone who wrecked their MBR doing it) either there's a relatively simple way to avoid wiping the MBR when another system's grub or whatever has it, or there's not.

It's quite possible the folks coding it don't care too much about multibooting, say it's hard and don't bother working around it wiping the MBR, or just not bother documenting it if they don't care about it.

However, from just ONE attempt, I think the only difficulty is that no one has bothered writing the steps. As an OpenBSD novice, I came pretty close to getting it right, just from guessing.

Well, if I start playing a lot with OpenBSD, I'll figure it out and put up one of my own pages. If I don't start playing a lot with it, it won't really matter to me one way or the other.

I did create a primary partition in advance, and the install saw it.

Anyway, I saw that other parts of this discussion wound up getting out of hand (IMHO), but my impression is that a reasonable step by step doc would make it not hard. And hey, maybe the way it's set up it's supposed to wipe the MBR, in which case, even that's not a big deal. Step whatever, boot from your distribution's liveCD and reinstall grub, or whatever you use. I think there's a WIndows way to do it too, but I don't know, and don't care.

Now, you may ask am I really so selfish, and I have another video for you. The premise is that the man and woman in it are being hunted by a drug dealer, who is giving them an hour's head start.

http://srobb.net/selfish.mp4
Reply With Quote
Old 4th December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

And I should add that there is the section in installing, which is what I think I used.
http://www.openbsd.org/faq/faq4.html#Morefdisk

However, the thing missing is the thing about the MBR. That section details installing when there is not yet an O/S on the disk. I should re-emphasize though, that anything they want to do is fine with me. I think, if there is a relatively simple way to install on a disk with existing installs and avoid writing to MBR, it should be mentioned and I don't see it there. I don't remember exactly what I did at the time, but I am wondering if, like Windows, it will simply overwrite the MBR.

Meh, enough about this. My complaint is simply that I don't see enough information about installing when there are already other systems on the drive. It might be that most OpenBSD developers give OpenBSD a dedicated machine, which is fine. It's a server and developer O/S, as near as I can see, so one shouldn't have to pay that much attention to sharing a disk with another O/S.
Reply With Quote
Old 4th December 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 815
Default

My i386 OpenBSD installs are always on multi-boot machines. About the only precaution I take related to MBR is to have the desired partition flagged as type OpenBSD to begin with, and don't run fdisk in the installer, just use that partition, which it calls the OpenBSD area of the disk. And I also accept the default disklabel. I haven't done one recently enough to have everything fresh in my mind, so hopefully I'm not forgetting something.
Reply With Quote
Old 4th December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

No, that's a clue. I also think that if I installed OpenBSD first, then, say, a Linux install, it would also be easy. Hopefully, over the weekend I'll have a chance to try once or twice. If not, I'll get a chance eventually. Thanks very much for the input. And since I've gotten used to putting something silly in my posts, here's a picture of a happy woman about to ride an elephant that looks like it has a toupee.
http://srobb.net/elephant.jpg
Reply With Quote
Old 4th December 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,292
Default

There are some guidelines for multibooting in applicable INSTALL.<arch> files packaged with releases.

In years past, there was an INSTALL.linux document for the i386 architecture which had guidance, but it was not maintained and was dropped after 5.5. Here's a link to the last version, from 2011:

http://cvsweb.openbsd.org/cgi-bin/cv.../INSTALL.linux
Reply With Quote
Old 4th December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

Thank you for that as well.
Reply With Quote
Old 4th December 2014
scottro's Avatar
scottro scottro is offline
Real Name: Scott Robbins
ISO Quartermaster
 
Join Date: Apr 2008
Location: NYC
Posts: 567
Default

Ok, it's incredibly trivial if you first create an OpenBSD partition with fdisk. As IdOp points out, if you have such a partition, there's no need to run fdisk, you're given the option to make all changes only to the OpenBSD partition.

It seems--I spent a bit of time experimenting--that if one doesn't have an OpenBSD partition, the only option I saw was to edit the MBR, which seems to overwrite the MBR. I didn't feel like doing it a third time to see what happens if I only mark the OpenBSD partition active, but when I chose make the first partition active, it overwrote the MBR and I got that same error--more or less easily fixed by booting an existing Fedora install from a live USB and repairing the MBR. The only issue is that grub didn't want to install because they weren't all grub partitions, but at least it still has a force option.

Anyway, amazingly trivial, and doesn't require more knowledge than how to use fdisk or cfdisk. Shucks, I imagine gparted would work too, but I've done my research for the day.

Anyway, I put up a small page on it, as I'm sure the question will arise again sometime.

http://srobb.net/openbsdmultiboot.html
Reply With Quote
Old 5th December 2014
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 6,292
Default

Quote:
Originally Posted by scottro View Post
...that if one doesn't have an OpenBSD partition, the only option I saw was to edit the MBR, which seems to overwrite the MBR.
Close. If there is no MBR (and the architecture uses 'em), you are given the choice of creating one with fdisk(8) or letting the installer create one that dedicates the drive to OpenBSD -- if you select the latter, the installer just runs fdisk(8) with -i and -y options.

If there is an MBR already in place, you can:
  • Leave it intact if there already is an OpenBSD MBR partition (type 0xa6)
  • Edit the MBR with fdisk(8)
  • Replace it with an MBR that dedicates the drive to OpenBSD.
Editing with fdisk(8) requires the admin to know enough about MBR partitioning to successfully do this. The built-in manual only lists the commands; it is still the admin's responsibility to be able to lay out the MBR partition table if there is only one, and to lay out the chains of tables if there are extended partition tables (logical partitions). In particular, the extended partition chains can be difficult and a number of other MBR management programs automate this for the admin. OpenBSD's fdisk(8) assumes the admin knows how and what they are doing, in order to provide complete flexibility.

Personally, I find the chains of tables required for extended partition tables difficult to deal with, perhaps because I come across them only rarely. Each time, I have to review the EBR linkage structures before touching anything.

Last edited by jggimi; 5th December 2014 at 02:00 AM. Reason: clarity
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
Installed OpenBSD for the first time ..... Some questions bsd007 OpenBSD General 6 20th October 2014 02:55 AM
Pre-installed Groups: What are they for? Greg_Morgan OpenBSD General 5 11th October 2009 01:05 AM
Install NetBSD when DesktopBSD or OpenBSD is installed ahlsner NetBSD General 4 6th August 2009 08:26 PM
Installed 4.3 & No GUI warriors OpenBSD General 24 14th August 2008 11:28 AM
Has anyone installed mod_perl erehwon OpenBSD Packages and Ports 5 23rd June 2008 08:11 PM


All times are GMT. The time now is 04:35 PM.


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