Nextcloud. I can mount a dataset as local external storage as, but the folder is empty looking from Nextcloud?

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Truenas core 13
Nextcloud 26.0.1

In the jail for NC I have mounted:-
/mnt/NAS-main/cavern TO /mnt/NAS-main/iocage/jails/nextcloud-jail/root/usr/local/www/nextcloud/cavern

I can see the folder "cavern" in NC but not any of the content, no files, no folders?

From the NC jail shell, this is the folder and its content

Code:
root@nextcloud-jail:/usr/local/www/nextcloud/cavern # ls -al
total 227
drwxr-x---  13 1000  wheel   13 Feb  1 23:50 .
drwxr-x---  17 www   www     32 May  5 01:19 ..
dr-xr-xr-x+  3 root  wheel    3 Jan 14 00:16 .zfs
drwxr-xr-x   4 1000  wheel    4 Jan 14 00:17 $RECYCLE.BIN
drwxr-xr-x   7 1000  wheel    8 Apr 30  2021 LINUX_BACKUPS
drwxr-xr-x   3 1000  wheel    3 May 27  2022 mandie-backup
drwxr-xr-x   7 1000  wheel    9 Sep 14  2018 MumDad_backup
drwxr-xr-x   3 1000  wheel  509 Jan 14 00:18 mums_films
drwxr-xr-x  34 1000  wheel   36 Sep 14  2018 My Docs win 7
-rwxr-xr-x   1 1000  wheel    2 Jul 14  2021 NAS.txt
drwxr-xr-x   9 1000  wheel   12 Jan 18 16:07 Operating Systems
drwxr-xr-x  21 1000  wheel   24 Jul 14  2021 PROGRAMDATA
drwxr-xr-x  26 1000  wheel   26 Sep 14  2018 Software
drwxr-xr-x   2 1000  wheel    4 Jan 14 00:16 System Volume Information


from Truenas it looks like this:-
Code:
jack@truenas /mnt/NAS-main/cavern $ ls -al
total 227
drwxr-xr-x  13 jack  wheel   13 Feb  1 23:50 .
drwxr-xr-x  11 root  wheel   10 Mar 23 10:57 ..
dr-xr-xr-x+  3 root  wheel    3 Jan 14 00:16 .zfs
drwxr-xr-x   4 jack  wheel    4 Jan 14 00:17 $RECYCLE.BIN
drwxr-xr-x   7 jack  wheel    8 Apr 30  2021 LINUX_BACKUPS
drwxr-xr-x   3 jack  wheel    3 May 27  2022 mandie-backup
drwxr-xr-x   7 jack  wheel    9 Sep 14  2018 MumDad_backup
drwxr-xr-x   3 jack  wheel  509 Jan 14 00:18 mums_films
drwxr-xr-x  34 jack  wheel   36 Sep 14  2018 My Docs win 7
-rwxr-xr-x   1 jack  wheel    2 Jul 14  2021 NAS.txt
drwxr-xr-x   9 jack  wheel   12 Jan 18 16:07 Operating Systems
drwxr-xr-x  21 jack  wheel   24 Jul 14  2021 PROGRAMDATA
drwxr-xr-x  26 jack  wheel   26 Sep 14  2018 Software
drwxr-xr-x   2 jack  wheel    4 Jan 14 00:16 System Volume Information


I have followed many web pages on this subject but i cant figure it.

I do have access via samba but several of the other threads say to not use network connection types, but i should use "local" which makes sense since it right there on the same machine.

I have a green tick.
Screenshot_20230505_024248.png


Anyhow, I can see the mounted "cavern" dataset, but I can't see anything in it when looking from Nextcloud?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You have a little clue there in the output from the jail shell.

Nextcloud is running in the context of www:www so if you want it to see files, you need the permissions to match that.
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Im so confused at the best of times regarding file permissions, let alone a jail inside a nas. The last instruction that i read said to use the ACLs add a user and make all the permissions recursive but that messed up my smb shares.

What are you saying? That i need to change the permissions of all the files? or the ownership? is that just in the jail? Or make a user or group www but in NC but not in TN. Whatever i do i must not mess-up the smb shares.



Ahh, i just dont understand, it's too early.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The way you want it to work is not the way it works...

Nextcloud doesn't want to (is not designed to) share its locations with another means of sharing.

You will either need to abandon your idea to have the data in Nextcloud or abandon the idea of having an SMB share of the Nextcloud data.

If you want to have it in Nextcloud the way you're trying to, you'll need to change the ownership of the files (at least the group) to www from inside the jail as that's where that user is.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You will either need to abandon your idea to have the data in Nextcloud or abandon the idea of having an SMB share of the Nextcloud data.
I have had an SMB share as external storage in my Nextcloud for ages. Difference being that I do not use ACLs for SMB at all - only traditional Unix file privileges, combined with "force user" and "force group" in Samba.
I mount that share into the jail read-only, because I don't want two different access paths to mess with the same data. I agree with you in that regard. But read-only to share via Nextcloud - never been a problem.

The OP probably needs to get their ACLs right. Sorry, I have no deeper knowledge here.
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
What!
You mean i can either have local access to all my personal devices that i use as a sync & backup device
OR
I can share my server with family and friends via a user-friendly UI (which was what i brought the whole system for)

But i can't do both?

*Checks this is not 1st April*

Please tell me you're not being serious ? (£1K , down the drain) I cant have them use ftp or whatever. This cant be!
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
I have had an SMB share as external storage in my Nextcloud for ages. Difference being that I do not use ACLs for SMB at all - only traditional Unix file privileges, combined with "force user" and "force group" in Samba.
I mount that share into the jail read-only, because I don't want two different access paths to mess with the same data. I agree with you in that regard. But read-only to share via Nextcloud - never been a problem.

The OP probably needs to get their ACLs right. Sorry, I have no deeper knowledge here.
Ahh sounds more promising :)

I am not using ACL's for these files. I removed it after a shock form other instructions.

Ok, so what do i need to do?
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
O and they are mounted "read-only" as well because i didnt NOT want to lose them.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
OK, I would not mount into /usr/local/www/nextcloud in the first place. Pick something outside of the tree managed by pkg and friends like /var/nextcloud/<sharename> or similar.

Then inside the jail try e.g. su -m www -c "ls -l /var/nextcloud/<sharename>". If that works, the Nextcloud runtime user can access the data inside the share. Then in Nextcloud add the external storage.

Works like this here.
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
@Patrick M. Hausen Ok so i was originally mounting to "cavern" show below:- (before one of the instruction sites told me to mount where it currently is)

Code:
jack@truenas /mnt/NAS-main/iocage/jails/nextcloud-jail/root/mnt $ ls -al
total 13
drwxr-xr-x   3 root  wheel   3 May  4 23:58 .
drwxr-xr-x  19 root  wheel  22 Jan  5 18:24 ..
drwxr-xr-x   2 root  wheel   2 May  4 23:58 cavern


Is this location ok? It just /mnt/cavern in NC
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I don't see why not :smile:
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Yes ...
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Code:
root@nextcloud-jail:~ # su -m www -c "ls -l /mnt/cavern"
total 203
drwxr-xr-x   4 1000  wheel    4 Jan 14 00:17 $RECYCLE.BIN
drwxr-xr-x   7 1000  wheel    8 Apr 30  2021 LINUX_BACKUPS
drwxr-xr-x   3 1000  wheel    3 May 27  2022 mandie-backup
drwxr-xr-x   7 1000  wheel    9 Sep 14  2018 MumDad_backup
drwxr-xr-x   3 1000  wheel  509 Jan 14 00:18 mums_films
drwxr-xr-x  34 1000  wheel   36 Sep 14  2018 My Docs win 7
-rwxr-xr-x   1 1000  wheel    2 Jul 14  2021 NAS.txt
drwxr-xr-x   9 1000  wheel   12 Jan 18 16:07 Operating Systems
drwxr-xr-x  21 1000  wheel   24 Jul 14  2021 PROGRAMDATA
drwxr-xr-x  26 1000  wheel   26 Sep 14  2018 Software
drwxr-xr-x   2 1000  wheel    4 Jan 14 00:16 System Volume Information


Looking good :), so far. I am just tinkering to see if anything shows up in NC
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Yes, yes YES . O thank you :)

Screenshot_20230505_101303.png

Still checking things but O so close now. Thank you.
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
Just found that "sharing not allowed" for local files.

I was assuming that if i could access files as the admin user on NC that i would be able to allow or disallow shares to my family accounts and all that good stuff through NC.

But no, ofc not. That would just be to simple :(
Screenshot_20230505_102919.png
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You need to activate sharing when adding the external/local storage as an administrator:
Bildschirmfoto 2023-05-05 um 11.48.09.png
 

jackdinn

Contributor
Joined
Jun 14, 2022
Messages
102
:smile: Yep, just found it as you posted :smile:
Thank you ever so much for your help this morning.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Nextcloud users could write to the files. If that happens simultaneously with writes via SMB probably nobody knows what will/can happen.
 
Top