# Boot failure with upgrade



## Speedy (Jun 28, 2012)

Running FreeBSD 9.0-PRERELEASE #2 right now. Wanted to upgrade to current RELEASE. The kernel boots, but mounting partitions fails. I haven't read all the news nor have I followed changelogs. Has there been a change of device naming convention? I do not recognize the devices that are offered as valid.


----------



## SirDice (Jun 29, 2012)

See /usr/src/UPDATING:

```
20110424:
        The GENERIC kernels for all architectures now default to the new
        CAM-based ATA stack. It means that all legacy ATA drivers were
        removed and replaced by respective CAM drivers. If you are using
        ATA device names in /etc/fstab or other places, make sure to update
        them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY,
        where 'Y's are the sequential numbers starting from zero for each type
        in order of detection, unless configured otherwise with tunables,
        see cam(4)). There will be symbolic links created in /dev/ to map
        old adX devices to the respective adaY. They should provide basic
        compatibility for file systems mounting in most cases, but they do
        not support old user-level APIs and do not have respective providers
        in GEOM. Consider using updated management tools with new device names.

        It is possible to load devices ahci, ata, siis and mvs as modules,
        but option ATA_CAM should remain in kernel configuration to make ata
        module work as CAM driver supporting legacy ATA controllers. Device ata
        still can be used in modular fashion (atacore + ...). Modules atadisk
        and atapi* are not used and won't affect operation in ATA_CAM mode.
        Note that to use CAM-based ATA kernel should include CAM devices
        scbus, pass, da (or explicitly ada), cd and optionally others. All of
        them are parts of the cam module.

        ataraid(4) functionality is now supported by the RAID GEOM class.
        To use it you can load geom_raid kernel module and use graid(8) tool
        for management. Instead of /dev/arX device names, use /dev/raid/rX.

        No kernel config options or code have been removed, so if a problem
        arises, please report it and optionally revert to the old ATA stack.
        In order to do it you can remove from the kernel config:
            options        ATA_CAM
            device         ahci
            device         mvs
            device         siis
        , and instead add back:
            device         atadisk         # ATA disk drives
            device         ataraid         # ATA RAID drives
            device         atapicd         # ATAPI CDROM drives
            device         atapifd         # ATAPI floppy drives
            device         atapist         # ATAPI tape drives
```


----------



## Speedy (Jun 30, 2012)

Thanks. :r


----------



## Speedy (Jul 4, 2012)

Still didn't boot. I had devices like ad0s1a, the new device is ada0a, etc. When the slice part was dropped?


----------



## wblock@ (Jul 4, 2012)

Nothing was dropped, only the device names changed.  So ad0s1a becomes ada0s1a.  There should also be aliases to the old names.

However, ada(4) uses relative addressing.  The first drive found will be ada0.  The older ad(4) was usually static.  So what was ad4 may now show up as ada0.  dmesg(8) should show the old and new drive names.


----------



## Speedy (Jul 4, 2012)

Hmm ... here is my old fstab.


```
cat /etc/fstab.bak 
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad0s1b             none            swap    sw              0       0
/dev/ad0s1a             /               ufs     rw              1       1
/dev/ad0s1e             /tmp            ufs     rw              2       2
/dev/ad0s1f             /usr            ufs     rw              2       2
/dev/ad0s1d             /var            ufs     rw              2       2
```
Here is what I have now.


```
ls /dev/ad*
/dev/ad0        /dev/ad0b       /dev/ad0e       /dev/ada0       /dev/ada0b      /dev/ada0e
/dev/ad0a       /dev/ad0d       /dev/ad0f       /dev/ada0a      /dev/ada0d      /dev/ada0f
```


----------



## wblock@ (Jul 5, 2012)

Doing the wrong thing with bsdlabel(8) could have done that, maybe (erasing the MBR but leaving the disklabel).  How did you upgrade?


----------



## Speedy (Jul 5, 2012)

This hard drive has been there for a while. Methinks in the beginning it did not have a MS-DOS partition table. It was installed in dedicated mode, slice to raw device. Then, I think FreeBSD dropped support for dedicated mode and I created a partition table in order to upgrade.
Right now it works ...

```
$ cat /etc/fstab
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ada0b              none            swap    sw              0       0
/dev/ada0a              /               ufs     rw              1       1
/dev/ada0e              /tmp            ufs     rw              2       2
/dev/ada0f              /usr            ufs     rw              2       2
/dev/ada0d              /var            ufs     rw              2       2
```
Go figure ...

Edit: Forgot to answer your question. I always sync the sources and go the make buildworld way.


----------



## kpa (Jul 5, 2012)

It's possible that the earlier versions of FreeBSD presented the "dangerously dedicated disk" as having a slice ad0s1 where FreeBSD 9 dropped the s1 from the device names.

A dangerously dedicated disk does have an MBR and a slice table but they are there just to enable booting because the BIOS expects those to be in place on a bootable disk. The first 512 byte sector of /boot/boot image contains them and there is actually a slice in the slice table but it's just a bogus slice that covers the whole disk.


----------



## wblock@ (Jul 5, 2012)

Support for dangerously dedicated is still there.  Newer versions of GEOM are pickier about disk structures, and it sounds like it's not falling for a not-quite-right MBR.  I'd back up and repartition to avoid surprises in the future.


----------

