Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create new partition (Failed to run process: diskutil apfs resizeContainer) #91

Closed
YousufSSyed opened this issue Apr 13, 2022 · 2 comments

Comments

@YousufSSyed
Copy link

YousufSSyed commented Apr 13, 2022

This is the output when trying to create a new partition for Asahi Linux:

» New size (50%): 

Resizing will free up 247.19 GB of space.

Note: your system may appear to freeze during the resize.
This is normal, just wait until the process completes.
» Continue? (y/N): n
» New size (50%): 

Resizing will free up 247.19 GB of space.

Note: your system may appear to freeze during the resize.
This is normal, just wait until the process completes.
» Continue? (y/N): y

Started APFS operation
Aligning shrink delta to 247,192,440,832 bytes and targeting a new physical store size of 247,192,354,816 bytes
Determined the minimum size for the targeted physical store of this APFS Container to be 288,501,006,336 bytes
Error: -69521: Your APFS Container resize request is below the APFS-system-imposed minimal container size (perhaps caused by APFS Snapshot usage by Time Machine)
Failed to run process: diskutil apfs resizeContainer disk0s2 247192354816
root        : ERROR    Process execution failed
Traceback (most recent call last):
  File "/private/tmp/asahi-install/main.py", line 820, in <module>
    InstallerMain().main()
  File "/private/tmp/asahi-install/main.py", line 672, in main
    while self.main_loop():
  File "/private/tmp/asahi-install/main.py", line 792, in main_loop
    return self.action_resize(parts_resizable)
  File "/private/tmp/asahi-install/main.py", line 612, in action_resize
    self.dutil.resizeContainer(target.name, val)
  File "/private/tmp/asahi-install/diskutil.py", line 208, in resizeContainer
    self.action("apfs", "resizeContainer", name, size, verbose=2)
  File "/private/tmp/asahi-install/diskutil.py", line 38, in action
    subprocess.run(["diskutil"] + list(args), check=True)
  File "/private/tmp/asahi-install/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['diskutil', 'apfs', 'resizeContainer', 'disk0s2', '247192354816']' returned non-zero exit status 1.
If you need to file a bug report, please attach the log file:
  /private/tmp/asahi-install/installer.log

Here's the installer log:
installer.log

@YousufSSyed
Copy link
Author

YousufSSyed commented Apr 19, 2022

So I figured it out now I ran the command diskutil apfs resizeContainer disk0s2 247192354816 and it said:

Error: -69531: There is not enough free space in the APFS Container for this operation due to APFS limits or APFS tidemarks (perhaps caused by APFS Snapshot usage by Time Machine)

I then found I need to delete all time machine backups. First disable Time Machine in Preference, then you can list all time machine backups tmutil listlocalsnapshots /, and finally delete them all with tmutil deletelocalsnapshots /. Try the installer again, if it doesn't work, you can sort of fiddle with it by increasing the macOS partition size and or delete all the backups again.

@marcan
Copy link
Member

marcan commented Apr 19, 2022

Duplicate of #86

@marcan marcan marked this as a duplicate of #86 Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants