Nextcloud Memories in Proxmox: External Storage SMB shared as Root folder (The efficient way!)

/ January 21, 2024/ Smart Home

(Last Updated On: January 21, 2024)

SMB Shares managed by Nextcloud are not good for the Memories app because it needs to have access to the complete file to analyze it. But there is an efficent way to use it!

Ad:

I had this problem because I have several family video files on my NAS, they had a size between 3 GB and 20 GB. While running occ memories:index each one of those files had to be temporally downloaded to the server to analyze, and since it is a blocking process, there was no way to see if it was still downloading or even if it failed due to network issues.

My first idea was to move it into my Nextcloud User’s Data Folder which was also moved to an SMB Shared living on my NAS, but the thing is, I do not want it to completely depend on Nextcloud to change/add folders, and I also want to let other apps read them.

First (mostly successful attempt)

After a little chat with the developer on discort, I got the idea to mount SMB storage with the Proxmox UI (Datacenter -> Storage -> Add) using fotos_familia as name, and then pass it through my container editing /etc/pve/lxc/[your-container-id].conf and adding:

mp1: /mnt/pve/fotos_familia,mp=/mnt/fotos_familia

After rebooting the container, I went into Nextcloud administration panel to install the External Storage plugin and configure it to read /mnt/fotos_familia

Once nextcloud itself indexed those folders (they had sizes instead of be listed as “Pending”) calling occ memories:index worked as excepted.

but…

The mount is a read-only mount, because it is owned by the proxmox root user. So thinks like upload from the Nextcloud or Memories apps to that folder will not work.

Ad:

A best way is possible

Following the idea from Proxmox: Nextcloud into an unprivileged LCX container with a mounted SMB as Data folder, we can do the same and instead of use the Proxmox UI mount the share into /etc/fstab and pass it to nextcloud giving permissions to www-data to modify stufff.

All the steps needed are really the same of the “Step 2: Mount the SMB/CIFS storage” part of the linked post but with the name you want to use, at the end, you will end with this on your /etc/fstab file:

//x.x.x.x/path-to-my-fotos_familia-folder /mnt/nas-one/fotos_familia_for_nextcloud cifs credentials=/root/.nextcloud_smb_credentials,uid=100033,gid=100033,dir_mode=0770,file_mode=0770 0 0

Where:

  • //x.x.x.x/path-to-my-fotos_familia-folder is your smb photos folder.
  • /mnt/nas-one/fotos_familia is the name that will be used on /etc/pve/lxc/[your-container-id].conf
  • /root/.nextcloud_smb_credentials are your credentials

Again, see the other post for a complete explanation of that command.

Now activate the new mount using:

systemctl daemon-reload && mount -a

Update the container config (see that I do not point to /mnt/pve anymore)

mp0: /mnt/nas-one/fotos_familia_for_nextcloud,mp=/mnt/nas-one/nextcloud

After reboot of your container, you should be able to use the new mount as external storage and assign it to the Memories App using `/mnt/fotos_familia/`

Profit!

Ad:
Spread the love
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments