# Source upgrade renders system unbootable



## qsecofr (Sep 2, 2011)

Hi,

Trying to upgrade from FreeBSD8.1 to 8.2.  I've been upgrading from source since version 4.6 and have never encountered trouble till now.  System was running 8.1 release with no trouble.  No hardware changes.  No sysctl changes.  No /etc/fstab changes.

I started by csup to grab latest sources.  Checked /usr/src/UPDATING.  Then the following steps as root

```
cp -Rp /etc/etc.old
cd usr/obj
chflags -R noschg *
rm -rf *
cd /usr/src
script ~/110901_buildworld.log
make buildworld
script ~/110901_buildkernel.log
make buildkernel
script ~/110901_installkernel.log
make installkernel
```

All of which finished without error.  I should add that I have port ccache installed.  A post on this forum suggested buildworld and etc worked for them.  And it appeared to work for me.  So I rebooted to single user mode.

That caused problems with messages like

```
TIMEOUT - READ_MUL48 retrying
```
This post suggested a fix
http://freebsd.1045724.n5.nabble.com/HDD-READ-Timeout-messages-after-8-2-Upgrade-td3733475.html

Whether it fixed the issue and exposed another is unknown.  But now I am unable to boot anything.  I can only escape to loader prompt.  Error messages read like

```
Trying to mount root from ufs:/dev/ad8s3a
ROOT MOUNT ERROR:
If you have invalid mount options, reboot, and first try the following from the loader prompt:
  set vfs.root.mountfrom.options=rw
and then remove the invalid mount options from /etc/fstab.

Loader variables:
vfs.root.mountfrom=ufs:/dev/ad8s3a
vfs.root.mountfrom.options=rw

Manual root filesystem specification:
  <fstype>:<device>  Mount <device> using filesystem <fstype>
    eg. ufs:/dev/da0s1a
    eg. cd9660:/dev/acd0
    This is equivalent to: mount -t cd9660 /dev/acd0 /

?   List valid disk boot devices
<empty line> Abort manual input

mountroot>
```

At this point I'm stuck.  Keyboard is not responsive.  At least keystrokes are not echoed to the console..

I can hard reboot.  And I can escape to the loader prompt.  But once at the loader prompt I'm not sure what to do.  Trying to display sysctl variables does not seem to work.  Nor does setting them.  Though I'm not sure what needs to be changed at this point.  I have no idea what is wrong with my /etc/fstab since it hasn't changed.  Trying to boot 
	
	



```
boot /boot/kernel.old
```
 also fails.

Any guidance much appreciated!


----------



## SirDice (Sep 2, 2011)

qsecofr said:
			
		

> I started by csup to grab latest sources.  Checked /usr/src/UPDATING.  Then the following steps as root
> 
> ```
> cp -Rp /etc/etc.old
> ...


Not sure if the last step is a typo or not but these are the proper commands:


```
make buildworld
make buildkernel
make installkernel
# boot to single user mode
make instalworld
mergemaster
# Reboot and make sure everything works
make delete-old
make delete-old-libs
```


----------



## wblock@ (Sep 2, 2011)

There are two or three things that can cause drive numbers to change.  It could be device driver change; depends on the hardware.

With the keyboard not working (USB keyboard?), it's going to be difficult to try different drive addresses (ad0, ad1, ...)

mfsBSD will let you boot and work on the drive.  I strongly suggest using labels, because then at least you don't have to worry about drive device numbers.


----------



## qsecofr (Sep 2, 2011)

@SirDice: typo.  Copy/paste wasn't an option.  I'll edit the post to reflect the actual command used.

@wblock:  I'll try mfsBSD and get going on labels if I can get that far.


----------



## qsecofr (Sep 4, 2011)

I've downloaded and burned the mfsBSD disk, however the system does not wish to boot from CD/DVD drive for some reason.  It is a dual-boot machine with Win7 on the primary and FreeBSD secondary, created with EasyBCD.

My FreeBSD-8.1 DVD is handy, but as above, the machine isn't cooperating by booting from the CD device.  Maybe a BIOS setting?  I'll have to look into that further and/or somehow doing it from Windows.

Would either the bootonly, livefs, or DVD perform equally as well as mfsBSD?  Might be a silly question, but this is a new experience for me.

The only option that "works" is escaping to a loader prompt.  I can 

```
more /etc/fstab
```
and see the device assigned to root is /dev/ad8s3a, and options = rw.  Both of which correspond to the earlier posted error message.  So if a setting is not correct in /etc/fstab, then I'm not sure which setting it is..

The on-screen message occurring just before those posted below reads

```
root mount waiting for: usbus2
```
No idea how that interfered with boot, if it represents a USB device bus. The only USB peripherals attached are the mouse and keyboard.  And maybe then I'm not surprised the keyboard is completely unresponsive at the 
	
	



```
mountroot>
```
 prompt.  Would a USB to PS2 converter device for a mouse work equally well for a keyboard?

Further, I ran a cross a link that seems to point to loader config instruction AHCI.  As linked earlier a post suggested appending 
	
	



```
ahci_load="YES"
```
.  This link suggests poster encountered a similar problem http://forums.pcbsd.org/archive/index.php/t-14044.html.  And so I wonder if I'd be able to change this setting from YES to NO from a loader prompt.  I can 
	
	



```
ls /rescue/vi
```
, but executing it fails.


----------



## wblock@ (Sep 4, 2011)

qsecofr said:
			
		

> I've downloaded and burned the mfsBSD disk, however the system does not wish to boot from CD/DVD drive for some reason.  It is a dual-boot machine with Win7 on the primary and FreeBSD secondary, created with EasyBCD.



Use the BIOS boot menu, if it has one.  Or just enable CD booting.



> Would either the bootonly, livefs, or DVD perform equally as well as mfsBSD?



IME, mfsBSD is superior.  It has the tools and is far less frustrating than the official liveFS stuff.



> The only option that "works" is escaping to a loader prompt.  I can
> 
> ```
> more /etc/fstab
> ...



If AHCI is loaded, disk device names change from ad to ada, and the device numbers are dynamic, always starting at zero.  But this only happens if you loaded AHCI and your system supports it.

Two ways to try.  First, if you loaded AHCI:
[cmd="mountroot>"]ufs:/dev/ada0s3a[/cmd]
This assumes the drive that used to be ad8 is the first drive.  If this works, edit /etc/fstab as a temporary fix, then see FreeBSD Labeled Filesystems to fix it permanently.

The other alternative is to boot the old kernel.  Escape into the loader prompt, then
[cmd="OK"]unload[/cmd]
[cmd="OK"]load /boot/kernel.old/kernel[/cmd]
[cmd="OK"]boot[/cmd]


----------



## qsecofr (Sep 7, 2011)

Thanks for the advice!  Saved me lots of hours.  To re-cap: I tried to rollback as best I could any changes.

I unloaded AHCI from /boot/loader.conf

I enabled booting from CD in the BIOS, but yet still no go with the image of mfsBSD that I burned.  Must've burned incorrectly in Windows, despite the checksum matching.

Booting /boot/kernel.old/kernel did work.  I had read somewhere the old kernel was /boot/kernel.old and that might've been out-of-date or just plain incorrect.

Booting in single-user mode would only work with a PS2 keyboard.  My USB keyboard would not respond.  So I scrounged up a PS2 keyboard and made the labels as advised.  That seems to have done the trick.  How you divined that from the gibberish I posted can only mean you've seen this issue more than you cared to.  

Once system booted in multi-user with some stability, I rolled back to RELENG_8_1.  So at least I've got a consistent kernel & world.  And tackling RELENG_8_2 can be for another day.

Still single-user seems to require a PS2 keyboard.  Even at this stage.  I might just go out and get a decent one as a fail-safe.


----------



## Terry_Kennedy (Sep 7, 2011)

qsecofr said:
			
		

> Would a USB to PS2 converter device for a mouse work equally well for a keyboard?


Even though you marked the issue [Solved], I figured I should answer your question. There are two types of USB-PS/2 adapters.

The first is a simple (passive) device that just tells a dual-mode-capable device to operate in PS/2 mode rather than USB mode. I don't know if there is an industry standard for signaling the USB-PS/2 mode switch. You'd have to try it and see.

The second is a true interface converter, which converts the protocol. These are generally limited to converting PS/2 keyboards and mice to USB, for systems without PS/2 ports. This is because the converter is a USB Device, rather than a USB Host. Being a Device means it acquires power from the Host's USB port, which it uses to power itself and the attached keyboard and/or mouse. Converting USB peripherals to work with a PS/2-only host would require a converter with its own power supply. And there is far less of a market for such a device - systems today are far more likely to omit PS/2 ports than they are to omit a USB port. In fact, I don't know of any production products that do this.

A device like the Belkin F5U119-E will convert PS/2-only devices to be used on a USB-only host system.


----------



## qsecofr (Sep 7, 2011)

The major issue of simple usability is solved.  I'll get back to trying an upgrade to 8.2 again at some point.  Something about my high speed USB v2.0 on both usbus2 & usbus5 seems to be the hangup when things went wrong.  Keyboard must be plugged into either of the two.  And maybe just switching it to an unused USB1 port will overcome that.  Either way I'll be watching it more closely for more clues.


----------



## wblock@ (Sep 7, 2011)

In addition to PS/2 and USB hardware, there's BIOS "legacy USB support".  Enabled, it lets USB devices (generally keyboards) be used in places where only PS/2 devices are normally supported.  Sometimes.  Worth testing with loader and single user mode, might cause problems elsewhere.


----------

