I set up nextcloud on an older i5 laptop using an external usb harddrive to test and become familiar with the environment.
The other day I completed setup. Created admin and one (1) user.
Moved the data folder to the external hard drive
Created folders in nextcloud and uploaded some files to that folder.
Created a sync_test folder and synced a folder from my computer to that folder in nextcloud.
Shared folders with a group so the regular user can view.
Verified via ssh that folders and files were being written to the external drive
This morning logged via ssh and everything in the data folder is gone except a folder labeled: appdata_oc3s442i4vbc
Nextcloud opens to the: Your data directory is invalid. No .ocdata file found.
The config.php file still points to my updated folder structure.
I’m not sure what happened to the folders on the drive, which is formatted in ext4.
Below are the steps I took from start to finish to set up the environment.
Any help is greatly appreciated.
Install ubuntu 22.04 desktop - did this for the interface for personal ease and the automount feature.
*1. Update and upgrade
2. * Install openssh-server
3. * Sudo snap install nextcloud
4. * sudo ufw allow 80/tcp
5. * sudo ufw allow 443/tcp
6. * Log into nextcloud -create admin - enable external drive app
7. * Sudo snap stop nextcloud
8. * sudo snap connect nextcloud:removeable-media
9. * sudo mkdir /media/datadisk
10. * sudo mkfs.ext4 -j -L DataDisk /dev/sdb
11. * sudo blkid /dev/sdb - grab uuid
12. * sudo nano /etc/fstab - add: /dev/disk/by-uuid/4006fe68-879a-41ed-b4da-cc0e6bc6b4bb /media/datadisk auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=NewHDD 0 0
13. * sudo mount -a
14. * sudo mv /var/snap/nextcloud/common/nextcloud/data /media/datadisk/ncdata
15. * sudo nano /var/snap/nextcloud/current/nextcloud/config/config.php - change datadirectory to: /media/datadisk/ncdata
16. * sudo chown -R root:root /media/datadisk/ncdata
17. * sudo chmod 0770 /media/datadisk/ncdata
18. * sudo snap start nextcloud
Now only the folder structure : /media/datadisk/ncdata exists with the subfolder appdata_oc3s442i4vbc
Thanks for any help as to what I may have done.