Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2014 11:24:22 -0700
From:      Jin Guojun <jguojun@sbcglobal.net>
To:        Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com>
Cc:        "hackers@freebsd.org" <hackers@freebsd.org>, questions freebsd <questions@freebsd.org>
Subject:   Re: Inproper ada# assignment in 10-BETA2
Message-ID:  <1411928662.22540.YahooMailNeo@web180901.mail.ne1.yahoo.com>
In-Reply-To: <CAOgwaMu71N0697+DUOJC7cy-Z3XenEGxwKLY+-q_LoMZLgPY6w@mail.gmail.com>
References:  <1411851225.9364.YahooMailNeo@web180902.mail.ne1.yahoo.com> <CAOgwaMu71N0697+DUOJC7cy-Z3XenEGxwKLY+-q_LoMZLgPY6w@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
No, BIOS boot is completely irrelevant to this problem. 

It looks like I have to re-address this issue debated 15-20 years ago.

First of all, let's clear BIOS question so you will not argue it again.
BIOS boot sequence can be specified in any order, and it boots desired  drive correctly. 

If not, 10.1-BETA2 will not be loaded, and we will not see this problem, period.

After 10.1-BETA2 is loaded and booted, it enumerates drive(s) dynamically to assign ID to ada or da node. 

Kernel clearly knows which drive is ad1, 2, 3, ..., but it does not assigned proper ID to existing drive(s) for ada and da nodes. 

That is, ad note IDs are still correct, but ada and da node IDs are wrong.

The dynamic enumeration is likely used for moving a boot drive from on system to another
or from one bus to another without manually modifying fstab entries.
That is, this mechanism wants to ensure no matter where this drive is plugged in, 

Boot drive should be always enumerated as ID 0 or the ID installation assigned to.

How to ensure this? For boot drive, this is relatively easy -- the boot drive is always this first one in general, 

so this drive should always enumerated as ada0 or da0.
If installation has assigned drive ID to not 0 somehow, then generic enumeration apply.
Generic enumeration is drive serial number (S#) based enumeration mechanism, which has been used for at least two decades. 
For example, if two drives installed and their S# are AAAA and XXXXX (boot drive),
regardless what SATA port they resides at -- AAAA at ad9 and XXXXX at ad5,
We knew installation will likely name drive XXXXX as ada0 and AAAA as ada1. 
In fixed fashion, drive XXXXX is ad5 and AAAA is ad9, when a new drive is inserted as ad0, 

we knew drive XXXXX will be still ad5 and boot should not fail.
But in current 10.1-BETA2, the new drive is likely will be ada0, drive XXXXX will be ada1, and AAAA will be ada2, then boot will fail.
In case if new drive is inserted as ad8, drive XXXXX will remain as ada0 but AAAA will be ada21.
Even though boot will succeed in this case, but mounting drive AAAA will fail.


The S#-based enumeration will record the S# for corresponding device ID in a dynamic boot configuration file, which is used in boot time to determine what device ID should be assigned to each drive.
After existing drive ID has been enumerated, any new drive(s) will be given a unused ID sequentially.
This ensures that existing drive(s) will always get device ID originally assigned to, so the disk mounting operation will never fail no matter where a disk drive (has FreeBSD already installed) is plugged in.


Hopefully, this explains what is correct the dynamic enumeration operation.
In old time, we have a mechanisms to alter the dynamic enumeration to fixed one, but I do not know if this mechanism is still in 10.x-R.

Because it looks like that current developers have no knowledge about this concept,
I am going to open a bug to track this problem again soon, unless I will hear if we have a work around for this problem.



On Saturday, September 27, 2014 3:15 PM, Mehmet Erol Sanliturk <m.e.sanliturk@gmail.com> wrote:
 






On Sat, Sep 27, 2014 at 1:53 PM, Jin Guojun <jguojun@sbcglobal.net> wrote:

Installed 10-BETA2 on SATA port 4 (ad8) and then added another SATA port 3 (ad6), the system has not correctly enumerate the ada # for the boot device.
>As original boot (without the second SATA drive), the ad8 is enumerated as ada0 -- the boot drive:
>
>Sep 24 22:51:30 R10-B2 kernel: ada0 at ahcich2 bus 0 scbus2 target 0 lun 0
>Sep 24 22:51:30 R10-B2 kernel: ada0: <Hitachi HDP725050GLA360 GM4OA50E> ATA-8 SATA 2.x device
>...
>Sep 24 22:51:30 R10-B2 kernel: ada0: Previously was known as ad8
>
>
>However, after added another SATA drive (ad6), this new drive is assigned to ada0, but ad8 has changed to ada1. This is incorrect dynamic device assignment. FreeBSD has kept using fixed disk ID assignment due to the same problem introduced in around 4-R (or may be slightly later), and after a simple debate, a decision was made to use fixed drive ID to avoid such hassle.
>
>If now we want to use dynamic enumeration for drive ID# assignment, this has to be done correctly -- boot drive MUST assigned to 0 or whatever the # as installation assigned to; otherwise, adding a new drive will cause system not bootable, or make other existing drive not mountable due to enumeration # changes.
>
>Has this been reported as a known problem for 10-R, or shall I open a bug to track?
>
>-Jin
>




One point should be checked :


On mainboards SATA ports are numbered from 0  or 1 to  upward .

BIOS always uses first SATA drive for boot .  This is NOT related to the operating system .

Therefore , it is necessary to check port numbers of existing drives and the bootable SATA drive should be connected

to the smallest numbered SATA port among existent drives .



For example , assume bootable drive is connected to SATA port 2 . 

New drive should be connected to a higher numbered SATA port .

If there are only two SATA ports , then bootable drive should be connected to the first SATA port .


If mainboard BIOS allows definition of any SATA port for boot , and bootable SATA port and drive is specified in there , again it may boot from that drive . Up to now , I did not see any BIOS which supplies such an ordering among SATA ports . Please check your BIOS for such a feature . If it is present you may use it , otherwise it is necessary to reconnect SATA cables .



Thank you very much .


Mehmet Erol Sanliturk
From owner-freebsd-questions@FreeBSD.ORG  Sun Sep 28 18:36:14 2014
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
Delivered-To: freebsd-questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id E97F04CD
 for <freebsd-questions@freebsd.org>; Sun, 28 Sep 2014 18:36:14 +0000 (UTC)
Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com
 [IPv6:2607:f8b0:4002:c01::230])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A64C1768
 for <freebsd-questions@freebsd.org>; Sun, 28 Sep 2014 18:36:14 +0000 (UTC)
Received: by mail-yh0-f48.google.com with SMTP id c41so1259713yho.21
 for <freebsd-questions@freebsd.org>; Sun, 28 Sep 2014 11:36:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=rvfzoNOlKS1SFKl7vjVC5pxd5OXhgsyRC2nMf93qoxs=;
 b=AGYxm5+8yGkHTfTzVO64gL5ZJuo6L/gU0F+Jglg2EW3pZdFdJdwffn1l4F7Yg0/vQz
 XjbLZlsgrx3KlfeoRSZcfWHZ2G0MEdUF7H2v/8VERk0RVLwQnhBWG0/20erz23QhKRSl
 nUtjKf2ORWBftmR5SPOwNS3D/V70jPXvNCfdL8xbe33ULbpRcOKeWoFpswkj6tDqt5HG
 E3S1XTzKAsb9xg8gQ3dt3R3CZT09nwXJsGj47ni/SXWQnsKzDj8uJbZdoqJYgRDpLsRq
 YMKNq8PfWuiTKoBU6sFb6StaD4/Z/htUD+iRxiDSN3qJhpnWNJ1NvU87xQX1QmY1jcMG
 3lRg==
MIME-Version: 1.0
X-Received: by 10.236.164.38 with SMTP id b26mr4168296yhl.2.1411929373710;
 Sun, 28 Sep 2014 11:36:13 -0700 (PDT)
Received: by 10.170.150.213 with HTTP; Sun, 28 Sep 2014 11:36:13 -0700 (PDT)
In-Reply-To: <50282.76.192.184.214.1411925201.squirrel@cosmo.uchicago.edu>
References: <CAHcg-UFTm5+UvFK7QpNXa0bkadupLt10LmgksGKyuT2vTDtAbg@mail.gmail.com>
 <23187F4C-0413-4F84-9C86-6EC1084C794C@btinternet.com>
 <CAHcg-UHdQyR-Ok+17ZMPvOqW3fUo__ftw=1VOK4ZgTSTNGp4-Q@mail.gmail.com>
 <CAD=tpefTA7rsBSvyA6ewm2sgtyRFuX_KL5k9Rrm8qSV4AtsxsQ@mail.gmail.com>
 <CAHcg-UH5f3fATsrcVi4LAoxhM5Wb8-WXJCTOAkVnBKzzqnLdhA@mail.gmail.com>
 <50282.76.192.184.214.1411925201.squirrel@cosmo.uchicago.edu>
Date: Sun, 28 Sep 2014 14:36:13 -0400
Message-ID: <CAD=tpeemsSXBOz0O0ofvpiuCfJKbXcVBSf1MMrsHffSZcuqHjg@mail.gmail.com>
Subject: Re: freebsd-update question
From: FF <fusionfoto@gmail.com>
To: galtsev@kicp.uchicago.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1
Cc: "firmdog@gmail.com" <firmdog@gmail.com>,
 "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>,
 Dave <davemorgan353@btinternet.com>
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/>;
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
 <mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sun, 28 Sep 2014 18:36:15 -0000

So your kernel won't be updated because you are running a custom kernel.
Your uname is based on the running kernel.

If you want to confirm that you've in fact updated, you can reboot to the
GENERIC kernel which will confirm you are at 8.4 or whatever. FreeBSD
update is a binary update based on the release versions -- deviate from
them and it doesn't break, but it can't touch those files.

Since you know enough to put a custom kernel on there, you should follow
the source rebuild instructions which would be basically be to svn down the
whole 8.4 source tree, make the world, make the kernel and install it,
reboot, and install the world.

I think the directions are in the FreeBSD handbook.

Best,



On Sun, Sep 28, 2014 at 1:26 PM, Valeri Galtsev <galtsev@kicp.uchicago.edu>
wrote:

>
> On Sun, September 28, 2014 10:01 am, firmdog@gmail.com wrote:
> > I just installed a brand new 8.3 box and got the same behavior. I see
> > in my output below that I have to build or update my own kernel?
> >
> >
> > # uname -a
> > FreeBSD 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Tue Apr 10 17:33:58 UTC
> > 2012     root@mynewhost:/usr/obj/i386/usr/src/sys/XENHVM  i386
> > #
> >
> > Starting the upgrade attempt:
> >
> > # freebsd-update -r 8.4-RELEASE upgrade
> > Looking up update.FreeBSD.org mirrors... 5 mirrors found.
> > Fetching public key from update6.freebsd.org... done.
> > Fetching metadata signature for 8.3-RELEASE from update6.freebsd.org...
> > done.
> > Fetching metadata index... done.
> > Fetching 2 metadata files... done.
> > Inspecting system... done.
> >
> > WARNING: This system is running a "xenhvm" kernel, which is not a
> > kernel configuration distributed as part of FreeBSD 8.3-RELEASE.
> > This kernel will not be updated: you MUST update the kernel manually
> > before running "/usr/sbin/freebsd-update install".
> >
> > The following components of FreeBSD seem to be installed:
> > src/base src/bin src/cddl src/contrib src/crypto src/etc src/games
> > src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
> > src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
> > world/base world/dict world/doc world/games world/info world/manpages
> > world/proflibs
> >
> > The following components of FreeBSD do not seem to be installed:
> > kernel/generic world/catpages
> >
> > Does this look reasonable (y/n)? y
> >
> > Fetching metadata signature for 8.4-RELEASE from update6.freebsd.org...
> > done.
> > Fetching metadata index... done.
> > Fetching 1 metadata patches. done.
> > Applying metadata patches... done.
> > Fetching 1 metadata files... done.
> > Inspecting system... done.
> > Fetching files from 8.3-RELEASE for merging... done.
> > Preparing to download files...
> > done.
> > Fetching 32149
> >
> patches.....10....20....30....40....50....60....70....80....90....100....=
110....120....130....140....150....160....170....180....
> > SNIP=E2=80=A6.
> > done.
> > Applying patches...
> > Fetching 778 files... done.
> > Attempting to automatically merge changes in files... done.
> >
> > The following file could not be merged automatically: /etc/mail/
> freebsd.cf
> > Press Enter to edit this file in vi and resolve the conflicts
> > manually...
> >
> > Then a bunch more of /etc/mail files and also a merge of
> > /etc/master.passwd:
> >
> > Then this:
> >
> > The following files will be updated as part of updating to
> > 8.4-RELEASE-p16:
> >
> > Then I run this:
> >
> > # freebsd-update install
> > Installing updates...
> > Kernel updates have been installed.  Please reboot and run
> > "/usr/sbin/freebsd-update install" again to finish installing updates.
> >
> > # reboot
> >
>
> In last message before reboot it instructed to "reboot then run
>
> /usr/sbin/freebsd-update install
>
> again". Did you run "freebsd-update install" after reboot?
>
> Valeri
>
> >
> > #uname -a
> > FreeBSD 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Tue Apr 10 17:33:58 UTC
> > 2012     root@mynewhost:/usr/obj/i386/usr/src/sys/XENHVM  i386
> >
> >
> >
> >
> >
> >
> > On Sun, Sep 28, 2014 at 5:06 AM, FF <fusionfoto@gmail.com> wrote:
> >> Can you provide the output of those commands? Freebsd-update is usuall=
y
> >> pretty good about telling you what's wrong.
> >>
> >> Thanks
> >>
> >> On Sat, Sep 27, 2014 at 3:02 PM, firmdog@gmail.com <firmdog@gmail.com>
> >> wrote:
> >>>
> >>> Yes I ran freebsd-update install. Then I rebooted. Then I did it agai=
n.
> >>> Still at 8.3
> >>> On Sep 27, 2014 2:37 PM, "Dave" <davemorgan353@btinternet.com> wrote:
> >>>
> >>> > On 27 September 2014 18:22:15 BST, "firmdog@gmail.com"
> >>> > <firmdog@gmail.com>
> >>> > wrote:
> >>> >>
> >>> >> Hi,
> >>> >>
> >>> >> Trying to use freebsd-update to go from 8.3 to 8.4 and I am doing
> >>> this:
> >>> >>
> >>> >> # freebsd-update -r 8.4-RELEASE upgrade
> >>> >> # freebsd-update install
> >>> >> # reboot
> >>> >>
> >>> >> After reboot I am still at 8.3-RELEASE FreeBSD 8.3-RELEASE #0
> >>> >>
> >>> >> What am I doing wrong?
> >>> >> ------------------------------
> >>> >>
> >>> >> freebsd-questions@freebsd.org mailing list
> >>> >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> >>> >> To unsubscribe, send any mail to
> >>> >> "freebsd-questions-unsubscribe@freebsd.org"
> >>> >>
> >>> >>
> >>> > Don't you need run rub "freebsd-update install"?
> >>> > --
> >>> > Dave
> >>> >
> >>> > GPG/PGP ID: CDB94DA1
> >>> >
> >>> _______________________________________________
> >>> freebsd-questions@freebsd.org mailing list
> >>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> >>> To unsubscribe, send any mail to
> >>> "freebsd-questions-unsubscribe@freebsd.org"
> >>
> >>
> >>
> >>
> >> --
> >> FF
> > _______________________________________________
> > freebsd-questions@freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe@freebsd.org"
>
>
> ++++++++++++++++++++++++++++++++++++++++
> Valeri Galtsev
> Sr System Administrator
> Department of Astronomy and Astrophysics
> Kavli Institute for Cosmological Physics
> University of Chicago
> Phone: 773-702-4247
> ++++++++++++++++++++++++++++++++++++++++
>



--=20
FF



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?1411928662.22540.YahooMailNeo>