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

Succeeded in blowing up (i.e. Restore required) M1 Macbook Air using Asahi wipe script #73

Open
mikebeaton opened this issue Aug 2, 2023 · 8 comments

Comments

@mikebeaton
Copy link

mikebeaton commented Aug 2, 2023

I was playing around with installing and reinstalling Asahi and can provide the hopefully self-verifying observation that "Nobody has blown anything up with it yet as far as we know" regarding the wipe script is now officially incorrect!

All fixed for me with a Restore (Revive would not work), but I thought it might be worth updating the docs slightly , or the wipe script, possibly. (Also, to be clear, no worries! I was playing around, and expecting that things might go wrong. But having found the edge case, I think it might be worth documenting.)

Steps as follows:

  • Already had a dual-boot (Monterey and Sonoma) M1 Macbook Air, with Asahi Ubuntu installed and (at the time of subsequent actions below) set as default OS
    • From further testing, same issue occurs with (current) default Arch Asahi
  • Booted into Recovery
  • Ran wipe-linux script (in Recovery shell)
  • Ran Asashi Ubuntu install script (in Recovery shell)
    • This failed, as no macOS was set as default OS
    • On further testing, this step (re-running the install script until it fails) is not required to reproduce the issue
  • Rebooted assuming I could hold down power key to select one of my two OSes as default
  • System required Restore (macOS restore warning screen and no boot options accessible, from repeated attempts at press or double-press to enter recovery)
    • (Several attempts at Revive prior to Restore did not work)

I am happy to attempt to recreate, or to offer doc or script update PR. I have recreated the issue and believe it is fully replicable, and am offering a doc patch below.

Suspect a slightly hacky but successful fix would be for the wipe script to refuse to operate - or at least to offer an additional severe warning - if no macOS is set as default OS?

@mikebeaton
Copy link
Author

mikebeaton commented Aug 2, 2023

From further testing, the problem happens when running the wipe script from the wrong macOS recovery. I cannot replicate the issue with just one macOS installed, but with two macOS and in the wrong recovery (i.e. not for the macOS which was used to install Asahi) on running the wipe script and then rebooting, I immediately enter the above-described state which I believe is unrecoverable without a Restore.

To be clear, I am not suggesting that this is a particularly reasonable course of action - as I say, I was playing around - but I would still think that a clear warning about this (now!) known way to 'blow things up' is worth adding to the docs? I will offer a PR.

@mikebeaton
Copy link
Author

mikebeaton commented Aug 2, 2023

I forgot you can't create a PR on a GitHub wiki, but here is a patch for some suggested wording:

From 39bd93e3273dcd45c1874fcf2ff0e70091377a07 Mon Sep 17 00:00:00 2001
From: Mike Beaton <mjsbeaton@gmail.com>
Date: Wed, 2 Aug 2023 22:24:09 +0100
Subject: [PATCH] Warn about wipe script when used on a system with multiple
 macOS installs

---
 Partitioning-cheatsheet.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Partitioning-cheatsheet.md b/Partitioning-cheatsheet.md
index e7f612c..f6ed71d 100644
--- a/Partitioning-cheatsheet.md
+++ b/Partitioning-cheatsheet.md
@@ -6,7 +6,7 @@ Note: We'll add uninstall/cleanup options to the installer soon, but by definiti
 
 ## Just wipe it all, please
 
-We have a stupidly dangerous script lying around that will indiscriminately wipe anything with "Linux", "EFI" or "Asahi" in its name, as well as all 2.5GB APFS containers (which the installer creates), with no confirmation. Nobody has blown anything up with it yet as far as we know, and it should work for the vast majority of users as long as they don't already have any weird partitions, but please don't use it indiscriminately. You're much better off deleting partitions manually if you can help it. We wrote it mostly for developers who do lots of reinstalls and needed a quick way to reset. If you must use it, `curl -L https://alx.sh/wipe-linux | sh` as root. Ignore "operation not permitted" errors at the end (or run it from recovery mode for that optional part to work properly). Don't blame us if it eats your data. Note that this *won't* expand macOS to fill all freed up space; see below for that.
+We have a stupidly dangerous script lying around that will indiscriminately wipe anything with "Linux", "EFI" or "Asahi" in its name, as well as all 2.5GB APFS containers (which the installer creates), with no confirmation. It is possible to blow things up with this script, **requiring a full restore of your system**, if you have multiple macOS versions installed and run the script from the wrong RecoveryOS (not the one paired with the macOS instance from which Asahi was installed). Apart from this issue, the script should work for the vast majority of users as long as they don't already have any weird partitions, but please don't use it indiscriminately. You're much better off deleting partitions manually if you can help it. We wrote it mostly for developers who do lots of reinstalls and needed a quick way to reset. If you must use it, `curl -L https://alx.sh/wipe-linux | sh` as root. Ignore "operation not permitted" errors at the end (or run it from recovery mode for that optional part to work properly). Don't blame us if it eats your data. Note that this *won't* expand macOS to fill all freed up space; see below for that.
 
 ## Do not use the *Disk Utility* application
 
-- 
2.37.5

Suggested wording update also shown here.

@Kotov584
Copy link

and nobody cares as usual

@povik
Copy link
Member

povik commented Aug 21, 2023

Thanks for reporting this. I noted it on the wiki page but maybe we should just take up your wording instead. I think you should go ahead and place it on the page yourself if you are reasonably sure the RecoveryOS instances mismatch is the cause here. I don't understand the Apple's boot chain enough to reason about what's happening, but if you can hit it with the wipe-linux script, shouldn't one be able to hit it with manually deleting partitions also?

@mikebeaton
Copy link
Author

You have a good point (and some different wording would be better, if so), when I get a chance I'll check that and see if I can semi-brick my poor M1 Air again.

@7ombie
Copy link

7ombie commented Sep 21, 2023

...but if you can hit it with the wipe-linux script, shouldn't one be able to hit it with manually deleting partitions also?

You can definitely end up requiring a restore by manually deleting partitions. Been there.

@mzavattaro
Copy link

You can definitely end up requiring a restore by manually deleting partitions. Been there.

Is this the case still with the general release?

@7ombie
Copy link

7ombie commented Dec 30, 2023

@mzavattaro - I wasn't using Asahi when I messed my system up.

I was just confirming that the Mac recovery UI does permit manually deleting partitions. It was really intended as a general, lighthearted remark.

Sorry for the noise and any confusion.

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

5 participants