[Pkg-zfsonlinux-devel] Bug#940678: Please import pools by stable device label

Alberto Berti alberto at metapensiero.it
Mon Sep 30 15:54:11 BST 2019


>>>>> "Antonio" == Antonio Russo <antonio.e.russo at gmail.com> writes:

    >> The pool systematically fails to mount after the upgrade, at each boot,
    >> even if I manually mounted it.. 


    Antonio> The terminology with ZFS is a little different: pools are "imported"
    Antonio> and the datasets (that are filesystems rather than, say, zvols) are then
    Antonio> "mounted".  It sounds like you cannot import the pool, and therefore you
    Antonio> cannot mount the datasets.

yes, that's the case

    Antonio> Is your problem reproducible? By that I mean, on reboot, does the pool
    Antonio> import or not?

no, that's the problem

    Antonio> And what do you mean by "manually mounted it"? Are you talking about

    Antonio> # zpool import -d /dev -aN

And subsequent

 zfs mount -a

    Antonio> If it's not mounting on reboot, just use -d /dev/disk/by-id next time,
    Antonio> and the problem should go away.

Yes, I'll try today or tomorrow night

    >> this leads to data loss from a user pow, because the data that's not> there may get re-written and generate conflicts.
    Antonio> If another application does not gracefully handle missing data, by all
    Antonio> means that is a bug for that application. That's not, however, a ZFS
    Antonio> bug.

from my point of view, the problem is that even if a
storage-relate unit (zfs-import-cache) fails, causing the missing mount
of some fs, the system reaches a state where it's considered ok for the
services to start.


    Antonio> I would encourage you to open a separate bug, unrelated to this, for
    Antonio> that issue.

    >> 
    Antonio> so that your import is done by labels that are stable
    Antonio> across boots (names like /dev/sdX are not necessarily
    Antonio> stable). This is a "well-known" best practice with ZFS [1]
    Antonio> (you should always create pools using these symlinks as
    Antonio> well).
    >> 
    >> good to know, thanks. Although I think that if the hardware
    >> configuration nor the kernel version changes between the boots, we can
    >> assume that each block device will get the same id... anyway I'll try it.

    Antonio> You can check this---note which device nodes are being linked by the
    Antonio> stable identifiers in /dev/disk/by-id. Do they change on reboot?

    Antonio> If you find that your device nodes are to exactly the same drives, and
    Antonio> yet the pool is not importing as you have found, that's definitely a bug,
    Antonio> and we'll have to file it upstream. You will need verbatim dmesg logs,
    Antonio> the zpool status $poolname output, and the output of ls -l /dev/disk/by-id
    Antonio> on subsequent boots.

    Antonio> Upstream will want to see exactly what is going on with the device nodes,
    Antonio> since that's the most likely cause of this problem.

ok, I'll try your proposed fixes and report back, thanks.

    Antonio> Yes, to export a pool, none of its datasets can be in use (e.g., mounted).
    Antonio> Be careful with the terminology here---exporting a filesystem (or dataset)
    Antonio> means something totally different than exporting a pool.

yes, the reuse of the terms at both zpool and zfs level is tricky

-- 
Alberto Berti  -  Information Technology Consultant
PGP: 9377 A68C C5B5 B534 36BD  F20B E3B5 C559 99D6 7CF9

            "gutta cavat lapidem"



More information about the Pkg-zfsonlinux-devel mailing list