Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2013 09:40:39 -0800
From:      Jeremy Chadwick <jdc@koitsu.org>
To:        freebsd-stable@freebsd.org
Cc:        wblock@wonkity.com, freebsd@deman.com
Subject:   Re: RFC: Suggesting ZFS "best practices" in FreeBSD
Message-ID:  <20130124174039.GA35811@icarus.home.lan>

next in thread | raw e-mail | index | archive | help
>> #1.  Map the physical drive slots to how they show up in FBSD so if a 
>> disk is removed and the machine is rebooted all the disks after that 
>> removed one do not have an 'off by one error'.  i.e. if you have 
>> ada0-ada14 and remove ada8 then reboot - normally FBSD skips that 
>> missing ada8 drive and the next drive (that used to be ada9) is now 
>> called ada8 and so on...
>
>How do you do that?  If I'm in that situation, I think I could find the 
>bad drive, or at least the good ones, with diskinfo and the drive serial 
>number.  One suggestion I saw somewhere was to use disk serial numbers 
>for label values.

The term FreeBSD uses for this is called "wiring down" or "wired down",
and is documented in CAM(4).  It's come up repeatedly over the years but
for whatever reason people overlook it or can't find it.  Here's how you
do it for Intel AHCI (and probably others like AMD), taken directly from
my /boot/loader.conf --

# "Wire down" device names (ada[0-5]) to each individual port
# on the SATA/AHCI controller.  This ensures that if we reboot
# with a disk missing, the device names stay the same, and stay
# attached to the same SATA/AHCI controller.
# http://lists.freebsd.org/pipermail/freebsd-fs/2011-March/011036.html
#
hint.scbus.0.at="ahcich0"
hint.scbus.1.at="ahcich1"
hint.scbus.2.at="ahcich2"
hint.scbus.3.at="ahcich3"
hint.scbus.4.at="ahcich4"
hint.scbus.5.at="ahcich5"
hint.ada.0.at="scbus0"
hint.ada.1.at="scbus1"
hint.ada.2.at="scbus2"
hint.ada.3.at="scbus3"
hint.ada.4.at="scbus4"
hint.ada.5.at="scbus5"

IMPORTANT: The device names/busses/etc. are going to vary depending on
each person's setup, controller, etc..  Proof of this is in a post from
Randy Bush, where I helped him off-list with this task and he figured
out the remaining bits by himself for his hptrr(4) controller:

http://lists.freebsd.org/pipermail/freebsd-fs/2012-June/014522.html

You can use labels if you want, but I prefer to just have statically
assigned device names regardless of a bay being populated by a disk or
not.  That's my preference.  Other people like labels and that's fine --
I just can't stand the utter mess that is labelling on FreeBSD, sans GPT
labels.

And finally, touching /boot/device.hints is wrong.  Do not do this.
Ever.  This file is actually "managed" by either mergemaster or
installkernel/installworld (I forget which).  Use /boot/loader.conf for
any hint overrides/adjustments.  Leave /boot/device.hints alone.

-- 
| Jeremy Chadwick                                   jdc@koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Mountain View, CA, US                                            |
| Making life hard for others since 1977.             PGP 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130124174039.GA35811>