Skip to content

Unmanaged datasets destroyed at boot time after import of zpool.cache #103

@almereyda

Description

@almereyda

Describe the bug

When custom datasets are present in the system, they are not recognised by zsys and sceduled for destuction. apt actions, the zsys-commit and zsys-gc journals report:

WARNING Couldn't find any association for user dataset epool/USERDATA/edata

zsys-gc further informs about impossible destruction of newly created datasets, as they are in use:

WARNING Couldn't destroy unmanaged user dataset epool/USERDATA/edata: couldn't destroy "epool/USERDATA/edata" and its children: stop destroying dataset on "epool/USERDATA/edata", cannot destroy child: cannot destroy dataset "epool/USERDATA/edata/pub": dataset is busy

After the next reboot, the dataset will not yet be mounted, and can be destroyed:

# zpool history -il epool
2020-04-28.23:20:34 [txg:16285] open pool version 5000; software version unknown; uts acacia 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 [on acacia]
2020-04-28.23:20:35 [txg:16287] import pool version 5000; software version unknown; uts acacia 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 [on acacia]
2020-04-28.23:20:40 zpool import -c /etc/zfs/zpool.cache -aN [user 0 (root) on acacia:linux]
2020-04-28.23:30:44 [txg:16409] destroy epool/USERDATA/edata/pub (600)  [on acacia]
...
2020-04-28.23:31:35 [txg:16451] destroy epool/USERDATA/edata/home (702)  [on acacia]
2020-04-28.23:31:38 [txg:16453] destroy epool/USERDATA/edata/data (607)  [on acacia]
2020-04-28.23:31:41 [txg:16455] destroy epool/USERDATA/edata/src (902)  [on acacia]
2020-04-28.23:31:43 [txg:16457] destroy epool/USERDATA/edata (70)  [on acacia]

To Reproduce
Steps to reproduce the behavior:

  1. Create a fresh install of Ubuntu 20.04 using the experimental ZFS support.
  2. Create an encrypted pool epool and recursively other datasets below, like epool/USERDATA, epool/USERDATA/pub etc.
  3. Transfer several TBs into your new pool.
  4. Reboot the system and have the pool's data destroyed automatically.

Expected behavior

The unmanaged datasets are left intact.

ubuntu user /tmp/report
https://gist.github.com/almereyda/8c2af14ba9de5c26d5309d75ae654f40

Installed versions:

  • OS: Ubuntu 20.04
  • Zsysd running version: 0.4.5

Additional context
Early information about the case were documented in https://askubuntu.com/questions/1232637

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions