From owner-freebsd-questions@freebsd.org Wed May 15 15:28:11 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7046F1595600 for ; Wed, 15 May 2019 15:28:11 +0000 (UTC) (envelope-from hartzell@alerce.com) Received: from griffon.alerce.com (griffon.alerce.com [206.125.171.162]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "griffon.alerce.com", Issuer "griffon.alerce.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F37C90267 for ; Wed, 15 May 2019 15:28:10 +0000 (UTC) (envelope-from hartzell@alerce.com) Received: from griffon.alerce.com (localhost [127.0.0.1]) by griffon.alerce.com (Postfix) with ESMTP id B9C4F28431; Wed, 15 May 2019 08:28:02 -0700 (PDT) Received: from postfix.alerce.com (76-226-160-236.lightspeed.sntcca.sbcglobal.net [76.226.160.236]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by griffon.alerce.com (Postfix) with ESMTPSA id 973612842F; Wed, 15 May 2019 08:28:02 -0700 (PDT) Received: by postfix.alerce.com (Postfix, from userid 501) id 1463F200E0A036; Wed, 15 May 2019 08:28:02 -0700 (PDT) From: George Hartzell MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <23772.12290.9.225257@alice.local> Date: Wed, 15 May 2019 08:28:01 -0700 To: Matthias Oestreicher Cc: hartzell@alerce.com, freebsd-questions@freebsd.org Subject: Re: Suggestions for working with unstable nvme dev names in AWS In-Reply-To: <5917c50c94750782cb3a929d44b04bcce142ece2.camel@smormegpa.no> References: <23770.10599.687213.86492@alice.local> <08660a2a-489f-8172-22ee-47aeba315986@FreeBSD.org> <23770.58821.826610.399467@alice.local> <20190514210203.3d951fb8.freebsd@edvax.de> <23771.5612.105696.170743@alice.local> <23771.11429.855191.658934@alice.local> <5917c50c94750782cb3a929d44b04bcce142ece2.camel@smormegpa.no> X-Mailer: VM 8.2.0b under 26.1 (x86_64-apple-darwin14.5.0) Reply-To: hartzell@alerce.com X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Queue-Id: 5F37C90267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of hartzell@alerce.com designates 206.125.171.162 as permitted sender) smtp.mailfrom=hartzell@alerce.com X-Spamd-Result: default: False [-2.51 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[hartzell@alerce.com]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[griffon.alerce.com]; NEURAL_HAM_SHORT(-0.18)[-0.179,0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:25795, ipnet:206.125.168.0/21, country:US]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[alerce.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-0.04)[asn: 25795(-0.12), country: US(-0.06)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 May 2019 15:28:11 -0000 Matthias Oestreicher writes: > [...] > I have to admit that I'm still a bit unsure if I understand your problem. > > You are worried about, that the big-slow and the small-fast change their > device names when the system boots... > The GPT labels I suggested will survive a reboot, so no need to run a script > each time the system boots, to reapply those labels to the right drive. > > What you only need to do once, is to determine which /dev/nvmN is the big-slow > one and which the small-fast. Then you apply your labels, e.g.: > [...] Thanks again for following up. The final sentence in the bit I've quoted from your reply is the core of the problem. You/I request two additional block devices from Amazon, and we suggest the names that we'd like them to be given (e.g. `/dev/sdy` and `/dev/sdz`) but when the machine boots, it gives them the names `/dev/nvme1` and `/dev/nvme2` *and the names are assigned at random*. Sometimes `/dev/nvme1` is the device you asked to be named `/dev/sdy` and sometimes it's `/dev/sdz`. Perhaps it's more useful to say that I can never guess/know the device names, when the machine is powered up for the first time and when it is power cycled. As a human, how do I know which of the two devices is the big-slow one and which is the small-fast one. I suppose that I could run `dmesg` and look at their sizes? But what if they were the same size? What if they were identical except that they had different AWS snapshot policies? And/but, my goal is to be able to set up the machine automatically (this is "The Cloud(tm)", after all...). Because Amazon stashes the requested names somewhere in the volumes and provides a Linux tool that digs it out via an ioctl, one can figure it all out. I suspect that FreeBSD hasn't spent as much time on AWS and that the equivalent tool/ioctl isn't available. That's what I'm trying to check. Thanks again! g.