Shift ada device numbers?

Mike Clarke jmc-freebsd2 at milibyte.co.uk
Mon Jun 26 20:19:48 UTC 2017


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.


-- 
Mike Clarke


More information about the freebsd-questions mailing list