Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Mount a USB drive as Nextcloud external storage?


  • Hello,

    I'm currently migrating my stand-alone Nextcloud server to Cloudron. I'm interested mounting an external USB drive as the location for the Nextcloud user data, as follows:

    • mount an external USB drive as follows:
    /dev/sdb1       917G  726G  145G  85% /nc_data
    
    • add the drive to the Nextcloud config.php:
    'datadirectory' => '/nc_data',
    

    If it makes it simpler - I want to use the whole disk for Nextcloud user data - I don't plan on having any other apps using it.

    I've seen using external storage being mentioned, in other threads, but am not 100% sure if its possible.

    Can someone confirm if it is?
    Thanks.

  • Staff

    Generally in such a case it is best to configure the app on Cloudron to use a different data directory, in your case that external USB drive, see https://cloudron.io/documentation/storage/#app-data-directory

    However moving an app to that requires the destination directory to be empty, which I assume in your case is not intended. I don't know a good solution here from the top of my head, will discuss with @girish later then.


  • @nebulon said in Mount a USB drive as Nextcloud external storage?:

    However moving an app to that requires the destination directory to be empty, which I assume in your case is not intended. I don't know a good solution here from the top of my head, will discuss with @girish later then.

    Thank you @nebulon. I appreciate that. I'll wait to hear from you later on.

    I am still figuring out how Cloudron works, hence all the slightly curveball questions. 🙂

  • Staff

    Currently, you have to move the app to a different data directory and then manually copy over files from the USB to this data directory.

    (We cannot support the case where the directory already exists because Cloudron packaging scripts create files in this data directory which most likely existing data directories won't have.)

  • Staff

    One option here is to create a new empty folder on that external disk, then move a freshly installed Nextcloud instance to that folder. Once that is done, you can move the existing files on the same disk into that folder into the expected subfolder for the Nextcloud user you want to files to be present.