Is an External Storage Setup a good idea?

Hi,

I’m in the process of setting up a small private NAS/Cloud and have a couple of choices to make which i need help with.

My system contains two 4TB HDDs running in Raid 1 and a single SSD for the OS, which is a fresh install of Ubuntu Server 18.04.3 LTS.

Now my idea is to store the data in a directory on the Raid partition (e.g. /mnt/raid/cloud) and connect it to Nextcloud as an external storage. I would like to maintain my own file structure so i can easily use SMB etc., so this to me seems the best way to do it.

Q1: Are there performance disadvantages compared to making this directory Nextclouds native data directory? If there are, I might be willing to give up control over the data structure and leave it to Nextcloud.

Q2: Is ext4 a good choice for the data partition?

Q3: How do i need to set up the permissions so that the Nextcloud snap (running on the SSD) can r&w in that directory?

I must add that my knowledge of both Linux and Nextcloud is quite rudimentary, but im happy to learn.

Thanks in advance,
Jasper

  1. The biggest performance disadvantage will be that Nextcloud will scan the current directory for changes on every page load (if you use the external storage module). However, it is useful for some things, and I actually do this for data that lives beyond Nextcloud and it’s available read-only from a certain Nextcloud account that I created (for video game roms, movies, shows, etc.). If you are only using Nextcloud to add/edit/remove data from this location, I would recommend against external storage. You can use your setup the way you described, but just use NFS and point Nextcloud to that directory for your data store (I do this between a FreeNAS box and my Nextcloud VM).
  2. I think ext4 is a fine choice for data. This comes down to whatever system you’re using for the RAID setup, but there’s a lot of debate about filesystems and in my opinion it’s much more important to have a good backup plan. You also need to consider how critical your data is, and if you can afford to flip a bit here and there over the course of several years. That being said, I like FreeNAS with ZFS because of its scrub and repair ability. If you’re on Linux, there’s debate about ZFS on Linux or BTRFS, so you can do your own research and decide if it’s worth going down that road. If I was running a NAS on Linux, I would just use ext4.
  3. Sorry, I’m not sure on that one as I haven’t used snaps much. I did find this article which is probably a good start:

Thank you, thats already quite helpful!

I mostly use my Nextcloud Server to sync Files between it and my Laptop, often via the Internet. Mostly using the Nextcloud Client, but also via the Web Client. So I assume deciding against external storage would be quite beneficial for me.

My previous setup was actually FreeNAS with Nextcloud as a Plugin, but i was just too incompetent to get things like https and onlyoffice running properly. So i decided to go with a simpler solution of using Ubuntu, which I am at least a little bit familiar with.

So I think I will go with your suggestion. Could you just quickly explain why NFS is beneficial in this case? And would I only change the data directory of nextcloud or put the whole nextcloud installation onto the raid drive, instead of /var/www/html/nextcloud?

Thanks a lot!
Jasper

Off the top of my head, I don’t remember the details but there is something about being able to change the permissions when using NFS as opposed to using samba/cifs, so I went with NFS instead and never looked back (as long as you don’t need to mount that share in Windows).

Pros and cons :slight_smile: It’s up to you, but what I tend to do is put application code right in the web server and data in another location. If you lose your Ubuntu server, you still have your data. If you lose your raid, you at least still have your nextcloud configuration for what it’s worth.

Setting up a custom data directory for Nextcloud is possible (and I do this personally), but it’s not something that can be changed later (not easily or in a supported way at least). So another option might actually be to mount the NFS share directly into /var/www/html/nextcloud/data so that you don’t have to mess with Nextcloud data config settings.

Mounting the NFS share into /var/www/html/nextcloud/data is a really good idea, I didn’t even think of that. The less i have to change in any config files, the less i can mess up. I’ll try it out tonight and let you know how it goes.

Thank you!

1 Like

Yep, that’s how I would do it if I were to start over. Plus it’s easy to switch out the data backend by just mounting something else in that location.