Skip to content

Instantly share code, notes, and snippets.

@inscapist
Last active August 16, 2021 05:07
Show Gist options
  • Save inscapist/565d463f7db77ce5958095862ec60923 to your computer and use it in GitHub Desktop.
Save inscapist/565d463f7db77ce5958095862ec60923 to your computer and use it in GitHub Desktop.
Auto mounting a volume to root path (BigSur/Catalina)

Mount volume automatically to root path

Preamble

I create a separate volume for storing my files/codes/dotfiles. Then for every reformat, I just need to symlink my dotfiles to recover my working station.

Edit synthetic.conf

We need to create a directory at root level in order for a volume to mount to. This is not possible since Catalina as they become read only.

So we need to add the directory that we want to /etc/synthetic.conf.

For example

xi@XIL /zz % sudo cat /etc/synthetic.conf
nix
zz <-- this is the added directory

REBOOT and ensure the directory is created at /zz

FsTab

Now configure the auto-mount upon boot.

We use sudo vifs. This way we don't need to know the actual location of fstab.

# sudo vifs

### Option 1 
LABEL=Nix\040Store /nix apfs rw,nobrowse

### Option 2 (retrieve UUID from diskutil list and diskutil info drive)
UUID=EE0A1841-6FD2-4EE3-A40F-F07261B9BF5F /zz apfs rw,nobrowse

Reboot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment