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:
parent
e79b6e2305
commit
ffc73ff8b1
|
@ -1095,9 +1095,6 @@ class ZPool:
|
||||||
def mount(self):
|
def mount(self):
|
||||||
return self.mountpoint
|
return self.mountpoint
|
||||||
|
|
||||||
async def pre_shutdown(self, command_runner):
|
|
||||||
await command_runner.run(['zpool', 'export', self.pool])
|
|
||||||
|
|
||||||
|
|
||||||
@fsobj("zfs")
|
@fsobj("zfs")
|
||||||
class ZFS:
|
class ZFS:
|
||||||
|
|
|
@ -1329,5 +1329,5 @@ class FilesystemController(SubiquityController, FilesystemManipulator):
|
||||||
if not self.reset_partition_only:
|
if not self.reset_partition_only:
|
||||||
await self.app.command_runner.run(
|
await self.app.command_runner.run(
|
||||||
['umount', '--recursive', '/target'])
|
['umount', '--recursive', '/target'])
|
||||||
for pool in self.model._all(type='zpool'):
|
if len(self.model._all(type='zpool')) > 0:
|
||||||
await pool.pre_shutdown(self.app.command_runner)
|
await self.app.command_runner.run(['zpool', 'export', '-a'])
|
||||||
|
|
Loading…
Reference in New Issue