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 4th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default How start OpenBSD using Grub2?

/etc/grub.d/40_custom
Code:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry "OpenBSD" { 
set root=(hd1,4)
chainloader +1 
}
From Ubuntu:
Quote:
# update-grub
$ sudo update-grub
Quote:
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-38-generic
Found initrd image: /boot/initrd.img-2.6.32-38-generic
Found linux image: /boot/vmlinuz-2.6.32-36-generic
Found initrd image: /boot/initrd.img-2.6.32-36-generic
Found linux image: /boot/vmlinuz-2.6.32-35-generic
Found initrd image: /boot/initrd.img-2.6.32-35-generic
Found Scientific Linux release 6.2 (Carbon) on /dev/sda10
done
But ater the reboot i don't see the menu from starting OpenBSD.
As you see previously during the update is never listed OpenBSD and, in effect, during the reboot that entry is never present.

I have tried even these combinations:
1)
Quote:
set root=(hd1,4,a)
chainloader +1
2)
Quote:
set root='(hd1,4)'
chainloader +1
3)
Quote:
set root=(hd1,4)
chainloader +1
boot
but no one work! Damn!!! I tried for half day and i can't start openbsd!

The OS is on the sdb1 (for linux) and wd1 (for openbsd) and i use all the hdd.
Where i'm wrong?

Last edited by aleunix; 4th March 2012 at 11:03 AM.
Reply With Quote
  #2   (View Single Post)  
Old 4th March 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Grub2 counts hard discs from zero but partitions from one! So what has been (hd0,1) in old Grub is now (hd0,2).

Previous NetBSD thread which should work for OpenBSD

Useful link

OpenBSD boot process for i386 and AMD.

In particular
Quote:
Using drive 0, partition 3. <- MBR
Loading.... <- PBR
probing: pc0 com0 com1 apm mem[636k 190M a20=on] <- /boot
disk: fd0 hd0+
>> OpenBSD/i386 BOOT 3.17
boot>
booting hd0a:/bsd 4464500+838332 [58+204240+181750]=0x56cfd0
entry point at 0x100120

[ using 386464 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993 <- Kernel
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2008 OpenBSD. All rights reserved. http://www.OpenBSD.org

OpenBSD 5.0 (GENERIC) #43: Wed Aug 17 10:10:52 MDT 2011
deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
The first stage of the bootloader is hd0a which then chains to the PBR which in a default single hard drive install is drive 0, partition 3 (partitions number 0 ->3)
Reply With Quote
  #3   (View Single Post)  
Old 4th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Ok i have read that links but without result.
$ sudo fdisk -l
Code:
...
Dispositivo Boot      Start         End      Blocks   Id  System
/dev/sdb4   *           1         788     6329578   a6  OpenBSD
wd1
Quote:
rd0a /
rd0b swap
...
Code:
Disco /dev/sdb: 255 testine, 63 settori, 788 cilindri

Nr AF  Hd Sec  Cyl  Hd Sec  Cyl     Start      Size ID
 1 00   0   0    0   0   0    0          0          0 00
 2 00   0   0    0   0   0    0          0          0 00
 3 00   0   0    0   0   0    0          0          0 00
 4 80   1   2    0 254  63  787         64   12659156 a6
Now i'm trying even using:
Code:
$ sudo os-prober
/dev/sda10:Scientific Linux release 6.2 (Carbon):RedHat:linux
But nothing work!
I'm a lot discouraged everytime there is a problem sufficient for block the use of OpenBSD on this computer.
On the old one, i use Grub 1, because i installed it years ago, and worked from the start so i haven't an idea from another working system using Grub 2.

Last edited by aleunix; 4th March 2012 at 04:49 PM.
Reply With Quote
  #4   (View Single Post)  
Old 4th March 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

This entry, in the older partitioning scheme, looks correct to me
Quote:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "OpenBSD" {
set root=(hd1,4)
chainloader +1
}
This suggests that your first hard drive has a gpt table
Quote:
Found Scientific Linux release 6.2 (Carbon) on /dev/sda10
I have not delved into systems with more than 2 OS's and gpt tables but would wonder
1) Would you need an OpenBSD gpt table entry?
2) Where did the Partition Boot Record go in your OpenBSD install?
Reply With Quote
  #5   (View Single Post)  
Old 5th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

I have made a normal install on Linux.
Converting to GPT in Ubuntu
Quote:
When you start gdisk for the first time it will automatically convert the partition tables to GPT
1) I haven't gdisk on my system so i don't think my partitions are GPT.
Also reading Fun with GPT partitioning
Quote:
# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
My output don't speak about GPT.
$ sudo fdisk -l /dev/sdb
Code:
Disco /dev/sdb: 6488 MB, 6488294400 byte
255 testine, 63 settori/tracce, 788 cilindri
Unità = cilindri di 16065 * 512 = 8225280 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x00000000

Dispositivo Boot      Start         End      Blocks   Id  System
/dev/sdb4   *           1         788     6329578   a6  OpenBSD

2) During the installation i have specify wd1 (the second hdd where i have installed openbsd).

Last edited by aleunix; 5th March 2012 at 07:55 AM.
Reply With Quote
  #6   (View Single Post)  
Old 5th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Now i try even:
set root=(hd1,1)
naturally without success.
Reply With Quote
  #7   (View Single Post)  
Old 5th March 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
1) I haven't gdisk on my system so i don't think my partitions are GPT.
Also reading Fun with GPT partitioning
Quote:
# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
The manufacturer of the drive puts the gpt table on the drive. Some manufacturers even put a backup table on the last 2 sectors of the disk. In order to do a vanilla install of NetBSD I ended up zeroing out the first 2 and last 2 sectors of the drive. My understanding was that I could re-write the table if I needed to.
Reply With Quote
  #8   (View Single Post)  
Old 6th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Using the Cd and entering on the system using the Shell i noted one thing strange.
During the installation was said i have two hdd:
wd0 (my main hdd with linux partions)
wd1 (my secondary hdd where i have put openbsd)
While entering i don't found wd1.

#disklabel rd0
Code:
# /dev/rrd0c:
type: unknown
disk: rdroot
label: 
duid: 81cf6d344b7cfed7
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 2
sectors/cylinder: 256
cylinders: 16
total sectors: 3872
boundstart: 0
boundend: 3872
drivedata: 0 

3 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:             3872                0  4.2BSD    512  4096    1 
  c:             3872                0  unused
#fdisk rd0
Code:
Disk: rd0	geometry: 1/1/3872 [3872 Sectors]
Offset: 0	Signature: 0x0
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused
So i make:
#fdisk -u rd0
but during the boot don't start the same.
Now i made another update-grub from linux but on the generation of the grub2 i don't see the same the voice for openbsd.
I made a restart and, naturally, don't work.

I don't understand what happened.
On this secondary hdd for remove linux during the installation i said use the Whole disc while from the above command seem that the partition for openbsd was created but i don't see any partition inside it.

Inside the dmesg I have wd1 for the secondary hdd:
Quote:
wd1 at pciide0 channel 0 drive 1: <FUJITSU MPD3064AT>
wd1: 16-sector PIO, LBA, 6187MB, 12672450 sectors
wd1(pciide0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 4

Last edited by aleunix; 6th March 2012 at 07:53 AM.
Reply With Quote
  #9   (View Single Post)  
Old 7th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

I made a new installation.
I saved the output where now I see wd1.

#fdisk wd1
Code:
Disk: wd1	geometry: 788/255/63 [12672450 Sectors]
Offset: 0	Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   1   2 -    787 254  63 [          64:    12659156 ] OpenBSD
#disklabel wd1
Code:
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: FUJITSU MPD3064A
duid: 4a9473fedc33f0c4
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 788
total sectors: 12672450
boundstart: 64
boundend: 12659220
drivedata: 0 

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:           208768               64  4.2BSD   2048 16384    1 # /mnt
  b:           128533           208832    swap                   
  c:         12672450                0  unused                   
  d:           208832           337376  4.2BSD   2048 16384    1 # /mnt/tmp
  e:           128512           546208  4.2BSD   2048 16384    1 # /mnt/var
  f:          2088448           674720  4.2BSD   2048 16384    1 # /mnt/home
  g:          9896032          2763168  4.2BSD   2048 16384    1 # /mnt/usr
After reboot i make another:
sudo update-grub
but during the regeneration of the menu i don't see OpenBSD so, probably, even this time, nothing.
Well, again,don't work!

Last edited by aleunix; 7th March 2012 at 12:27 PM.
Reply With Quote
Old 7th March 2012
tls tls is offline
Port Guard
 
Join Date: Feb 2012
Posts: 22
Default

I suggest you boot straight into OpenBSD by selecting it from the bios to ensure it boots.

I would also suggest you take a look at how you wired the hard drives. I, for instance, would place my drives in order (sata 1-4) so there is no second guessing as to which drives are which. Grub and linux are on my first drive (sata 1) and OpenBSD is on my second drive (sata 2).

So this would be correct in my case for grub2 entry:
menuentry "OpenBSD" {
set root=(hd1,4)
chainloader +1
}

However, at the time my set root was (hd1,x) so from grub2 I kept playing with combinations until it booted. In your case since you are not seeing a menu entry whatsoever you should edit /boot/grub/grub.cfg directly to ensure you can at least select it from grub2 and adjust (hdx,x) to get it to boot if needed be.
Reply With Quote
Old 7th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

I tried even this one:
Code:
menuentry "OpenBSD" { 
insmod ufs
set root=(hd1,4,a)
chainloader +1 
}
Naturally without success.
Reply With Quote
Old 7th March 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

You are in over my head but I can tell you the OpenBSD default file system is ffs
Quote:
$ cat /etc/fstab
2c939a346e284ad9.b none swap sw
2c939a346e284ad9.a / ffs rw,noatime,softdep 1 1
2c939a346e284ad9.h /home ffs rw,noatime,softdep,nodev,nosuid 1 2
2c939a346e284ad9.d /tmp ffs rw,noatime,softdep,nodev,nosuid 1 2
2c939a346e284ad9.g /usr ffs rw,nodev 1 2
2c939a346e284ad9.e /var ffs rw,noatime,softdep,nodev,nosuid 1 2

Last edited by shep; 7th March 2012 at 06:50 PM. Reason: correct quote brackets
Reply With Quote
Old 7th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

FFS is a UFS variant, and Grub2 may not recognize it. But that should not matter: the chain loader should normally just boot the PBR as directed by the MBR. I can only guess -- not knowing anything about GPT or Grub2 -- that having a mix of GPT and MBR drives may confuse Grub2.

Can the OpenBSD drive be booted from the BIOS?

Is there an option to use something other than Grub2 for multiboot?

Is a separate system available?
Reply With Quote
Old 8th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Quote:
Can the OpenBSD drive be booted from the BIOS?
Yes, i tried this morning for the first time, and actually i'm on OpenBSD booted from the Bios.

Quote:
Is there an option to use something other than Grub2 for multiboot?
Grub2 is the default boot loader for Linux system, at least for this system, a workaround isn't an option.

Quote:
Is a separate system available?
I have a more older computer, where i use Grub1 (installed at the time of Ubuntu 8.04), and everything work but when (from some months) i will update even that computer, i'm worried if happen the same problem and i don't known how fix it.
On this particular case, on the worst case scenario, i can make an exception where i have a 100 mb primary partition that i can reuse, but given that i installed the boot loader automatically during the installation of Linux i don't known how install something different from zero.
Reply With Quote
Old 8th March 2012
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
Grub2 is the default boot loader for Linux system, at least for this system, a workaround isn't an option.
Boot Loaders are rapidly evolving. My understanding is that Grub 1 does not handle gpt tables but Grub 2 will. A third boot loader, syslinux, will also handle gpt tables.
I am not sure about lilo. If you install Arch Linux you actually get the option to use any of the four boot loader's or none at all if you already have a boot loader installed.

The BSD's all have their own boot loaders and my understanding is that they are all different. I believe the FreeBSD 9.0 bootloader will multiboot and on a recent install for me went into a hard drive with a gpt table.
Reply With Quote
Old 8th March 2012
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Now that aleunix has confirmed OpenBSD can be booted from the BIOS, this problem's root cause is either a Grub2 configuration problem, a Grub2 usage problem, or a Grub2 software problem.

I recommend obtaining support from the appropriate GNU mailing list.

http://www.gnu.org/software/grub/
Reply With Quote
Old 8th March 2012
aleunix aleunix is offline
Real Name: Alessandro
Spam Deminer
 
Join Date: May 2008
Location: Italy
Posts: 224
Default

Now i have send a message at:
help-grub
I report here the result if the problem will be solved.
Reply With Quote
Reply

Tags
boot, grub2

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
OpenBSD how to start (basic setup) wesley Guides 4 18th July 2012 06:29 PM
Grub2 and NetBSD Ninguem NetBSD General 0 29th July 2011 03:48 AM
Grub2 sucks. NetBSD won't load. Mr-Biscuit NetBSD General 6 10th March 2011 09:36 PM
Start problem after the installation of OpenBSD 4.6 aleunix OpenBSD Installation and Upgrading 12 21st December 2009 06:59 PM
start KDE on OpenBSD LiveCD ccc OpenBSD Installation and Upgrading 5 3rd November 2008 10:24 PM


All times are GMT. The time now is 08:57 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