Score:2

How to nest & share multiple ZFS pools over Samba to multiple users

na flag

I have the following ZFS structure:

% sudo zfs list                                                            16:03:46
NAME                          USED  AVAIL     REFER  MOUNTPOINT
zpool1                       1.18T  5.86T      544K  legacy
zpool1/home                  1.18T  5.86T       96K  legacy
zpool1/home/alice            12.6G  5.86T     12.6G  /zshare/zpool1/home/alice
zpool1/home/bob              1.17T  5.86T     1.02T  /zshare/zpool1/home/bob
zpool2                       2.22T  4.82T      188K  legacy
zpool2/media                 1.13T  4.82T     1.13T  /zshare/zpool1/home/media_root

For performance & storage reasons, zpool1 & zpool2 do not share any disks. I want both bob & alice to access media_root. Bob & Alice are not allowed to access each other's files though.

  1. I cannot share /zshare/zpool1/home as a folder because it belongs to the root partition, which is small and if alice or bob wanted to copy anything larger than 60Gb to their folder it would fail with "not enough space" even though their home folder has it (Windows calculates the space from the drive hosting the SMB shared folder).
  2. I cannot share two folders to both user's workstations, because Windows doesn't allow you to mount multiple network drives from the same IP address...
  3. I cannot symlink media_root into /alice and /bob because on Windows it will not follow the symlink, and I can't seem to get hardlinks to work across Z filesystems.

I really REALLY don't want to duplicate all the files in media_root to a subfolder for both alice & bob, and use a crontab-style rsync to keep them both updated with each other and on zpool2, but what other options are there?

I am sure there is some way to make this happen with ZFS on Ubuntu 20.04, but HOW?

EDIT: The network in question does NOT have DNS.

Nikita Kipriyanov avatar
za flag
Notice there is absolutely nothing ZFS-specific in the problem. Samba doesn't care exactly how the storage is organized and will work exactly the same when you give it the same mounted folder structure.
Score:0
cn flag

I cannot share two folders to both user's workstations, because Windows doesn't allow you to mount multiple network drives from the same IP address...

This is not true. You can mount as many network drives (from and to the same machine) as you have free letters. You could even use plain UNC paths oder mount even deep pathnames (like net use t: \\server\share\bobs\eyes\only) Just create the shares you need and use them accordingly.

Bob & Alice are not allowed to access each other's files though.

This is a matter of file/folder permissions.

ifiht avatar
na flag
I'm sorry to disagree but here's the official Microsoft documentation (they recommend using DNS aliasing to work around it): https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/cannot-connect-to-network-share#workaround-1
bjoster avatar
cn flag
No, the linked article is about connections for *different usernames* from the same *client session* and has nothing to do with mounting multiple drives and/or access rights for *one* user object. The question explicitly asks for *multiple* user objects. DNS and Share aliasing is needed for different user from the same session, which will not securely fix the access problem, as access rights are additional (per session), too.
Score:0
ru flag

I think... one way to do this would be to set up a group for the users who should have access to the shared folder, and then set the permissions on the shared folder so that only members of that group can access it.

For example, you could create a group called "media_access" and add both Alice and Bob to it. Then, you could set the permissions on the media_root folder so that only members of the media_access group can access it. To do this, you would run the following command:

chgrp media_access /zshare/zpool1/home/media_root
chmod g+rwx /zshare/zpool1/home/media_root

This will change the group ownership of the media_root folder to the media_access group, and give members of that group read, write, and execute permissions on the folder.

After setting the permissions, you should be able to access the shared folder from both Alice and Bob's workstations. However, they will only be able to access files that are in the shared folder, and will not be able to access each other's files in their own home directories.

Score:-1
na flag

In the end I had to enable & host DNS for the network to make it work.

Example:
mapping two network drives on Windows as below

\\192.168.11.1\share001
\\192.168.11.1\share002

fails, however when using DNS

\\alice\share001
\\bob\share002

^ that above works, even if both alice & bob resolve to 192.168.11.1.

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.