Skip to content

Commit 795bacd

Browse files
committed
main: Provide better diagnostics for resize failures.
Fixes: #81 Signed-off-by: Hector Martin <[email protected]>
1 parent 60861c2 commit 795bacd

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,14 @@ def action_resize(self, resizable):
658658
break
659659

660660
print()
661-
self.dutil.resizeContainer(target.name, val)
661+
try:
662+
self.dutil.resizeContainer(target.name, val)
663+
except subprocess.CalledProcessError as e:
664+
print()
665+
p_error(f"Resize failed. This is usually caused by pre-existing APFS filesystem corruption.")
666+
p_warning("Carefully read the diskutil logs above for more information about the cause.")
667+
p_warning("This can usually be solved by doing a First Aid repair from Disk Utility in Recovery Mode.")
668+
return False
662669

663670
print()
664671
p_success(f"Resize complete. Press enter to continue.")

0 commit comments

Comments
 (0)