Work Out Long-Term Data Storage Solution for Nextcloud #73

Closed
opened 2022-11-28 11:30:59 -08:00 by Jafner · 12 comments
Jafner commented 2022-11-28 11:30:59 -08:00 (Migrated from gitlab.jafner.net)

As we encountered permissions-related issues moving Nextcloud data to a SMB share (described in #72), we need to work out a long-term solution for storing expanding Nextcloud data.

A. Determine how to meet Nextcloud's permissions requirements for a shared volume.
B. Build out a more resilient and expandable storage solution for Nextcloud on the server itself.

The former is preferred.

As we encountered permissions-related issues moving Nextcloud data to a SMB share (described in [#72](https://gitlab.jafner.net/Jafner/homelab/-/issues/72)), we need to work out a long-term solution for storing expanding Nextcloud data. A. Determine how to meet Nextcloud's permissions requirements for a shared volume. B. Build out a more resilient and expandable storage solution for Nextcloud on the server itself. The former is preferred.
Jafner commented 2022-11-28 11:30:59 -08:00 (Migrated from gitlab.jafner.net)

assigned to @Jafner

assigned to @Jafner
Jafner commented 2022-11-28 12:39:15 -08:00 (Migrated from gitlab.jafner.net)

First thing we're going to try is stripping the ACL from the dataset on the TrueNAS side.

image

First thing we're going to try is stripping the ACL from the dataset on the TrueNAS side. ![image](/uploads/b1a3eac53aff4704ac89dad15f74508f/image.png)
Jafner commented 2022-11-28 12:40:44 -08:00 (Migrated from gitlab.jafner.net)

Although, the docs don't seem to mention it.

Although, the docs [don't seem to mention it](https://www.truenas.com/docs/core/uireference/storage/pools/datasetsscreen/).
Jafner commented 2022-11-28 12:48:58 -08:00 (Migrated from gitlab.jafner.net)

Took the following steps:

  1. Stripped ACL from the dataset.
  2. Unmounted the share. sudo umount /mnt/nas/DockerData
  3. Re-mounted the share. sudo mount /mnt/nas/DockerData
  4. Attempted to set directory permissions. sudo chmod 0770 /mnt/nas/DockerData/nextcloud/data/
  5. Check directory permissions stat /mnt/nas/DockerData/nextcloud/data/. Which returned the following:
  File: /mnt/nas/DockerData/nextcloud/data/
  Size: 0               Blocks: 0          IO Block: 1048576 directory
Device: 2ch/44d Inode: 745973      Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/    joey)   Gid: ( 1000/    joey)
Access: 2022-11-28 12:41:03.319280100 -0800
Modify: 2022-11-28 08:47:23.538615300 -0800
Change: 2022-11-28 08:47:23.538615300 -0800
 Birth: 2022-11-28 00:50:19.266262300 -0800
Took the following steps: 1. Stripped ACL from the dataset. 2. Unmounted the share. `sudo umount /mnt/nas/DockerData` 3. Re-mounted the share. `sudo mount /mnt/nas/DockerData` 4. Attempted to set directory permissions. `sudo chmod 0770 /mnt/nas/DockerData/nextcloud/data/` 5. Check directory permissions `stat /mnt/nas/DockerData/nextcloud/data/`. Which returned the following: ``` File: /mnt/nas/DockerData/nextcloud/data/ Size: 0 Blocks: 0 IO Block: 1048576 directory Device: 2ch/44d Inode: 745973 Links: 2 Access: (0755/drwxr-xr-x) Uid: ( 1000/ joey) Gid: ( 1000/ joey) Access: 2022-11-28 12:41:03.319280100 -0800 Modify: 2022-11-28 08:47:23.538615300 -0800 Change: 2022-11-28 08:47:23.538615300 -0800 Birth: 2022-11-28 00:50:19.266262300 -0800 ```
Jafner commented 2022-11-28 12:55:34 -08:00 (Migrated from gitlab.jafner.net)

Apparently it is possible to disable the Nextcloud permissions check by adding 'check_data_directory_permissions' => false, to nextcloud's config file (at $DOCKER_DATA/config/www/nextcloud/config/config.php). We'll keep this in mind if we can't figure out how to mutate permissions.

Apparently it is possible to [disable the Nextcloud permissions check](https://www.reddit.com/r/NextCloud/comments/piewqw/need_some_help_please_change_the_permissions_to/) by adding `'check_data_directory_permissions' => false,` to nextcloud's config file (at `$DOCKER_DATA/config/www/nextcloud/config/config.php`). We'll keep this in mind if we can't figure out how to mutate permissions.
Jafner commented 2022-11-28 13:00:24 -08:00 (Migrated from gitlab.jafner.net)

Yeah, we're just gonna do that. Our data does not exist in a multi-tennant environment.

Yeah, we're just gonna do that. Our data does not exist in a multi-tennant environment.
Jafner commented 2022-11-28 13:14:25 -08:00 (Migrated from gitlab.jafner.net)

Alright, I'm having more trouble than I expected getting the ACL set back up.

Encountered:

$ sudo rm -rf ./nextcloud/
rm: cannot remove './nextcloud/': Permission denied

The solution was to recursively apply a 775 ACL to the dataset in TrueNAS.

Alright, I'm having more trouble than I expected getting the ACL set back up. Encountered: ``` $ sudo rm -rf ./nextcloud/ rm: cannot remove './nextcloud/': Permission denied ``` The solution was to recursively apply a 775 ACL to the dataset in TrueNAS.
Jafner commented 2022-11-28 13:16:02 -08:00 (Migrated from gitlab.jafner.net)

mentioned in commit 0795e52712

mentioned in commit 0795e52712c5d5f758faf84c8ce816e6408f696c
Jafner commented 2023-01-25 08:35:52 -08:00 (Migrated from gitlab.jafner.net)

mentioned in issue #67

mentioned in issue #67
Jafner commented 2023-01-25 08:51:14 -08:00 (Migrated from gitlab.jafner.net)

Going forward, I think the proper solution is to provision a large enough local storage volume for current estimated user needs, then set up a regular job to rsync that directory /mnt/md0/nextcloud/data over to a backup location on the NAS.

Gonna do some quick maffs on the value prop of buying storage just to replace Google Drive.

I paid $265 for a 4TB SSD. Google "One Storage" does not offer a plan greater than 2TB, so we'll simply double that number: $20/mo. ($5/mo./TB). The break even point would be 13.25 months. Before that point, it is cheaper to use cloud storage.

Going forward, I think the proper solution is to provision a large enough local storage volume for current estimated user needs, then set up a regular job to rsync that directory `/mnt/md0/nextcloud/data` over to a backup location on the NAS. Gonna do some quick maffs on the value prop of buying storage *just* to replace Google Drive. I paid $265 for a 4TB SSD. Google "One Storage" does not offer a plan greater than 2TB, so we'll simply double that number: $20/mo. ($5/mo./TB). The break even point would be 13.25 months. Before that point, it is cheaper to use cloud storage.
Jafner commented 2023-01-26 23:52:30 -08:00 (Migrated from gitlab.jafner.net)

We've added a 4TB SSD at /mnt/data for use with Nextcloud. Until we need to increase capacity, the plan is:

  1. Configure Nextcloud to store data on the new volume.
  2. Set user quotas to 500 GB.
  3. Since users must be manually approved, we can implement a soft-limit on user count of 8, ensuring we are always within capacity.

With that, we can close this issue.

We've added a 4TB SSD at `/mnt/data` for use with Nextcloud. Until we need to increase capacity, the plan is: 1. Configure Nextcloud to store data on the new volume. 2. Set user quotas to 500 GB. 3. Since users must be manually approved, we can implement a soft-limit on user count of 8, ensuring we are always within capacity. With that, we can close this issue.
Jafner commented 2023-02-10 14:27:32 -08:00 (Migrated from gitlab.jafner.net)

mentioned in issue #74

mentioned in issue #74
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Jafner/homelab#73
No description provided.