How to predict drive number change for 7.3->8.1 upgrade?

Freddie Cash fjwcash at
Fri Sep 17 16:37:15 UTC 2010

On Fri, Sep 17, 2010 at 5:38 AM, Oliver Fromme <olli at> wrote:
> Michael Sperber <sperber at> wrote:
>  > I just upgraded my desktop system from 7.3 to 8.1, and the main hard
>  > drive, which was /dev/ad6 before is now /dev/ad10.  Consequently, the
>  > initial boot failed when trying to mount the root file system from ad6.
>  >
>  > The desktop system is now fixed, but I also have a rented server with
>  > only a serial console, and I worry that the upgrade is going to leave me
>  > with a dead machine.  Is there any way to predict how the drive number
>  > changes?  (Why does it change at all?)  If so, what's the proper way to
>  > tell the system the initial root device *before* rebooting?
> Remove "options ATA_STATIC_ID" from your kernel config
> before building the new kernel and rebooting.  Then your
> first disk will be ad0, no matter what controller and
> channel it is connected to.  Be sure to update your
> /etc/fstab file.

Problem with doing that (no ATA_STATIC_ID) is that if you change the
order that your PCI devices are enumerated, you will change the order
in which your disks are probed, and all your numbers change again.  :)
 And there's an option for this in every BIOS I've worked with.  Plus,
moving addon controllers from one slot to another will also re-number
your devices.

The best, long-term, solution is to label your devices/filesystems so
that the name never changes, no matter what happsn to the underlying
device nodes.  There are multiple ways to do so, depending on whether
you want to label the disk, the slice, the partition, or the
  - glabe;
  - gpart labels
  - filesystem labels

Freddie Cash
fjwcash at

More information about the freebsd-stable mailing list