Overview
This document explains how to create a workspace that allows to create a share that can be mounted to other workspaces (windows/linux).
The overall setup is illustrated in the diagram below.
Prerequisites
- External storage like External storage volumes.
- Reserved IP or Private Network
No symbolic links
Symbolic links on shared storage will not work. This is why, by default, symbolic links are disabled on shared storages like Samba.
A symbolic link could only be resolved by the instance that created it, which defeats the purpose of shared storage.
Creating a workspace with Samba share
- Create and start a workspace with the application Application with SAMBA port with an external storage attached.
Make sure the the folder has the correct permissions. You can change the folder permissions by:
sudo chmod -R 777 <path of the mounted external storage eg. "/data/volume_2">
Install samba server
$ sudo apt update && sudo apt install -y samba
Append the following lines to the file /etc/samba/smb.conf (e.g. with vim):
[volume-ceph] comment = Samba on Ubuntu path = <path of the mounted external storage eg. "/data/volume_2"> read only = no browsable = yes
Restart the Samba service to apply the config
sudo service smbd restart
Enable the UFW firewall and add the external ip addresses that need to have access. Replace the "[IP of IP object in workspace X/Y]" with the IP address of the workspace(s) that you wish to mount the storage on.
sudo ufw allow ssh sudo ufw allow from [IP of IP object in workspace X] to any port 445 sudo ufw allow from [IP of IP object in workspace Y] to any port 445 sudo ufw enable
You can add more of these firewall rules if you want to mount the storage on more workspaces.
If your workspaces are connected to the same private network, you can even skip this step. Use the samba-server's private ip-address when configuring the clients.Create an useraccount that can access the share.
sudo useradd -s /bin/bash -d /home/smbuser/ -m -G sudo smbuser sudo passwd smbuser sudo smbpasswd -a smbuser sudo chown smbuser:smbuser <path of the mounted external storage eg. "/data/volume_2">
The storage can now be mounted on any Linux and/or Windows machine.
Mounting storage on Linux
Install the cifs-utils service
sudo apt-get install cifs-utils
Create a folder that the external storage can be mounted on
sudo mkdir /volume-ceph
Append the following lines to the file /etc/fstab to mount the folder on boot
//<IP of samba machine>/volume-ceph /volume-ceph cifs username=smbuser,password=<PASSWORD>,file_mode=0777,dir_mode=0777
Mount the folder
sudo mount -a
You should be able to see the shared files in the created folder.
Mounting storage on Windows
Run the following command in an elevated command prompt
net use V: \\<IP of samba machine>/volume-ceph /user:smbuser <PASSWORD> /PERSISTENT:YES
The drive letter V: should be mounted to the external storage