How external SSD (USB) only for Nextcloud as main storage? - (RPI 4 with DietPi, MINT, Pi-hole & Nextcloud)

Good evening everyone,

I have a question: Nextcloud data should be stored directly on an external SSD (connected via USB 3.0). How do I set this in Nextcloud on the DietPi system?

Here is my detailed compilation of what I use and how it has just been set up.

Hardware

  • Raspberry 4 (1 GB)
    ScanDisk Ultra 16 GB MicroSD (10, A1 HC)
    WD Green SATA SSD 120 GB hard disk (via SATA > USB cable connected to the Raspberry on a 3.0 USB)

Software before/for installation

  • Download: DietPi_Rpi-ARMv6-Buster
    Laptop (Linux Mint 19.2 Cinnamon): balenaEtcher-1.5.64-x46
    Image of DietPi successfully flashed on the MicroSD

operation

(What I didn’t use / skipped)

  • Optional (DietPi-Config)
    Optional (Obtain IP Address)

Software to install I have selected the following during the installation

  • MATE (Desktop)
    Nextcloud (Cloud)
    Pi-hole (DNS server)

I bought the PI for exactly the two applications (Nextcloud and Pi-hole).

After selecting the software and the installation (it took some time until everything was ready), I was able to log into MATE. After that I first connected the external SSD hard drive and could see and format (ext4) it immediately via the “DietPi-Drive Manager”. Everything ran without problems. The SSD is displayed as “/dev/sda1” with a long “/mnt/ID…”.

Then I called the browser, opened Pi-hole, set it up and called Nextcloud via the web interface. After logging in, it shows me the “sda1” under “Settings > System” under “Disk”. So far, I think everything is great.

Further information
I have read in various forums (German/English) again and again that you would have to transfer the whole system to the external if you wanted to permanently store your data there with Nextcloud. (If I interpret this correctly)

I don’t understand it that well. I don’t want to move all my (system) data from the MicroSD to the external, but only allocate the external data as storage space for Nextcloud. DietPi, MATE, Pi-hole etc. should remain normal on the MicroSD.

Excuse the long text.
Many greetings from Germany.

René

The easiest way to do this is the following: Open dietpi_launcher, go to DietPi-Drive_Manager and select the external drive (assuming it is mounted) to see available options. There you will find the the option “Select to transfer DietPi user data to this drive”. When you check this option the folder dietpi_userdata, including Nextcloud data, will be moved to the external disk.

Jep indeed this is recommended anyway to not have the I/O heavy database on the SDcard. Alternatively there is a dietpi.txt option to choose Nextcloud data location before installing it, but that does not include the database, hence only makes sense if you want to further separate the data.