Howto avoid resets of default Apple Music media folder when using a NAS

I’m a longtime fan and user of automount. Automount mounts automatically my Apple Music media folder, once the Music app tries to access it.

I’ve recently updated to a Macbook with apple Silicon running Big Sur. It looks like the default behaviour changed, because I’m often adding songs to Apple music, just to see that they are copied to my SSD instead of the automounted NAS media folder.

This is incredible annoying and is probably caused by a race condition between Apple Music and automount not mounting the volume fast enough. So from time to time I’ll need to check my configured media folder in Apple music. I’ll end up changing the folder back to the automount folder and need to wait for Apple music to finish a complete scan of the library:

Waiting for Apple Music to update its library…

„Limnos“ pointed me to a potential workaround for this behaviour:

  • Create a symbolic link to the Apple Music app on your SSD and place it on the automounted volume.
  • Create a second symbolic link from the first link back to your SSD applications folder.
  • Start Apple Music app only by using this link.
  • If the volume isn’t mounted, the link will point nowhere and Apple Music won’t start. This will hopefully stop it from rewriting the media paths.

This can be done in the terminal with just two commands:

ln -s /System/Applications/ /System/Volumes/Data/mount/music/
ln -s /System/Volumes/Data/mount/music/ /Applications/

You can now add that link to to your dock, but it can only be placed in the area next to the recycle bin.

You can test this now by unmounting the volume manually on the terminal. If you click now on the link in your dock, it won’t start Apple Music. However, if you’ll click it a second time, it will start since automount has successfully remounted your volume containing the link.

Nevertheless, Apple Music forgot its media path and I’ll have to change it again to the folder. So this is just a bad workaround. Even when you’ll change the media’s path after this test, it will be reset on the next iTunes startup.

So ultimately I’ll end up with a the instructions of „Make a split library portable„, which basically says you shouldn’t separate the Apple Music library and its media. Always put the library next to the location of your media.

Also you’ll need to make sure that you’ll manually open the right .musiclibrary file. You can define the library to open when you hold the alt key before you’ll start the Apple Music app:

Apple Music asks for a library to use when you’ll open it with alt key pressed.

If you’ll just double click, it will most likely not open the right library. Somehow macOS still knows where you’ve moved your local library file (e.g. to the NAS in the automounted folder) and will open it from the new location.

With moving the library next to the media I’m somehow happy about the outcome. Looks like Apple did not consider moving the Apple Music library to any external volume and expects it to be always present in a reachable location.

Fix broken automount mounts on macOS Catalina

I’ve moved my iTunes music library content to my NAS. I’m using automount to keep iTunes happy without losing the connection to the files. After upgrading to macOS Catalina, automount did not work as it used to.

Reason is the changed structure in the APFS container. If you have a look at the disk utility, it will show you a system container and a user container. The system contains macOS and is write protected, while the user container contains all your apps, data and so on.

You’ll just have to prepend your existing automount paths with /System/Volumes/Data. Now you’ll just have to run

sudo automount -vc

and the automounts are working again.

I had to change the iTunes settings back to my automount folder, as the upgrade to Catalina reset it to its default location in your users folder.

Setup WireGuard VPN on Raspbian

I’m already using OpenVPN but heard only good things about WireGuard VPN. For my current project, I need a VPN connection to my home network. I do not want to mess with my currently working OpenVPN setup, so I tried to setup WireGuard VPN on Raspbian.

Start with updating your installed packages. Its especially important to install the raspberrypi-kernel-headers before the WireGuard installation.:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install raspberrypi-kernel-headers

I’ll use pivpn as setup script. You can install it with curl piping the script to bash like this:

curl -L | bash

However, if you don’t trust that source and doesn’t want to execute it unseen, you can also check the script content first or download the script separately to your machine first.

I’ve followed now the installation steps which are already pretty good explained by others:

What’s nice about this script is, that it will also detect installations of pi-hole running on the same machine.

I’ve used the script to setup WireGuard (as it also supports OpenVPN). I’ve selected the default port 51820 and created a port forwarding rule in my FritzBox router. After the installation completed, you’re asked to do a reboot.

Now we’ll create a new WireGuard profile using

sudo pivpn add

The script just asks for a profile name and will place the generated profiles in the users home under the config folder.

Setup on the client machine is similar. But instead of using the script for installation, we’ll use the version provided by the Debian repo. I’ve followed these instructions:

sudo apt-get install dirmngr
echo "deb unstable main" | sudo tee --append /etc/apt/sources.list
sudo apt-key adv --keyserver --recv-keys 04EE7237B7D453EC
sudo apt-key adv --keyserver --recv-keys 648ACFD622F3D138
sudo sh -c 'printf "Package: *\nPin: release a=unstable\nPin-Priority: 90\n" > /etc/apt/preferences.d/limit-unstable'
sudo apt-get update
sudo apt install wireguard

I’ve transferred the created config from the WireGuard host to the WireGuard client and ran

sudo wg-quick up <ProfileName>

And it established really fast a connection. However, my problem was now that the SSH connection broke because all of the traffic to and from the client was going through the WireGuard VPN (like you would have used it for your phone when you’re in an unsecured WiFi and want to redirect all traffic through the VPN).

Luckily I was able to stop the connection by SSHing from the WireGuard VPN to the assigned IP of the WireGuard client and by using

sudo wg-quick down <ProfileName>

The question is now, how can I configure WireGuard Client to just know the route through the VPN to resources in the host network or vice versa how I can configure the WireGuard Host to provide other machines in the network a route to the connected client…

Use DDNS with Synology DiskStation

I’ve recently upgraded my webspace to the PrivatPlus tariff. As part of this tariff I’m now able to use DDNS running under the Domains I’m able to manage.

Setting up DDNS in KAS is explained quite well. However, I did not see instructions on how to use these credentials on a Synology DiskStation OS. Luckily, somebody else did this already.

The important part was, that when you’ll need to customize a DDNS provider first before it can be setup in DiskStation settings.

  • Go to Control Panel, External Access and click on Customize
  • Add a new name for the DDNS provider, e.g.
  • Use this Query URL (for IPv4):
  • Now you can add a new DDNS entry
  • Select as provider
  • Enter the credentials as required
  • Enter the hostname you want to setup for DDNS
  • Click on „Test Connection“
  • The state should be „Normal“
  • Click on „OK“

Auto mount NFS shares on Raspbian

I’m using influxdb on my Raspberry Pi in combination with a NFS mount. The NFS mount is on my Synology NAS and should store the database data of influxdb. Reason for this setup is that I fear that the SD card won’t survive the many write/read cycles caused by a database writing to it.

The shared folder on my Synology is configured to be accessible by various IPs in my network:

The problem with Raspbian is that I’ve tried to auto mount the NFS share on startup, so that the influxdb service can directly write to the NFS mount. 

I’ve used these settings in my /etc/fstab to mount the volume automatically:

<DS IP>:/volume1/databases /mnt/databases nfs auto,user,rw,nolock,nosuid 0 0

This doesn’t work properly since my influxdb is often dead after a restart, but if I check the mounted volumes I see the NFS volume mounted properly.

However, there’s a tool called autofs which already helped me with a similar problem on my Mac when I moved my iTunes library to the Synology share.

Install autofs using

sudo apt-get install autofs

Open the file /etc/auto.master and add something like this

/mnt    /etc/auto.databases     -nosuid,noowners

Now create a file called /etc/auto.databases with this content

databases       -fstype=nfs,user,nolock,nosuid,rw <DS IP>:/volume1/databases

Unmount the existing NFS share. Remove/comment out the line for the nfs mount in your /etc/fstab so that it doesn’t conflict with autofs. Restart autofs with

sudo service autofs restart

Now check the content of your mount point with e.g.

ls /mnt/databases

Autofs should now automatically mount the NFS share. This might take a while, which is a good sign that the mount is loaded. You can also verify with


that your NFS share is mounted to e.g. /mnt/databases. If you’ll restart now, influxdb should be happy on restart. When it tries to start, autofs will see the access to the mounted folder and will mount the NFS share before influxdb can start up properly.