Suggestions for working with unstable nvme dev names in AWS

George Hartzell hartzell at alerce.com
Wed May 15 15:28:11 UTC 2019


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.


More information about the freebsd-questions mailing list