filesystem: fix failed zpool export

Ordering matters of zpool export, or we get an 'export failed' error.
If one does a force reboot the export was not performed, and we
initramfs-prompt until someone does `zpool import -f $poolname`.
This commit is contained in:
Dan Bungert 2023-07-18 13:42:45 -06:00
parent e79b6e2305
commit ffc73ff8b1
2 changed files with 2 additions and 5 deletions

View File

@ -1095,9 +1095,6 @@ class ZPool:
def mount(self):
return self.mountpoint
async def pre_shutdown(self, command_runner):
await command_runner.run(['zpool', 'export', self.pool])
@fsobj("zfs")
class ZFS:

View File

@ -1329,5 +1329,5 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
if not self.reset_partition_only:
await self.app.command_runner.run(
['umount', '--recursive', '/target'])
for pool in self.model._all(type='zpool'):
await pool.pre_shutdown(self.app.command_runner)
if len(self.model._all(type='zpool')) > 0:
await self.app.command_runner.run(['zpool', 'export', '-a'])