Everything appears fine, no error messages from docker, new files are written in the new datadir on the external harddisk, just 2 things are odd:
In the admin webinterface: Administration settings => System shows the wrong/old hardisk with 100 GB and reports it as half full, whereas the new, external disk would have 1 TB. I wonder what happens if the old hardisks limit is met? Question: Is that something I have to live with because I changed only the datadir, not dockers container location?
The new disk is not mounted. It was mounted under /dev/sdb1 before I stopped the docker container. I even had an fstab entry and mounted it from there.
Now, ‘mount -l’ and other hd tools won’t show /dev/sdb1. However, nextcloud files are visible under the mount point “/path/to/my/external/ext4/usb/harddisk” and new files appear there. Question: Is this because docker kind of took over the mounted disk, dismounted it and remounted it in some docker way? In short, is this normal?
this a bad prerequisite to successfully run a self-hosted system. I would recommend you read and follow 101: Self-hosting information for beginners and learn technologies relevant for you e.g. docker
this two statements don’t make any sense
and
I can not imagine any situation how your old data could be visible from old location but new data stored in new location.
I bet you missed to completely recreate your containers:
If it was started already, you will need to stop the mastercontainer, remove it (no data will be lost) and recreate it using the docker run command that you initially used). Allowed values for that variable are strings that start with / and are not equal to / . The chosen directory or volume will then be mounted to /mnt/ncdata inside the container.
but at the end best way to analyze where the problem comes from is to check what/how the data is visible inside of the container (use docker exec or docker compose exec with right container name and run ls -al /mnt/ncdata)
Also take into account the article you mentioned only covers switching the mount point of you data directory - you still must copy/sync files from old location to new destination.
and one last hint - “external harddisk” is definitely not a recommended setup for production. such devices could introduce headaches e.g. if the drives is suddenly disconnected, not initialized (quick enough) at reboot etc. if possible use internal drives for application storage.
Hello, thank you for the quick and helpful reply, I apologize for the lateness of mine: It works now.
I reinstalled AIO with --env NEXTCLOUD_DATADIR=“/path/to/my/external/ext4/usb/harddisk” and this time there were no issues.
My best guess for the above problem is that I, contrary to my memory as stated in 2., did not mount the external hdd before the first install.
The second time, I triple checked that the drive was mounted before reinstalling.
“external harddisk” is definitely not a recommended setup for production. such devices could introduce headaches e.g. if the drives is suddenly disconnected, not initialized (quick enough) at reboot etc. if possible use internal drives for application storage
Yes, I think that NEXTCLOUD_DATADIR should be the equivalent of /home on Linux or /User on Macs: Just store the user data there, probably excluding admin. That way, Nextcloud could still operate on disconnects with only user data missing. Unfortunately Nextcloud seems to store files that are crucial to the instance operation there, so that when that directory disconnects for some reason, Nextcloud can’t start.
So using an internal HDD is probably the safest method.
However, this was not an option for me because the nextcloud host machine is quite old and I couldn’t install a HDD with large capacity there. Also, the external HDD can disconnect, yes, but the data is more accessible this way. In emergencies, I could plug it out and plug it in somewhere else and access the data. I think that is an advantage!
Anyway, this topic could be closed, as the problem is solved for me. Thanks again!