Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2019 08:28:01 -0700
From:      George Hartzell <hartzell@alerce.com>
To:        Matthias Oestreicher <matthias@smormegpa.no>
Cc:        hartzell@alerce.com, freebsd-questions@freebsd.org
Subject:   Re: Suggestions for working with unstable nvme dev names in AWS
Message-ID:  <23772.12290.9.225257@alice.local>
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> <eb1d290e48b4ba21ab350044b25592525e61457c.camel@smormegpa.no> <23771.11429.855191.658934@alice.local> <5917c50c94750782cb3a929d44b04bcce142ece2.camel@smormegpa.no>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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