Persistent device names in zpool status for my cache device?

Hi everyone, I’ve been trying to add a SSD as persistent cache device for my two HDDs:

zpool add -o ashift=12 zfs-14tb-1 cache /dev/disk/by-id/ata-Samsung_SSD_850_PRO_256GB_S251NXAGB66384X-part1 -f
zpool add -o ashift=12 zfs-14tb-2 cache /dev/disk/by-id/ata-Samsung_SSD_850_PRO_256GB_S251NXAGB66384X-part2 -f

Which works fine and in zpool status the specific partitions of the disk/by-id/ device get attached to the respective pools. However after a reboot the -part2 device always gets renamed to “sde2”. I’ve tried removing the cache device and re-adding it but that only fixed the device name until I rebooted.

I know this is not really important, but it’s kind of weird why it works for -part1 but not for -part2. Is this a bug?

I’m using open-zfs on gentoo linux, initially had the sys-fs/zfs-kmod-2.1.9 but I then upgraded to 2.1.11 and 2.1.12 and tried removing and re-adding it but this did not change the result. Kernel was 6.1.x initially, now 6.3.x with the new openzfs version.

  pool: zfs-14tb-1
 state: ONLINE

        NAME                                                   STATE     READ WRITE CKSUM
        zfs-14tb-1                                             ONLINE       0     0     0
          ata-ST14000VN0008-2JG101_ZHZ0WH6N                    ONLINE       0     0     0
          ata-Samsung_SSD_850_PRO_256GB_S251NXAGB66384X-part1  ONLINE       0     0     0

errors: No known data errors

  pool: zfs-14tb-2
 state: ONLINE

        NAME                                  STATE     READ WRITE CKSUM
        zfs-14tb-2                            ONLINE       0     0     0
          ata-WDC_WD140PURZ-85GG1Y0_9RK3YH2C  ONLINE       0     0     0
          sde2                                ONLINE       0     0     0

errors: No known data errors

No guarantees :wink:

After addind the cache device, try exporting your pool and import it by specifying each device in the pool with -d [device name].

Also check that you set zpool set cachefile=/etc/zfs/zpool.cache <pool> with zpool get

If you have only one pool and the issue persists after the above, you could try removing the cache file after the export, and check if it gets recreated after your pool is imported correctly using the -d options.

ps. to be clear: the zpool set cachefile= has nothing to do with the cache device you are adding.