DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 10th June 2014
XeBuZer0 XeBuZer0 is offline
New User
 
Join Date: Jun 2014
Posts: 2
Thanked 0 Times in 0 Posts
Post Grub and NetBSD

Hello people!!!

I recently have installed NetBSD on my HDD, an it is with ubuntu and windows but it doesn' t boot, I read many tutorials of how to install NetBSD in this way and how to use grub to boot it, so my NetBSD install didn't write anything in MBR, but my grub always show something like "file not found", can you check what is wrong on my grub.cfg file and tell me how to fix it, and how I can heck what's the correct path for my NetBSD partition? that's because NetBSD it's supposed to be installed in the third partition of my HDD, but an "fdisk -l" under ubuntu shows this:


root@xebuzer0-ThinkCentre-Charchina:~# fdisk -l

Disco /dev/sda: 80.0 GB, 80000000000 bytes
255 cabezas, 63 sectores/pista, 9726 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Tamaño de sector (lógico / físico): 512 bytes / 512 bytes
Tamaño E/S (mínimo/óptimo): 512 bytes / 512 bytes
Identificador de disco: 0x45da0464

Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sda1 * 1 26 208813+ 7 HPFS/NTFS
/dev/sda2 27 5126 40959090 7 HPFS/NTFS
La partición 2 no termina en un límite de cilindro.
/dev/sda3 9119 9727 4881836 83 Linux
/dev/sda4 5126 9119 32074689 a9 NetBSD
La partición 4 no termina en un límite de cilindro.

Las entradas de la tabla de particiones no están en el orden del disco (The entries in the partition table are not in disk order)



and, if is usefull an "grub-install -v" shows:

grub-install (GRUB) 1.99~rc1-13ubuntu3

Thanks in advance and greetings


PD: I've read this 2 links without some success
https://help.ubuntu.com/community/Grub2%20Other%20Os
http://daemonforums.org/showthread.php?t=5765
and sorry if is in the wrong category, I'm new at the forum


My grub entry:

menuentry "NetBSD 6.0" {
insmod ufs2
set root=(hd0,3)
knetbsd /netbsd --root=wd0a
}

Last edited by XeBuZer0; 10th June 2014 at 08:26 PM.
Reply With Quote
  #2   (View Single Post)  
Old 11th June 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: 555
Thanked 14 Times in 13 Posts
Default

Hello XeBuZer0, and welcome to the forum!

From your Linux' fdisk output, it appears that there is an ordering issue in your primary partition table. First, note the informative message:

Quote:
The entries in the partition table are not in disk order
In addition, if you look at the start and end locations of the four partitions you have, it appears that the fourth one (which is identified as /dev/sda4 by the OS) is located in the third region of the address space on the disk (for lack of better words). I.e., not in disk order.

I suspect that when you configure grub to boot off (sda0,3) it is probably trying to boot off your Linux partition /dev/sda3, via chain loading. This would fail because to boot Linux you need to load the kernel, not the first sector in the partition. (I must add a disclaimer that I've never used grub, so it's possible I'm off the rails here.)

To fix this problem you could swap the contents of the third and fourth MBR partition table entries (the ones for Linux and NetBSD). This would put them in a natural order. However, this is also a tricky/dangerous job since you could, with one mistake, mess up the partitioning of your disk and lose access to everything.
Therefore I strongly suggest you do not follow this option at this time, and instead consider the following.

As an alternative I would simply try to get grub to boot off the fourth partition, which contains NetBSD. I'm assuming this would be done by using:

set root=(hd0,4)

in the configuration. That should be a safe thing to try.

As a little tip about formatting with the forum software, it would be good to format things like your fdisk output inside of [code] ... [/code] blocks, since it will make it easier to read.

Does this help?

Last edited by IdOp; 11th June 2014 at 03:29 AM.
Reply With Quote
  #3   (View Single Post)  
Old 11th June 2014
bsd-keith bsd-keith is offline
Real Name: Keith
Linux from 1999 & now BSD
 
Join Date: Jun 2014
Location: Surrey/Hants Border, England
Posts: 8
Thanked 0 Times in 0 Posts
Default

Another way to try is to edit the grub boot line when starting. Press 'e' when you see the grub boot screen, highlight the entry to change, press 'e' to actually edit the line, then 'b' to continue booting.

N.B. This is only a tempory change to the grub boot menu, if it works, change the line in /boot/grub/grub.cfg. (/boot/grub/menu.lst if it were legacy grub.)
__________________
Linux since 1999, now a BSD user.
Reply With Quote
  #4   (View Single Post)  
Old 11th June 2014
XeBuZer0 XeBuZer0 is offline
New User
 
Join Date: Jun 2014
Posts: 2
Thanked 0 Times in 0 Posts
Lightbulb

Quote:
Originally Posted by IdOp View Post
Hello XeBuZer0, and welcome to the forum!

From your Linux' fdisk output, it appears that there is an ordering issue in your primary partition table. First, note the informative message:

In addition, if you look at the start and end locations of the four partitions you have, it appears that the fourth one (which is identified as /dev/sda4 by the OS) is located in the third region of the address space on the disk (for lack of better words). I.e., not in disk order.

I suspect that when you configure grub to boot off (sda0,3) it is probably trying to boot off your Linux partition /dev/sda3, via chain loading. This would fail because to boot Linux you need to load the kernel, not the first sector in the partition. (I must add a disclaimer that I've never used grub, so it's possible I'm off the rails here.)

To fix this problem you could swap the contents of the third and fourth MBR partition table entries (the ones for Linux and NetBSD). This would put them in a natural order. However, this is also a tricky/dangerous job since you could, with one mistake, mess up the partitioning of your disk and lose access to everything.
Therefore I strongly suggest you do not follow this option at this time, and instead consider the following.

As an alternative I would simply try to get grub to boot off the fourth partition, which contains NetBSD. I'm assuming this would be done by using:

set root=(hd0,4)

in the configuration. That should be a safe thing to try.

As a little tip about formatting with the forum software, it would be good to format things like your fdisk output inside of [code] ... [/code] blocks, since it will make it easier to read.

Does this help?
I already uninstalled NetBSD deleting the partition and I'll put it again, as a last try before put the partitions on their correct place (fortunately, I didn't have anything yet on NetBSD), and then I'll let you know if changing the partitions works.

And thanks for the tip too, in fact, I tried to format the text of my terminal output but I dunno why it didn't work :/

Quote:
Originally Posted by bsd-keith View Post
Another way to try is to edit the grub boot line when starting. Press 'e' when you see the grub boot screen, highlight the entry to change, press 'e' to actually edit the line, then 'b' to continue booting.

N.B. This is only a tempory change to the grub boot menu, if it works, change the line in /boot/grub/grub.cfg. (/boot/grub/menu.lst if it were legacy grub.)
I've already deleted NetBSD from the partition, but after my second try of install, I'll try that too, just to see if I found a way to boot it from grub command line, and I don't know if was good or wrong, but I downgraded the grub version to 0.97, what do you think? I did it because by some info that found on some places, some commands I used were for that version. Anyway, I'll tell you if I had luck with it

Thanks for the help IdOp and bsd-keith
Reply With Quote
  #5   (View Single Post)  
Old 11th June 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: 555
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by XeBuZer0
I already uninstalled NetBSD deleting the partition and I'll put it again, as a last try before put the partitions on their correct place (fortunately, I didn't have anything yet on NetBSD), and then I'll let you know if changing the partitions works.
Changing the partitions is not a trivial matter, and at this point I would do that only as a last resort, after careful thought and further consultation. For example, if you move the partition data from the 3rd MBR partition table slot to the 4th, this will not be in agreement with you current grub install, nor with what's in your /etc/fstab file, because what used to be sda3 will now be sda4. That means you won't be able to boot Linux as is, you may need a rescue CD, etc.

If you reinstall NetBSD using the 4th MBR slot to describe the 3rd partition area on the disk (just as before), then I would start with bsd-keith's suggestion. Looking at one of the other linked threads, it seems likely

chainloader +1

would also be needed in the grub config, wouldn't it?
Reply With Quote
Reply

Tags
boot, grub, linux, netbsd, ubuntu

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
Grub Secure Boot shep News 0 2nd December 2012 02:01 AM
Booting install.iso from grub. tls OpenBSD Installation and Upgrading 6 5th April 2012 12:12 PM
grub on obsd dennky OpenBSD Packages and Ports 9 14th January 2010 08:21 PM
Dropped to grub terminal, stumped. Jack OpenBSD Installation and Upgrading 3 12th December 2008 03:09 PM
Having trouble adding 7.0 to GRUB 0.97 Arenlor FreeBSD General 4 26th June 2008 01:02 AM


All times are GMT. The time now is 05:16 PM.


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