Mounting Shared Folder in Linux

Prerequisite

Common Internet File System (CIFS) protocol package needs to be installed for enabling file share between Windows and Linux filesystems. Execute the following command to install cifs-utils package in the Linux system:

# yum install cifs-utils

 

Manual Mounting Shared Drive/Folder

To manually mount a file share, use the mount utility with the -t cifs parameter as described below:

# mount -t cifs -o username=user_name //server_name/share_name /mnt/

Password for user_name@//server_name/share_name:  password


Automatic Mounting Shared Drive/Folder

To mount a file share automatically when the system boots, add an entry for the share to the /etc/fstab file. 

For example:
//server_name/share_name  /mnt  cifs  credentials=/home/<username>/fileshare.cred  0 0

 

To create fileshare.cred file:

  1. Create a file such as /home/<username>/fileshare.cred, and specify the user name, password, and domain name within the file:
    username=user_name
    password=password
    domain=domain_name
  2. Set the permissions to only allow the owner to access the file:
    # chown <username> /home/<username>/fileshare.cred
    # chmod 600 /home/<username>/fileshare.cred

 

For more details on how to mount file share refer:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/managing_file_systems/assembly_mounting-an-smb-share-on-red-hat-enterprise-linux_managing-file-systems
 
Once the mounting is done, you must add the Window’s folder path and its respective mount path in the config.yml present in the AssistEdgeAutomation > app > Admin > config folder. Below is the sample format of the Linus mapping path:

 

  - BasePath: "\\\\<hostname>\\<windows_sharedFolder>\\<subfolder>"
    MountPath: "/<linux_mount_directory>/<sub_folder>"
  - BasePath: ""\\\\<hostname2>\\<windows_sharedFolder2>\\<subfolder2>"
    MountPath: "/<linux_mount_directory>/<sub_folder2>"


Restart the ControlTower service after the above changes are done.

 

NOTE: 

Escape sequence is required to insert backslash in the above paths. Hence double backslash is used in base Path.