Shift ada device numbers?

Matthew Seaman matthew at FreeBSD.org
Mon Jun 26 23:02:26 UTC 2017


On 26/06/2017 21:30, Trond Endrestøl wrote:
> On Mon, 26 Jun 2017 21:20+0100, Mike Clarke wrote:
> 
>> On Mon, 26 Jun 2017 18:31:04 +0200
>> Luciano Mannucci <luciano at vespaperitivo.it> wrote:
>>
>>> I have a FreeBSD 10.3 RELEASE machine whith root on zfs on two discs
>>> and a "standalone" SSD holding database data. I noticed that if I move
>>> the SSD disk to another SATA controller it becomes ada0 and the members
>>> of the zfs are shifted to ada1 and ada2, and the system doesn't work:
>>> in fact it stops at boot because I've put the swap on the ssd and it
>>> can't find it anymore.
>>>
>>> Is there a way to control whichnumbers are assigned to the disks at
>>> boot time?
>>
>> Some of the responses in https://forums.freebsd.org/threads/36571/
>> might help. In particular the suggestion at the end to use "zpool import
>> -d /dev poolname" to re-scan /dev to locate the devices.
>>
>> If your disk uses GPT partitions you could avoid this problem in the
>> future by using gpart to add a label to each partition and then using
>> "zpool import -d /dev/gpt". This worked for me but it was rather a long
>> time ago and I might not have remembered the exact procedure correctly
>> so do make sure you have reliable backups before attempting to make
>> changes like this.
>>
>> It may be possible to do something similar for MBR partitions but I'm
>> not sure if it's possible to safely assign a label to a live ZFS
>> partition on a MBR disk.
> 
> Maybe this is what the OP is looking for:
> 
> https://lists.freebsd.org/pipermail/freebsd-stable/2013-January/071851.html
> 
> I too recommend some form of labels, be it GPT, UFS, or glabel.
> 

The term the OP is looking for is 'wired devices' or 'wired down devices'

See cam(4) and device.hints(5) -- search for this:

   hint.device.unit.property="value"

in cam(4).  device.hints(5) is mostly used for legacy ISA stuff, but you
can use it to control which of your drives is da0, da1 or da2.

	Cheers,

	Matthew

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20170627/a94bbcaa/attachment.sig>


More information about the freebsd-questions mailing list