-
-
Notifications
You must be signed in to change notification settings - Fork 216
Wiki Change data directory
Removable media can be any device (e.g. external-disk-partition, NFS-network mount, ZFS-device, SSHFS-network mount etc.).
The device should be available at system boot and mounted to /media/
or /mnt/
via /etc/fstab
.
Tipp: Ensure USB-boot is disabled in BIOS or use the
--nofail
option in/etc/fstab
for headless boot, especially when connecting an external USB-device.Tipp: Recommend creating a dedicated directory in
/media/MYDIRECTORY/
or/mnt/MYDIRECTORY/
and mounting the dedicated directory in/etc/fstab
instead of Ubuntu's "automount"/media/$USER/DEVICE/
directory.
Removable media must be mounted to either /media
or /mnt
as root with root permissions and connected to Snap!
sudo snap connect nextcloud:removable-media
common error message when media is not connected to Snap
Internal Server Error
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
See editing configuration file config.php
The procedure to a) move or b) define the data directory in Nextcloud snap is different when an admin-user exists or an admin-user still needs to be created:
a) Move data directory after installation (admin-user exists) in /var/snap/nextcloud/current/nextcloud/config/config.php
Example: /var/snap/nextcloud/current/nextcloud/config/config.php
// ...
'datadirectory' => '/media/nextcloud/data',
// ...
OR
b) Define data directory before installation (admin-user needs to be created) in /var/snap/nextcloud/current/nextcloud/config/autoconfig.php
Example: /var/snap/nextcloud/current/nextcloud/config/autoconfig.php
// ...
'directory' => '/media/nextcloud/data',
// ...
Tip: Ensure installation is completed and admin-user is created before rebooting
By default, the data directory in Nextcloud snap is .../data
!
'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data'
So regardless which procedure is used, the path to the data directory must include the complete path including .../data
because this is where the required .ocdata
file is located.
Common error message for incorrect path in config file
Error
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.
Zpools may be bind mounted to accomplish data access by the snap
For example, create a new directory (e.g.
mkdir -p /mnt/zpool_nc
)Depending on where your zpool exists (e.g.
/pool/tank0
), you can create a bind mount to allow the snap to acces/manage your data
mount -o bind /pool/tank0 /var/snap/nextcloud/common/nextcloud/data
see also path to data directory
Nextcloud snap Wiki, use all information and scripts at own risk