Installing and using the second disk.

Hello.
For my smart home, I’m using my old laptop with CasaOS (Debian). Laptop configuration:
CPU: Core 2 DUO
RAM: 6GB
DISK 0: 120GB SSD
DISK 0: 700GB HDD (the drive is mounted, starts with the system, and contains the swap file)
Following Gemini’s advice, after installing Nextcloud, I added another volume in the program settings under cron - volumes. In the host, I specify:
/mnt/HDD_Storage/nextcloud_data/
In the container section:
/var/www/html/data

But the program doesn’t see the second drive, and still saves everything to the 120GB SSD.

Please help me and tell me how to properly install and configure the program so that it saves everything to the second drive (700GB HDD).

Thank you in advance.

Support intro

Sorry to hear you’re facing problems. :slightly_frowning_face:

The community help forum (help.nextcloud.com) is for home and non-enterprise users. Support is provided by other community members on a best effort / “as available” basis. All of those responding are volunteering their time to help you.

If you’re using Nextcloud in a business/critical setting, paid and SLA-based support services can be accessed via portal.nextcloud.com where Nextcloud engineers can help ensure your business keeps running smoothly.

Getting help

In order to help you as efficiently (and quickly!) as possible, please fill in as much of the below requested information as you can.

Before clicking submit: Please check if your query is already addressed via the following resources:

(Utilizing these existing resources is typically faster. It also helps reduce the load on our generous volunteers while elevating the signal to noise ratio of the forums otherwise arising from the same queries being posted repeatedly).

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can. :heart:

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • replace me
  • Operating system and version (e.g., Ubuntu 24.04):
    • replace me
  • Web server and version (e.g, Apache 2.4.25):
    • replace me
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • replace me
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • replace me
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • replace me
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • replace me

Summary of the issue you are facing:

[…]

Steps to replicate it (hint: details matter!):

Log entries

Nextcloud

Please provide the log entries from your Nextcloud log that are generated during the time of problem (via the Copy raw option from Administration settings->Logging screen or from your nextcloud.log located in your data directory). Feel free to use a pastebin/gist service if necessary.

PASTE HERE

Web Browser

If the problem is related to the Web interface, open your browser inspector Console and Network tabs while refreshing (reloading) and reproducing the problem. Provide any relevant output/errors here that appear.

PASTE

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Configuration

Nextcloud

The output of occ config:list system or similar is best, but, if not possible, the contents of your config.php file from /path/to/nextcloud is fine (make sure to remove any identifiable information!):

PASTE HERE

Apps

The output of occ app:list (if possible).

Tips for increasing the likelihood of a response

  • Use the preformatted text formatting option in the editor for all log entries and configuration output.
  • If screenshots are useful, feel free to include them.
    • If possible, also include key error output in text form so it can be searched for.
  • Try to edit log output only minimally (if at all) so that it can be ran through analyzers / formatters by those trying to help you.

Hi @Emil_K,

Before we can help, the support template is still empty — all fields still say “replace me”. Please fill in at least the Nextcloud version and installation method.

On the volume mapping

Adding a volume in CasaOS maps a host directory into the container, but it does not tell Nextcloud to use that directory for data storage. Nextcloud’s data directory is configured separately in config.php. If Nextcloud was already set up before you added the volume, it was initialized with the old path and still points there regardless of the new mapping.

Two questions to move forward:

  1. Was Nextcloud already installed and used before you added the volume, or did you add it before the first run?

  2. What does datadirectory say in your config.php? You can find it by opening a terminal in the Nextcloud container and running:

grep datadirectory /var/www/html/config/config.php

If Nextcloud was already used and data exists at the old location, simply remapping the volume is not enough — the data needs to be migrated properly. There is a how-to that explains the underlying concepts well: HOWTO: Change / Move data directory after installation. The background section explains why a simple file move is not enough (config.php and database tables both need to be updated), which is useful to understand regardless of the deployment method.

A note on AI advice

Following suggestions from AI assistants (Gemini, ChatGPT, or others) for infrastructure configuration is risky — they often produce plausible-sounding steps that are subtly wrong or incomplete for your specific setup. For anything touching data storage it is worth cross-checking against the official documentation or this forum before applying.


h.t.h.


ernolf

Hello, thank you for your reply. Sorry for the late reply. Unfortunately, I can’t tell you the Nextcloud version; I’m installing it from the CasaOS App Store.
Q. Was Nextcloud already installed and in use before adding the volume, or did you add it before the first launch?
A. No. I installed the second hard drive first. Then I installed Nextcloud from the CasaOS App Store.
Q. What does the datadirectory field in your config.php file say?
A. ‘datadirectory’ => ‘/var/www/html/data’,