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

Marat N.Afanasyev amarat at
Fri Sep 17 14:21:48 UTC 2010

Michael Sperber wrote:
> "Marat N.Afanasyev"<amarat at>  writes:
>> Michael Sperber wrote:
>>> Oliver Fromme<olli at>   writes:
>>>> 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.
>>> Ah, excellent - that's what I was looking for.  Thanks!
>> beware of drago^Wchanging of adX numbers each time you add/remove
>> drive ;) It's better to label filesystems, imho ;)
> This is a rented server, so I no drive will ever be removed or added.
> On the other hand, if I understand it correctly, I'll need to unmount
> the root partition in order to label it - right?
you may try the following commands:

sysctl kern.geom.debugflags=16

foreach fs (your-filesystems)
glabel label your-$fs-label your-$fs-device

echo geom_label_load="YES" >> /boot/loader.conf

and see if the labels appear in /dev/label

SY, Marat

More information about the freebsd-stable mailing list