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 14th April 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default Installing for dual boot w/o CD/Floppy

I've just purchased a ASUS netbook, and it came loaded with Win7 starter and nothing but USB ports and memory card slots. I don't own a USB floopy or CD-ROM drive, and don't really want to buy one.

Originally I was thinking, that I would like to install OpenBSD on it and utilize it as a terminal for SSH/X11 to a much more powerful Linux box. Although as is, this damn thing is faster than my 5-year old laptop! So maybe that's a moot point.

Either way, I would kinda like to try OpenBSD on this :-)




My problem is twofold: using only USB (I've got a 4GB stick) or an SD card, how can I both resize the partitions for a dual boot, and install OpenBSD? I assume this will help for doing the USB stick but, the resize, I'm kinda clueless on... lol
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #2   (View Single Post)  
Old 14th April 2011
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by TerryP View Post
My problem is twofold: using only USB (I've got a 4GB stick) or an SD card, how can I both resize the partitions for a dual boot, and install OpenBSD? I assume this will help for doing the USB stick but, the resize, I'm kinda clueless on... lol
I have no idea about resizing partition since I use only one OS per machine. You can try something like GParted? Maybe?

Speaking of installing OpenBSD nothing simpler. Just adjust the boot order so that the BIOS chooses USB stick as the primary boot device. Download all installation sets on a USB stick and boot bsd.rd kernel. The rest is trivial.

You can also do network boot but that would be little bit more complicated.

OKO
Reply With Quote
  #3   (View Single Post)  
Old 14th April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Well, you can shrink the NTFS partition from within Windows.. and if you're tempted, you can use the Windows bootloader to chainload OpenBSD.

I believe it was ocicat who posted instructions for doing that on the forum, you can probably search for them or send him a PM.

If you shrink the partition, make sure OpenBSD's partition starts before 128G on the disk.. -CURRENT won't boot otherwise.

You can prepare a USB drive on OpenBSD to do the installation, just create a MBR partition table.. a disklabel.. newfs, mount, cp /{boot,bsd,xx49.tgz}, and then use installboot(8).

And SD/memory card might work if it's exposed on the USB bus, many are, but some have are PCI devices.. like sdhc(4), you can't usually boot from them if that's the case.

Don't use any custom "flashkey" tools, they're redundant.. perform a regular installation.
Reply With Quote
  #4   (View Single Post)  
Old 14th April 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

@OKO I can't say that I am familiar with doing a network boot, having never done one.

I know Windows is able to resize NTFS partitions since at least XP, but Win7/vista
has gained the ability to resize the one Windows is currently booted and running off?? Preferably, semi-safely?
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #5   (View Single Post)  
Old 14th April 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by TerryP View Post
I assume this will help for doing the USB stick...
This is a good resource -- especially if you take the time to study the appropriate manpages to understand what is going on.
Quote:
...but, the resize, I'm kinda clueless on... lol
  • Go to the Windows 7 Start menu.
  • Right-click on Computer. Select Manage.
  • On the Computer Management window which is then displayed, left click Disk Management.
  • Right-click any logical drive on the installed disk. On the local menu displayed, you will see an option for shrinking the volume. This will non-destructively resize the partition.
There may be a quicker incantation to get to the same end-point, but I don't use Windows much anymore to know all the back roads.
Quote:
Originally Posted by BSDfan666
I believe it was ocicat who posted instructions for doing that on the forum, you can probably search for them or send him a PM.
Instructions for multibooting OpenBSD using Windows' (Vista & Win7) boot manager is in the Guides section:

http://daemonforums.com/showthread.php?t=2879

This has long since been integrated into Section 4.9 of the FAQ as of OpenBSD 4.7. The verbose "Guide" article was written to show the process of discovery. The abbreviated FAQ section is merely to summarize.
Reply With Quote
  #6   (View Single Post)  
Old 14th April 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Maybe it's because I'm a chronic reader, or maybe it's because reading the manual pages make it easier to know how not to foul up, but you can bank I'd be reading the manual pages lol.

Quote:
Originally Posted by TerryP View Post
Win7/vista
has gained the ability to resize the one Windows is currently booted and running off?? Preferably, semi-safely?
I'll take that as a yes then, and have to make a note to watch Microsoft's developments more closely.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #7   (View Single Post)  
Old 14th April 2011
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Terry, you can boot from a USB device rather than network, if you wish. Easy enough to make a bootable stick with bsd.rd and the filesets on it, rather than installing to a USB device. All you need is a running OpenBSD system, then fdisk(8), disklabel(8), newfs(8), cp(1), and installboot(8). Use cp(1) or ftp(1) or whatever(1) to put the kernel and filesets on the stick.

Network boot is fairly easy to set up for i386/amd64, if you'd like to play with it. See pxeboot(8) for the details.
Reply With Quote
  #8   (View Single Post)  
Old 14th April 2011
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Step by step guide for creating a bootable stick -- assuming it's sd0 for these examples, the filesets have been downloaded locally, and that /mnt is currently available. This wipes the stick and dedicates it to OpenBSD as a single partition. Using the stick for other purposes assumes you know how to use fdisk(8) and disklabel(8).
  1. # fdisk -iy sd0
  2. # disklabel -E sd0
  3. z
  4. a a
  5. (press Enter until the "a" partition is created, taking the defaults to create a partition of the entire stick.)
  6. q
  7. y
  8. # newfs sd0a
  9. # mount /dev/sd0a /mnt
  10. # cp /usr/mdec/boot /mnt
  11. # /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd0
  12. # cp /path/to/filesets/{bsd.rd,*.tgz} /mnt
  13. # umount /mnt
Reply With Quote
  #9   (View Single Post)  
Old 14th April 2011
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by jggimi View Post
Step by step guide for creating a bootable stick -- assuming it's sd0 for these examples, the filesets have been downloaded locally, and that /mnt is currently available. This wipes the stick and dedicates it to OpenBSD as a single partition. Using the stick for other purposes assumes you know how to use fdisk(8) and disklabel(8).
  1. # fdisk -iy sd0
  2. # disklabel -E sd0
  3. z
  4. a a
  5. (press Enter until the "a" partition is created, taking the defaults to create a partition of the entire stick.)
  6. q
  7. y
  8. # newfs sd0a
  9. # mount /dev/sd0a /mnt
  10. # cp /usr/mdec/boot /mnt
  11. # /usr/mdec/installboot -v /mnt/boot /usr/mdec/biosboot sd0
  12. # cp /path/to/filesets/{bsd.rd,*.tgz} /mnt
  13. # umount /mnt
It is much easier just to plug USB stick into the computer which has CD drive and do the regular installation on USB stick which should be sdXXX (the number will vary of course but with the system with IDE HDD should be zero). Then set BIOS option in the tablet without CD drive to USB boot. Do the boot from USB stick but boot kernel bsd.rd instead of bsd kernel. You can than proceed with the regular network installation for example or use the sets which you previously downloaded in a designated directory of the USB drive.
If you decide to boot bsd kernel you have just live USB driven computer.

Cheers,
OKO
Reply With Quote
Old 14th April 2011
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

Perhaps. But if one is building the stick from a platform which cannot be shut down to run the installer (in my case, a server without X to run a qemu virtual machine), the simple method above works. As does pxeboot, of course.
Reply With Quote
Old 14th April 2011
Oko's Avatar
Oko Oko is offline
Rc.conf Instructor
 
Join Date: May 2008
Location: Kosovo, Serbia
Posts: 1,102
Default

Quote:
Originally Posted by jggimi View Post
As does pxeboot, of course.
+1 of course that would be my choice
Reply With Quote
Old 15th April 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

C:\windows\system32>bcdedit /create /d "OpenBSD i386" /application bootsector
The entry {be46aff7-443f-11e0-b92a-e47b672fcc86} was successfully created.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} device b
oot
The operation completed successfully.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} path \op
enbsd.pbr
The operation completed successfully.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} device p
artition=c:
The operation completed successfully.

C:\windows\system32>bcdedit /displayorder {be46aff7-443f-11e0-b92a-e47b672fcc86}
/addlast
The operation completed successfully.

C:\windows\system32>

------------------

Installation seems to have went well, other than by the time I figured out that turning "LAN Boot whatsit" in the BIOS to "Disabled" would let it PXE boot, which I figured out while trying to figure out I had to spam ESC to get into a boot menu to boot off the USB stick, because setting removable drive ahead of the HDD doesn't work \o/.

I've done this twice (second time after deleting the first) with the same result:

Code:
C:\windows\system32>bcdedit /create /d "OpenBSD i386" /application bootsector
The entry {be46aff7-443f-11e0-b92a-e47b672fcc86} was successfully created.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} device b
oot
The operation completed successfully.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} path \op
enbsd.pbr
The operation completed successfully.

C:\windows\system32>bcdedit /set {be46aff7-443f-11e0-b92a-e47b672fcc86} device p
artition=c:
The operation completed successfully.

C:\windows\system32>bcdedit /displayorder {be46aff7-443f-11e0-b92a-e47b672fcc86}
 /addlast
The operation completed successfully.

C:\windows\system32>
Note the whacky wrapping is because of copy/paste behaviour in CMD.


When I try to boot OpenBSD, it gives a message about \openbsd.pbr being missing or corrupt. I don't recall missing anything in the guide here or the FAQ (what I was oogling while doing). I have a picture on my phone that can be uploaded for reference but I don't think that's gonna help.

What am I missing here? I'd rather not have to reach for Ubuntu Netbook :-/
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 15th April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

Did you copy the PBR to the NTFS filesystem? that's required for the boot process.
Reply With Quote
Old 15th April 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by TerryP View Post
When I try to boot OpenBSD, it gives a message about \openbsd.pbr being missing or corrupt.
Okay, how did you create the PBR?
Reply With Quote
Old 16th April 2011
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Default

Just did Round 2, to make sure that I document it correctly:

0.) setup USB stick, by way of the above directions.
1.) Booted the netbook off the USB stick with bsd.rd
2.) Used the "Shell" option
3.) Mounted the installation (sd0a) on /mnt
4.) Swapped the USB stick to my laptop
5.) Reformatted it as a FAT32 disk
6.) Mounted it (sd1i) on /mnt2
7.) dd'd the first 512 bytes to /mnt2/openbsd.pbr (dd if=/dev/rsd0a of=/mnt/openbsd.pbr bs=512 count=1)
8.) Umounted the USB stick
9.) Booted into Windows 7
10.) Launched cmd with admin priev'
11.) copy D:\openbsd.pbr C:\openbsd.pbr
12.) Reboot

Now if I try to boot it, it gives a Status of 0xc0000001 with an info of "An unexpected error has occurred". At least, I assumed the raw mode device is supposed to be used rather than the block; and this makes me think that's fine.


I've tried booting it with the systems "boot booster" enabled and disabled for good measure.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
Old 16th April 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by TerryP View Post
dd'd the first 512 bytes to /mnt2/openbsd.pbr (dd if=/dev/rsd0a of=/mnt/openbsd.pbr bs=512 count=1)
What is the device name of the drive you are wanting to dual-boot? Am I correct assuming you are wanting to dual-boot Windows 7 & OpenBSD from the same drive?

The steps enumerated above simply indicate that you have installed OpenBSD to a bootable USB flash drive. I suspect you want to now boot the bsd.rd kernel so you can install OpenBSD to the drive where you have hopefully freed up space. Most laptops still use IDE drives internally, so the device name of your intended boot drive will be wd0 unless it is SATA or SCSI (which I doubt...). Understanding all of Section 4.9 is critical.

Once you install OpenBSD to the same drive where Windows 7 is installed, then you will want to use dd(1) to obtain the PBR & transfer it to Windows 7 boot partition.

However, once OpenBSD is installed, you will need to remember to reset the MBR's active flag using fdisk(1) to the Windows 7 boot partition in order to boot Windows. When the BIOS transfers control to the boot drive, it checks the MBR's active flag to determine which operating system to begin initializing. At that point, you should be able to transfer the correct PBR to Windows' boot partition.

If you are still experiencing problems, post the output of dmesg(8) so we can see the drive topology in play.

Last edited by ocicat; 16th April 2011 at 02:06 AM.
Reply With Quote
Old 16th April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

That's not entirely true, a lot of Windows 7 capable netbooks/laptops default to AHCI mode these days.. in that case sd would indeed be correct.

It would be nice if TerryP shared a dmesg though.
Reply With Quote
Old 16th April 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by BSDfan666 View Post
...in that case sd would indeed be correct.
Given that the information TerryP posted indicates that the USB drive was booted as sd0 tends to make me think otherwise. If AHCI is involved here, then the internal hard drive may be coming up as sd1 following booting from USB. This is why having the dmesg(1) output would be helpful.
Reply With Quote
Old 16th April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

From the information he gave, it seems clear that sd0 is his internal drive.. sd1 is his USB drive.
Reply With Quote
Old 16th April 2011
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by BSDfan666 View Post
From the information he gave, it seems clear that sd0 is his internal drive.. sd1 is his USB drive.
You are correct. That is what I get for trying to compose a response before dashing to catch the train. My bad.
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
boot floppy - internet involved? Lazy FreeBSD Installation and Upgrading 15 26th June 2010 05:14 PM
I can't make FreeBSD floppy/boot image disks under Windows with fdimage Turquoise88 FreeBSD Installation and Upgrading 4 12th November 2008 08:39 PM
dual boot buba OpenBSD General 2 5th August 2008 11:32 AM
Dual-boot laptop won't boot OpenBSD after upgrade to 4.3 kbeaucha OpenBSD Installation and Upgrading 17 30th May 2008 02:40 PM
install Free BSD to boot off a floppy aromes FreeBSD Installation and Upgrading 4 5th May 2008 04:08 AM


All times are GMT. The time now is 09:51 AM.


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