This page documents what to do when you hit Issue #4385 where you get the error "Cannot mount NetworkVolume at /data/mounts/NetworkVolume because it is not empty".
(Steps derived from helpful comment by Kjeldgaard here: home-assistant/supervisor/issues/4358#issuecomment-1818009197)
Install Advanced SSH & Web Terminal add-on.
Configure it (Settings > Add-ons > Advanced SSH & Web Terminal > Info tab)
- Turn off Start at Boot
- Turn on Auto Update
- Turn off Show in sidebar in the Add-on config (optional)
- Disable Protection mode in the Add-on config
Configure it (Configuration tab) (docs) by clicking the “Configuration” tab
- Set
ssh.user
to a new username notroot
for more obscurity - Add to
ssh.authorized_keys
a new ssh key (I manage mine with Secretive.) - Change the port to something other than
22
for more obscurity
Start the add-on.
Check the Logs tab of the add-on to be sure it worked.
Stop the add-on
My setup breaks because when my NAS reboots I have to login and remount the encrypted volumes before it exposes them to CIFS.
Instructions for Synology:
- Login to the NAS
- Go to Control Panel > Shared Folder > habackups > Encryption drop-down menu > Mount
- Enter the Encryption Key from 1Password
- Verify the mount name by going to (Home Assistant > Settings > System > Storage > Network Storage)
- Go to add-on config of Advanced SSH & Web Terminal and start the add on
- ssh in:
ssh -p THE_PORT_YOU_CHOSE -l THE_USER_YOU_CHOSE homeassistant.local
- Run
sudo docker exec -it $(sudo docker ps -f name=supervisor -q) bash
to escape the sandbox of the SSH terminal - Run
ls -lht /data/mounts/MOUNT_NAME_FROM_STEP_ONE/
to verify the situation. It should show a few recent tar files only. - Run
mkdir /data/mounts/lost_backups
to keep the backups for later if you want - Run
mv /data/mounts/MOUNT_NAME_FROM_STEP_ONE/* /data/mounts/lost_backups
to empty out the mount point or runrm /data/mounts/MOUNT_NAME_FROM_STEP_ONE/*
- Run
ls /data/mounts/MOUNT_NAME_FROM_STEP_ONE/
to be sure it's empty exit
to leave the docker containerexit
to leave the ssh connection- STOP THE Advanced SSH add-on! Do not forget this! It’s a disaster waiting to happen. from the add-on config.
- Remount from the UI (System > Storage > Network Storage)
- Check that the network-hosted backups are now visible to home assistant (System > Backups) NOTE: it takes several seconds before the list loads! It will say “no backups” while it loads.
- Click the meatball menu in the top right and ensure “Default Backup Location” is the NAS disk not Data Disk
- Force a full backup for good measure (click + Create Backup and name it “Full backup yyyy-mm-dd”)
- When finished, login to the NAS and look to be sure it's there. (For Synology that's in File Station)
If you get the following issue (check the logs > Supervisor
for BAD_NETWORK_NAME
),
it's likely that the NAS "volume" is not mounted (decrypted) on NAS (which is a pre-requisite for homeassistant to mount it, obviously). Check Step 1 above.
Jan 11 18:28:10 homeassistant systemd[1]: Mounting Supervisor cifs mount: netdisk2_habackups_2...
Jan 11 18:28:10 homeassistant kernel: CIFS: Attempting to mount \\netdisk2.local.\habackups
Jan 11 18:28:11 homeassistant kernel: CIFS: VFS: BAD_NETWORK_NAME: \\netdisk2.local.\habackups
Jan 11 18:28:11 homeassistant kernel: CIFS: VFS: cifs_mount failed w/return code = -2
Jan 11 18:28:11 homeassistant mount[1366353]: mount error(2): No such file or directory
Jan 11 18:28:11 homeassistant mount[1366353]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
Jan 11 18:28:11 homeassistant systemd[1]: mnt-data-supervisor-mounts-netdisk2_habackups_2.mount: Mount process exited, code=exited, status=32/n/a
Jan 11 18:28:11 homeassistant systemd[1]: mnt-data-supervisor-mounts-netdisk2_habackups_2.mount: Failed with result 'exit-code'.
Jan 11 18:28:11 homeassistant systemd[1]: Failed to mount Supervisor cifs mount: netdisk2_habackups_2.