From owner-freebsd-questions@freebsd.org Tue Jun 27 08:07:02 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0885DA42F3 for ; Tue, 27 Jun 2017 08:07:02 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp.infracaninophile.co.uk [81.2.117.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.infracaninophile.co.uk", Issuer "infracaninophile.co.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 42D6680A44 for ; Tue, 27 Jun 2017 08:07:02 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from liminal.local (unknown [IPv6:2001:8b0:151:1:1c1d:86a1:a200:b700]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: m.seaman@infracaninophile.co.uk) by smtp.infracaninophile.co.uk (Postfix) with ESMTPSA id 826D0CBD7 for ; Tue, 27 Jun 2017 08:06:59 +0000 (UTC) Authentication-Results: smtp.infracaninophile.co.uk; dmarc=none header.from=FreeBSD.org Authentication-Results: smtp.infracaninophile.co.uk/826D0CBD7; dkim=none; dkim-atps=neutral Subject: Re: Shift ada device numbers? To: freebsd-questions@freebsd.org References: <3wxF144QMTzRRqQ@baobab.bilink.it> <20170626212056.38499777@curlew> From: Matthew Seaman Message-ID: Date: Tue, 27 Jun 2017 09:06:59 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IPTGsXrrMHIn9AHqhDPMeaKXeL3MNQlqS" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 08:07:02 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IPTGsXrrMHIn9AHqhDPMeaKXeL3MNQlqS Content-Type: multipart/mixed; boundary="k631deehffcGJHFoH0fcRpch4wBmHU8Hb"; protected-headers="v1" From: Matthew Seaman To: freebsd-questions@freebsd.org Message-ID: Subject: Re: Shift ada device numbers? References: <3wxF144QMTzRRqQ@baobab.bilink.it> <20170626212056.38499777@curlew> In-Reply-To: --k631deehffcGJHFoH0fcRpch4wBmHU8Hb Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 27/06/2017 00:01, Matthew Seaman wrote: > On 26/06/2017 21:30, Trond Endrest=C3=B8l wrote: >> On Mon, 26 Jun 2017 21:20+0100, Mike Clarke wrote: >> >>> On Mon, 26 Jun 2017 18:31:04 +0200 >>> Luciano Mannucci 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 mo= ve >>>> the SSD disk to another SATA controller it becomes ada0 and the memb= ers >>>> 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 imp= ort >>> -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 lo= ng >>> time ago and I might not have remembered the exact procedure correctl= y >>> 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= =2Ehtml >> >> I too recommend some form of labels, be it GPT, UFS, or glabel. >> >=20 > The term the OP is looking for is 'wired devices' or 'wired down device= s' >=20 > See cam(4) and device.hints(5) -- search for this: >=20 > hint.device.unit.property=3D"value" >=20 > in cam(4). device.hints(5) is mostly used for legacy ISA stuff, but yo= u > can use it to control which of your drives is da0, da1 or da2. Although on reflection, the best way to handle this problem is by using gpart to label the devices and then using /dev/gpart/labelname as the device name in /etc/fstab Cheers, Matthew --k631deehffcGJHFoH0fcRpch4wBmHU8Hb-- --IPTGsXrrMHIn9AHqhDPMeaKXeL3MNQlqS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJ8BAEBCgBmBQJZUhIjXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkATQ4MP/0NCvI1XSh+LfTNtOn/+mEXX O6z/W0iPWtwS+Ts27xAqdL+fCCUKHABXxWnHwoJe6F5RDez7GvPxFGFVzpiYtbnn mGQ3Hst3rJJ+YKi0teANR5mrJS44hKSEGAqMkHoIAerY6XYMgOEN7ih1IHziKm/p /e/uq0OhNBxL/4vT9WaIbtqM1NSBVYoouTk8F+2+yJ1/iYiVCADKEbs2pR9LSWje edeS3dDsx/dfH3EcoC5DtfLGARiIDLsDR7pBekJjuSujvOWtWNPfaot7PqYC8iNq +fTKVxVPU2SR8qbOiwCLwDItQ+o9jumSHWfejqo4/C2XzZOkqY76D1z6OYcz7AUr YX6eJtEoqGrrOMMC2XO9ZiZNHXefcxqbXCecBH8tTTSgx/RAUj2iWR+Jf/7Hb2iV 6K/Fwhtp7RheVo5zL1Y7bN4crBmzPCLAP+iRKBiWR7UxAQ+9WmMDTMUueNadvvIT laiqvHCpSZfUZT3YfMk7qVsk7eJ9pQBgua+dLTgUmnipnoyVvv7YTgdYrWvBT5hH JU30kn26XZ31t4zFsEBrfBu5wD/o7TFdYqU5dgVCyisFKaLNhRuvF5jl7o4gn2Sg 3lzuMvDjh+Z6w5sKQqv2uRH1uI5HXfFDO7Ts2qfCWsE4Ui4/zdumDi8rLlRvXmHW cU+KDYrJgtLCtWSB/8CD =lxF3 -----END PGP SIGNATURE----- --IPTGsXrrMHIn9AHqhDPMeaKXeL3MNQlqS--