tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
748 stars 74 forks source link

Document installation procedure on external SSD. #79

Open starcraft66 opened 1 year ago

starcraft66 commented 1 year ago

I'd like to give this project a shot, however my only Apple Silicon macbook belongs to my employer and I'd rather not resize the internal disk and install linux on it. I'd like to be able to just test out Linux installed on and booted from an external SSD. A few threads on the Asahi Linux subreddit alude to this being possible by installing the bootloader to the internal disk, booting off that and then having the actual linux filesystem on an external drive: https://old.reddit.com/r/AsahiLinux/comments/12eib3r/asahi_linux_external_ssd/

This is an acceptable compromise, but there appears to be no functional tooling to achieve this configuration out of the box, I think it would be interesting to work it here.

starcraft66 commented 1 year ago

Actually, I re-read the link I just posted and it seems that this approach is not feasible yet without re-partitioning the internal disk.

but since m1n1 itself cannot chainload from USB, there's a gap in our boot chain for all that to work.

I guess this issue can stay blocked until this is resolved.

tpwrules commented 1 year ago

Yeah there’s not a lot I can do here due to the boot flow of Apple Silicon and the current limitations of m1n1. It should be pretty easy to put the rootfs on an external disk by simply mounting a partition on the external disk (preferably by UUID) instead of the internal disk, but the ESP and m1n1 stub partition do need to exist on the internal disk for now. You’ll need 4GB or so for the stuff that needs to go on the internal disk.

If it makes you feel better, the volume resizer does seem to be decently robust. It can fail to start for a number of reasons and if you do it from macOS proper instead of the recovery environment your machine might appear to freeze when it locks the volume to do its work, but I’ve never heard of it actually zorching a volume.

Once you are done evaluating Linux you can delete all the partitions and resize your main macOS volume to get the space back. This is also a safe operation as long as you don’t make any typos. But backups are always wise.

zzywysm commented 6 months ago

This is already documented at:

https://asahilinux.org/2022/03/asahi-linux-alpha-release/#can-i-install-to-an-externalusb-disk

Perhaps this can be mentioned in the nixos-apple-silicon README, and then this issue can be closed?