diff --git a/cmd/incusd/daemon_storage.go b/cmd/incusd/daemon_storage.go index 00fd3cba6ef..9746f187e5a 100644 --- a/cmd/incusd/daemon_storage.go +++ b/cmd/incusd/daemon_storage.go @@ -111,6 +111,15 @@ func daemonStorageMount(s *state.State) error { return fmt.Errorf("Failed to mount storage volume %q: %w", source, err) } + // Ensure we have the correct symlink in place. + volStorageName := project.StorageVolume(api.ProjectDefaultName, volumeName) + + _ = os.RemoveAll(internalUtil.VarPath(storageType)) + err = os.Symlink(internalUtil.VarPath("storage-pools", poolName, "custom", volStorageName), internalUtil.VarPath(storageType)) + if err != nil { + return fmt.Errorf("Failed to set up symlink for %q: %w", storageType, err) + } + return nil }