# FreeBSD 7.1 won't boot loader



## glenn (Feb 19, 2009)

Hello,

I've installed FreeBSD 7.1 on my main desktop machine, and it won't boot /boot/loader.   The error I get is :

"Can't work out which disk we're booting from.  Defaulting to disk0"   Which after a while panics and crashes.

I'm able to choose option 6 and go to the boot menu, where I can run:

boot /boot/kernel/kernel

and the system comes up fine.

I've tried installing 7.0 instead, and got the same issue.  I've tried dd mode, and still, the same thing.

Any ideas?

Thanks


----------



## trev (Feb 20, 2009)

Is this an IDE drive? If so, is the boot drive the master?


----------



## glenn (Feb 20, 2009)

It is an IDE drive, and it is the master.  I've even tried removing the second drive, and I still have the issue.


Thanks,
Glenn


----------



## trev (Feb 21, 2009)

Is it on the PRIMARY IDE controller?


----------



## glenn (Feb 21, 2009)

Yes, it is on the Primary IDE controller.


----------



## trev (Feb 21, 2009)

From /usr/src/sys/boot/i386/loader/main.c


```
/*
     * If we are booting off of a BIOS disk and we didn't succeed in determining
     * which one we booted off of, just use disk0: as a reasonable default.
     */
    if ((new_currdev.d_type == biosdisk.dv_type) &&
        ((new_currdev.d_unit = bd_bios2unit(biosdev)) == -1)) {
        printf("Can't work out which disk we are booting from.\n"
               "Guessed BIOS device 0x%x not found by probes, defaulting to disk
0:\n", biosdev);
        new_currdev.d_unit = 0;
    }
```

Hmmm. 

1) Have you tried updating your motherboard BIOS to the latest version?

2) You only have two IDE drives on the primary controller and no other disks/CDROMs?


----------



## glenn (Feb 24, 2009)

Trev,

Thanks for your reponses.

1) Yes, I looked at upgrading the MB bios, but as far as I can tell I have the latest version, but that doesn't mean the bios isn't a culprit (it's a Sony Vaio).

2)  I have two IDE drives on the primary controller, and two CDr's on the secondary IDE controller.  I've removed everything except the master IDE drive, and still get the same results.


Seems like I'm booting off of the bios drive just fine, and it's processing my /boot/loader.conf file, but it never seems to pick up the root disk or boot device:


root_disk_unit="0"
rootdev=""disk1s1a"

I've even added tried to set the current device, but same results:

currdev="disk1s1a"


hmmm indeed!


----------



## trev (Feb 26, 2009)

Probably clutching at straws...

What do you have in /etc/fstab for the root file system?


----------



## glenn (Feb 26, 2009)

Hi Trev,

Thanks for your continued efforts.  For root I have:

#Device       Mountpoint  FStype   Options   Dump  Pass#
/dev/ad0s1a   /           ufs      rw        1      1


----------



## trev (Feb 26, 2009)

Hmmm... try adding these to loader.conf:


```
root_disk_unit="0"
	currdev="disk0s1a"
	rootdev="disk0s1a"
	vfs.root.mountfrom="ufs:ad0s1a"
```

If that still doesn't have the desired result, it would be interesting to see the output of:


```
kenv -q | grep disk
kenv -q | grep vfs
```

when you manually boot successfully.


----------



## jponiato (Apr 11, 2009)

I'm having the same issue.  I had a perfectly good running system with 7.0.  I used freebsd-update to upgrade to 7.1.  After the first reboot in the process, I saw the same error ("Can't work out which disk we're booting from. Defaulting to disk0").  I've tried re-installing 7.1 with a complete internet-based install, but the problem persists.  I even dropped all partitions on the primary drive, removed the second drive, and let sysinstall re-partition and lable the drive.  No dice.  I may try going back to 7.0, but it sounds like this did not work for the OP.


----------



## jponiato (Apr 11, 2009)

Additional info:
Dell Dimension 2350 BIOS Version A02 (seems to be the latest)

FreeBSD 7.1-RELEASE release notes says that "The BTX kernel used by the boot loader has been changed to invoke BIOS routines from real mode. This change makes it possible to boot FreeBSD from USB devices."  So maybe the problem arises from some incompatible BIOSes.

Reverted back to 7.0 using a 7.1 install disk but changing the release in the Options menu and entering "ftp://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/7.0-RELEASE/" as the ftp url.

This worked, and I'll run this way until a fix for this situation surfaces.


----------



## glenn (Apr 11, 2009)

Interesting. In my travails I'd heard that you can boot 7.1 by copying the 7.0 version of /boot/loader. You may want to try that if you want to upgrade. 

In my case, I've never been able to boot FreeBSD on this machine, which is a Sony VAIO.  I'm able to boot it manually, and since I rarely reboot the machine I considered this an acceptable work around.  Yes, I would like to fix the issue but with other fish to fry  I put this on the back burner, to mix cooking metaphors.

Trev, here are the output of the commands you asked for:

```
bee# kenv -q | grep disk
currdev="disk1s1a"
loaddev="disk1s1a:"
root_disk_unit="0"
rootdev="disk1s1a"

bee# kenv -q | grep vfs
vfs.root.mountfrom="ufs:/dev/ad0s1a"
```


I tried your suggested settings, and variations on them, but I always get the same result.

~Glenn


----------



## trev (Apr 12, 2009)

glenn said:
			
		

> Trev, here are the output of the commands you asked for:
> 
> ```
> bee# kenv -q | grep disk
> ...



Interesting... when you boot it successfully manually, it believes it's booting from disk1 and not disk0. Have you tried setting those boot loader variables to disk1? (I dunno, maybe Sony are numbering the disks in BIOS from 1 rather than zero.)


----------



## trev (Apr 19, 2009)

I see from last night's source update to 7.2-PRE-RELEASE that the bios disk code has been modified:

"Edit src/sys/boot/i386/libi386/biosdisk.c"

Never know, might help.


----------



## glenn (Oct 28, 2009)

To wrap this up, I waited until the official 7.2 release, upgraded to that, and the machine now boots just fine.

Thanks for all of your input,
Glenn


----------

