Subject: disk/by-uuid not getting setup

From: "[email-masked]" <[email-masked]>
Date: Fri, 18 Nov 2022 14:45:11 -0600

Hi,

The request:
This seems basic, but I can't figure out: How do I get Alpine to setup
the UUIDs for each partition in my ZFS array at boot [so I can rebuild
the pool by partition UUID]?

Some background:
On a previous linux server, which suffered permanent failure, I had
a zfs pool called "nas_storage". Each disk in the pool has it's own
partition (partion 1) that was a member in the pool. So /dev/sd[abcde]1
is a member in the pool. Experience having the drives get re-ordered
after a reboot told me to make sure the pool was constructed using
partition UUIDs. This is where my problem lies.

The problem:
On booting Alpine (on a Raspberry Pi 4B booting from a USB drive), I
can see all the drives by their letter designation /dev/sd[abcdef], as
well as their partitions (e.g. /dev/sdf1, /dev/sdf2/, /dev/sdf3).
However, only the boot drive gets it's corresponding disk/by-uuid links
setup. The usb drive array does not.

I can import and use the zfs pool using zfs import -af nas_storage,
but the pool gets build using drive letter (i.e. /dev/sd[abcde]1).
This will eventually fail when /dev/sda1 becomes /dev/sdf1 because of
boot randomness.

Of course, if I use cfdisk, I can get the UUIDs of each partition for
/dev/sd[abcde]1, and manually link the UUIDs of each partition
in /dev/disk/by-uuid to it's /dev/sd[abcde]1 counterpart, and then
usezfs import -d /dev/disk/by-uuid to successfully import the zfs pool.

Thank you,
 Thom