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

Reinstalling on macos: "/nix: Read-only file system" #4390

Closed
00yk opened this issue Dec 22, 2020 · 5 comments · Fixed by #4289
Closed

Reinstalling on macos: "/nix: Read-only file system" #4390

00yk opened this issue Dec 22, 2020 · 5 comments · Fixed by #4289
Labels

Comments

@00yk
Copy link

00yk commented Dec 22, 2020

Describe the bug
After a broken uninstallation, I wasn't able to install nix.
Here are the error messages when I tried to reinstall using
sh <(curl -L https://nixos.org/nix/install) --daemon:

---- sudo execution ------------------------------------------------------------
I am executing:

    $ sudo mkdir -pv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix /nix/var/nix/db /nix/var/nix/gcroots /nix/var/nix/profiles /nix/var/nix/temproots /nix/var/nix/userpool /nix/var/nix/gcroots/per-user /nix/var/nix/profiles/per-user

to make the basic directory structure of Nix (part 1)

mkdir: /nix: Read-only file system
mkdir: /nix/var: Read-only file system
mkdir: /nix/var/log: Read-only file system
mkdir: /nix/var/log/nix: Read-only file system
mkdir: /nix/var/log/nix/drvs: Read-only file system
mkdir: /nix/var/nix: Read-only file system
mkdir: /nix/var/nix/db: Read-only file system
mkdir: /nix/var/nix/gcroots: Read-only file system
mkdir: /nix/var/nix/profiles: Read-only file system
mkdir: /nix/var/nix/temproots: Read-only file system
mkdir: /nix/var/nix/userpool: Read-only file system
mkdir: /nix/var/nix/gcroots/per-user: Read-only file system
mkdir: /nix/var/nix/profiles/per-user: Read-only file system

Steps To Reproduce

  1. I first install nix successfully(the first time),
  2. then I tried to uninstall it using "sudo rm -rf /nix".
  3. After that, I find there's still some files(starting with '.', I don't remember the exact names) left in /nix.
    So I use the "disk utitiliy.app" to uninstall the nix partition and do "sudo rm -rf /nix" again.

This time those remaining files were deleted but /nix(empty directory) is left.
When I try to do "sudo rm -rf /nix", it gives:

rm: /nix: Read-only file system

Expected behavior

Can someone points out a possible solution in my case to remove the empty directory /nix, thus I can reinstall nix?

@00yk 00yk added the bug label Dec 22, 2020
@septemhill
Copy link

Had the same issue on Big sur

@abathur
Copy link
Member

abathur commented Dec 23, 2020

I think there's still a little bit of state lingering that is confusing the installer (FWIW this general category of issue will hopefully be fixed if/when #4289 is merged and released). Normally, the installer would prompt you to add the --darwin-use-unencrypted-nix-store-volume flag on macOS (and exit if it isn't present) when /nix doesn't exist.

EDIT/ATTENTION: The below advice was given in response to the original poster's indication that they had already removed the Nix volume from Disk Utility.

I think you need to:

  1. look in /etc/synthetic.conf
    • if the file is absent or nix isn't mentioned in it, move to 2
    • if nix is the only thing present, you can remove it: sudo rm /etc/synthetic.conf
    • if other things are also present, you'll need to manually edit it out
  2. reboot in order to nudge the system to remove the empty /nix directory

When you reinstall Nix (again, until #4289 lands), you'll need to add the --darwin-use-unencrypted-nix-store-volume flag.

@dsebban
Copy link

dsebban commented Jan 13, 2021

That did not work for me on Big Sur, anything else I can try ?

I am executing:

    $ sudo mkdir -pv -m 0755 /nix /nix/var /nix/var/log /nix/var/log/nix /nix/var/log/nix/drvs /nix/var/nix /nix/var/nix/db /nix/var/nix/gcroots /nix/var/nix/profiles /nix/var/nix/temproots /nix/var/nix/userpool /nix/var/nix/gcroots/per-user /nix/var/nix/profiles/per-user

to make the basic directory structure of Nix (part 1)

mkdir: /nix: Read-only file system
mkdir: /nix/var: Read-only file system
mkdir: /nix/var/log: Read-only file system
mkdir: /nix/var/log/nix: Read-only file system
mkdir: /nix/var/log/nix/drvs: Read-only file system
mkdir: /nix/var/nix: Read-only file system
mkdir: /nix/var/nix/db: Read-only file system
mkdir: /nix/var/nix/gcroots: Read-only file system
mkdir: /nix/var/nix/profiles: Read-only file system
mkdir: /nix/var/nix/temproots: Read-only file system
mkdir: /nix/var/nix/userpool: Read-only file system
mkdir: /nix/var/nix/gcroots/per-user: Read-only file system
mkdir: /nix/var/nix/profiles/per-user: Read-only file system

@abathur
Copy link
Member

abathur commented Jan 13, 2021

@dsebban No clue, without knowing what's on your system. Did you remove the Nix volume, as the OP stated they had, before following the instructions?

use the "disk utitiliy.app" to uninstall the nix partition

If so, a good start would be:

  1. After removing the Nix volume, follow steps 1 & 2 in my previous post (but do not try to reinstall).
  2. After the reboot, run the following and include the output here:
    • ls -la / /etc/{fstab,synthetic.conf}
    • diskutil list
    • diskutil info /nix

@dsebban
Copy link

dsebban commented Jan 13, 2021

I deleted using the disk utility and it worked, thanks !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants