Configure mount points on every On-Demand Encoder processing server that uses remote storage.

## Before you start

- The remote storage and mount points must be available at boot.
- The encoder accesses the storage as `daemon:daemon`. It needs read access to input files and read, write, and execute access to output directories.
- Use a mount point under `/opt/mediakind/mount/your_directory` or `/mnt/your_directory`.
- For SMB/CIFS, obtain the remote storage username and password.
- For NFS, add the `daemon` user to the group that owns the share. For example, MediaKind CMS uses `nobody:nobody`. On each encoder that uses this share, run the following command.

```bash
sudo usermod -aG nobody daemon
```

## Mount remote storage

1. Open an SSH session as root.

2. Prepare the mount point and inspect the encoder account.

   ```bash
   mkdir -p /opt/mediakind/mount/Storage
   chown -R daemon:daemon /opt/mediakind/mount/Storage
   id daemon
   ```

3. Create the local directory if necessary.

   ```bash
   mkdir -p /opt/mediakind/mount/Storage
   ```

4. Set its ownership.

   ```bash
   chown -R daemon:daemon /opt/mediakind/mount/Storage
   ```

5. Retrieve the user and group identifiers.

   ```bash
   id daemon
   ```

6. Record the UID and GID from the output.

7. Open the mount configuration.

   ```bash
   vi /etc/fstab
   ```

8. Add the entry for your protocol. Replace `RemoteServer` with the remote server name or address. The example share is `Storage` and the local mount point is `/opt/mediakind/mount/Storage`. For SMB/CIFS, replace the UID, GID, username, and password with your storage settings.

   SMB/CIFS example:

   ```text
   //RemoteServer/Storage /opt/mediakind/mount/Storage cifs sec=ntlm,defaults,rw,uid=<UID>,gid=<GID>,user=<USERNAME>,password=<PASSWORD> 0 0
   ```

   NFS example:

   ```text
   RemoteServer:/Storage /opt/mediakind/mount/Storage nfs defaults,user,auto,intr 0 0
   ```

   <table>
     <thead>
       <tr>
         <th style="text-align: left">Option</th>
         <th style="text-align: left">Meaning</th>
       </tr>
     </thead>
     <tbody>
       <tr>
         <td style="text-align: left"><code>defaults</code></td>
         <td style="text-align: left">Includes automatic mounting at boot.</td>
       </tr>
       <tr>
         <td style="text-align: left"><code>rw</code>, <code>ro</code></td>
         <td style="text-align: left">Read-write or read-only access.</td>
       </tr>
       <tr>
         <td style="text-align: left"><code>uid</code>, <code>gid</code></td>
         <td style="text-align: left">User and group that own the mount point.</td>
       </tr>
       <tr>
         <td style="text-align: left"><code>user</code>, <code>password</code></td>
         <td style="text-align: left">Credentials for accessing the remote SMB/CIFS server.</td>
       </tr>
     </tbody>
   </table>

   For other protocols, refer to the Linux mount documentation for the corresponding `fstab` options.

9. Mount the storage.

   ```bash
   mount -a
   ```

10. Test write access as the encoder account. Check that `mount.test` appears in the directory.

    ```bash
    cd /opt/mediakind/mount/Storage
    su -c 'touch mount.test' daemon
    ls /opt/mediakind/mount/Storage
    ```

11. Run `mount` to check that the remote storage is mounted.

12. [Create a job](/traditional-products-and-appliances/components/on-demand-encoder/manage-jobs#create-a-job) using a remote location or the absolute path of the mounted directory.

    <table>
      <thead>
        <tr>
          <th style="text-align: left">Location</th>
          <th style="text-align: left">Input</th>
          <th style="text-align: left">Output</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td style="text-align: left">Remote</td>
          <td style="text-align: left"><code>file://RemoteServer/Storage/CustomInputFileName.ts</code></td>
          <td style="text-align: left"><code>file://RemoteServer/Storage</code></td>
        </tr>
        <tr>
          <td style="text-align: left">Mounted</td>
          <td style="text-align: left"><code>file:///opt/mediakind/mount/Storage/CustomInputFileName.ts</code></td>
          <td style="text-align: left"><code>file:///opt/mediakind/mount/Storage</code></td>
        </tr>
      </tbody>
    </table>
