DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.
https://determinate.systems
GNU Lesser General Public License v2.1
2.15k stars 53 forks source link

Mac APFS volume cannot be unmounted (Kernel) #844

Open byrongibson opened 8 months ago

byrongibson commented 8 months ago

Related: https://github.com/DeterminateSystems/nix-installer/issues/824

Error

> sudo /nix/nix-installer uninstall

...

Error: 
   0: Error reverting
   0: Action `create_or_merge_nix_config` errored
      Remove file `/etc/nix/nix.conf`

      Action `create_apfs_volume` errored
      Failed to execute command with status 1 `"/usr/sbin/diskutil" "apfs" "deleteVolume" "Nix Store"`, stdout: Started APFS operation
      Deleting APFS Volume from its APFS Container
      Unmounting disk3s7
      The volume "Nix Store" on disk3s7 couldn't be unmounted because it is in use by process 0 (kernel)

      stderr: Error: -69888: Couldn't unmount disk

Metadata

key value
version 0.16.0
os macos
arch aarch64
byrongibson commented 8 months ago

The file /etc/nix/nix.conf did not exist per the other issue referenced at top. But nix-installer couldn't delete the APFS volume here.

Hoverbear commented 8 months ago

Similar to #836. We likely need to find some way to not attempt install while the APFS disk is unmountable.