Score:0

Permission denied when attempting to cd into a symlinked folder over samba

in flag

I currently have a couple of Ubuntu servers that each contain 13 hard drives that I need to make accessible to each other over a samba network. Currently each drive is mounted as a separate share, and this works. But I was hoping that instead I could mount (via fstab) a single shared folder, and in that folder create symbolic links to each of the 13 drives. So Server 1 would have a folder called SambaMount, and in it would be 13 symbolic links, each to the shared folder on each drive. Then I could just mount SambaMount on Server 2 and only have to deal with a single shared folder that would greatly simplify my /etc/fstab and it'd be easier to monitor and set consistent security settings for.

The problem is that when I try to set this up, I can see the symlinked shared folder that exists on a hard drive on Server 1 by doing ls -lt in my new SambaMount shared folder on Server 2, but if I try to cd into that symlink directory, I get "permission denied", even as root. I have added "follow symlinks = yes" to smb.conf, but that doesn't help. Whenever I try to add any combination of "use extensions = no", "wide links = yes" or "allow insecure wide links = yes" to my smb.confs, it not only doesn't help with the new share I'm trying to create but all the existing single-drive mounted shares disappear as well.

It doesn't seem to me that user permissions could be the issue, since I can cd into those drives just fine via the samba shares that I set up for each individual drive, and I'm using the same credentials.

Any ideas? I'd rather not try to make these 13 drives into an LVM if it can be helped to achieve the objective, as I don't want a single drive failure to blow up the whole thing.

(Incidentally I was inspired to try this on Ubuntu because it was a fairly simple matter to set this up on Windows box, which also has six hard drives, so that I only have to mount a single samba share and can access all 6 drives from my Ubuntu boxes.)

David avatar
cn flag
The following options must be enabled in your Samba configuration file (smb. conf) to allow Samba clients to traverse symbolic links and wide links: follow symlinks=yes. wide links=yes.
Qwinn avatar
in flag
Yes. I mentioned that when I added wide-links = yes, it not only doesn't help, it disables all of the exisitng single-drive mounts.
Qwinn avatar
in flag
Doing further research, I'm wondering if it would work for me to do bind mounts of the various folders I want to share across the various hard drives into the shared folder?
Qwinn avatar
in flag
Actually, correction - having both "follow symlinks = yes" and "wide links = yes" does not disable all the single-drive shares. It seems to be "unix extensions = no" that does that. But neither do those two entries in smb.conf allow me to cd into the directories.
Score:0
in flag

After some further experimentation, it looks like I can achieve my objective just by doing a bind mount for each drive's folder that I want to share into my supershare folder, rather than symlinks pointing to them.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.