Skip to main content
All CollectionsTroubleshooting and How-ToHow-To Articles
How to attach, mount and expand recording volumes / NAS
How to attach, mount and expand recording volumes / NAS
A
Written by Arick Disilva
Updated over a month ago

Before making any changes to your recording volume, it's a good idea to backup your volume.

If you need any help with these instructions, please contact Teramind Support at [email protected].

Attaching a Recording Volume

To attach a recording volume to your Teramind appliance, follow the steps below:

1. Create and attach a disk with your Hypervisor tools. Please refer to the On-Premise Deployment Guide for steps to attach a second virtual disk to the Teramind VM.

The following commands are assuming you're logged into the Teramind appliance console or via an SSH session as the prod user and then switched to the root account using the command "sudo -i"

If you're not running the commands as the root user, you can run still them as a prod user by adding sudo before each command requiring elevated access.

An SSH session is usually preferable as it will allow you to copy and paste disk IDs in the remaining steps. If you do not yet have these credentials, please reach out to Teramind support at [email protected].

2. Stop the Teramind service, execute:

systemctl stop teramind

3. Run the ‘lsblk’ command to check if the OS is able to recognize the new disk:

lsblk
mceclip0.png

4. Create a new partition with the following command:

fdisk /dev/sdb
mceclip1.png

Press n to create a new partition, then p to specify it’s a primary one. Leave the rest of the options (First and Last sector) as is:

mceclip2.png

Press p again to print/view the new partition table:

mceclip3.png

Press w to write changes to the disk

mceclip4.png

5. Create a file system on the new partition using the following command:

mkfs.ext4 /dev/sdb1
mceclip5.png

6. Verify the new partition is visible by executing the following command:

lsblk
mceclip6.png

7. Find the new partition’s ID by executing the 'blkid' command:

blkid /dev/sdb1

Copy the UUID:

uuid.png

8. Edit /etc/fstab, put the UUID from Step 7 above to a mounted record:

mceclip8.png

9. This step is optional. If you don't have any existing recordings in your rec directory, please go to Step 10. Otherwise, do the following to keep the recordings intact (so that you can later resync them in Step 13).
Rename your current recordings directory to something else (e.g., rec_old):

cd /usr/local/teramind
mv rec rec_old

Create a new directory where future screen recordings will be stored (you can use your old directory name 'rec' since you renamed it already):

mkdir rec

10. Execute the following command to mount the disk:

mount -o remount -a

Ensure the disk is mounted with lsblk and df:

mceclip9.png

11. Fix the recording volume permissions to allow the Teramind service to record files with the following commands:

chown -R prod. /usr/local/teramind/rec
chmod -R 775 /usr/local/teramind/rec

12. Start the Teramind service and start recording the screen data to the new disk with the following command:

systemctl start teramind 

13. If you created a backup of your previously captured screen recordings (in Step 9), you can now transfer the backup data to the newly mounted disk with the following command:

rsync -a /usr/local/teramind/rec_old/ /usr/local/teramind/rec

This might take some significant amount of time depending on how many records currently exist in your rec_old directory. Once rsync is finished, you can safely delete your rec_old directory with the following command:

rm -rf /usr/local/teramind/rec_old

14. Open your admin dashboard and verify if the disk is being displayed properly.

Mounting a Recording Volume to a NAS

To mount a recording volume to a NAS (Network Attached Storage), follow the steps below:

1. Add access to files on the NAS within the local network (NFS). Here's an example of how to do that on a Synology NAS:

*The information provided on the link above is from a third party. The link is provided for your convenience. Teramind cannot verify the accuracy of the information nor is responsible for any damage that may occur from using the instructions.

You can find similar instructions for other NAS disks online. If not, please contact your NAS provider's technical support.

The following commands are assuming you're logged into the Teramind appliance console or via an SSH session as the prod user.

If you do not yet have these credentials and the credentials to the tm_onsite database, please reach out to Teramind support at [email protected].

2. Stop the Teramind service using the following command:

sudo systemctl stop teramind

3. Transfer your existing recording to NAS with rsync. For example:

rsync -av /usr/local/teramind/rec/ 192.168.1.88:mnt/Teramind/

4. Connect to the tm_onsite database. For a typical on-premise deployment, the command will be:

psql -h 127.0.0.1 -U tm_onsite

5. Insert the values into the kv_store row, adjusted for the actual NFS share IP and path. For example:

insert into kv_store(key,value) values ('nfs.rec_dir','ipaddress:/volumes2/Teramind');

To verify the value was added, you can use this query:

select * from kv_store where key='nfs.rec_dir';

Or to delete the entry if needed:

delete from kv_store where key = 'nfs.rec_dir';

6. Restart the service using the following command:

sudo systemctl restart teramind

7. Verify the NFS share is mapped with either of these two commands:

df -h
df -HP -t nfs

Expanding a Recording Volume

To expand a recording volume, follow the steps below:

These steps below are applicable to the primary disk as well but the primary disk is usually mapped as disk dev/sda1 so you can replace sdX or sdb1 in the example commands below with sda1 for the primary disk.

The following commands are assuming you're logged into the Teramind appliance console or via an SSH session as the prod user and then switched to the root account using the command "sudo -i"

If you're not running the commands as the root user, you can still run them as a prod user by adding sudo before each command requiring elevated access.

An SSH session is usually preferable as it will allow you to copy and paste disk IDs in the remaining steps. If you do not yet have these credentials, please reach out to Teramind support at [email protected].

1. First, expand the disk from your hypervisor management console. You may need to first shut down the Teramind appliance before access to edit the disk is permitted. If you have snapshots/checkpoints for the Teramind VM, you may also have to merge them first.

2. Ensure the OS is able to recognize a resized disk. You might need to reboot it. Use the lsblk command to check:

expand-1.png


If it isn’t recognized, force a rescan of the disk devices using one of the following commands:

echo 1>/sys/class/block/sdX/device/rescan

Where the X in the above example refers to the volume letter such as sda or sdb.

OR,

echo 1>/sys/class/scsi_device/X:X:X:X/device/block/device/rescan
mceclip14.png

3. Execute the fdisk command below to see a partition table:

fdisk -l /dev/sdX

Here, sdX stands for your volume. For example:

mceclip15.png

4. Execute the fdisk command below to edit the partition:

fdisk /dev/sdX

Here, sdX stands for your volume. For example:

mceclip16.png

5. Type d at the Command prompt to delete the primary partition:

expand-2.png

6. Type n at the Command prompt to create a new partition:

mceclip18.png

7. Type p for a primary partition and just press Enter at the partition number, first sector and last sector prompts to keep the default values. IMPORTANT: answer No to the "Do you want to remove the signature?" prompt:

sig.png

8. Type p to print/view the partition table and ensure everything looks good:

9. Type w to write a modified table:

expand-3.png

10. Update the OS kernel’s table to recognize new disk size by executing the following commands:

partx --update /dev/sdX
partx --update /dev/sdX1

Here, sdX stands for your volume. For example:

mceclip23.png

11. Execute the lsblk command to ensure the OS can recognize the new partition size. If it hasn’t, reboot the OS:

expand-4.png

12. If everything looks good, execute the resize2fs command to expand the file system. For example:

resize2fs /dev/sdX1

Here, sdX stands for your volume. For example:

mceclip25.png

13. Execute the following command to see if the changes have been applied successfully:

df -h

Expanding a Recording Volume Greater Than 2TB (Secondary Volumes Only)

This method will work on secondary volumes only. Please do not attempt this on a primary volume or a root partition, otherwise your server will no longer boot properly.

The following steps are similar to the steps in the above section but involve creating a GPT partition table to support a volume size larger than 2TB.

assuming you're logged into the Teramind appliance console or via an SSH session as the prod user.

If you do not yet have these credentials, please reach out to Teramind support at [email protected].

1. First, you need to access your instance via SSH or directly from your VM's management console.

mceclip0.png

2. Use the sudo and fdisk commands on the volume you have to increase to more than 2 terabytes.

sudo fdisk /dev/sdX

Here, sdX stands for your volume. For example:

2T-1.png

You might see a warning message about DOS partition size limit. You can ignore it:

mceclip3.png

3. Type p to show the partition table:

mceclip0.png

4. Type g to create a new empty GPT partition table:

mceclip1.png

5. Type n to add that partition (leave all entries to their default values):

mceclip2.png

6. Type p to check that the partition table had been modified:

mceclip4.png

7. Type w to save changes to the table:

mceclip5.png

8. Run the following command:

sudo partprobe

9. Run the following command to resize the volume:

sudo resize2fs /dev/sdX1

Here, sdB stands for your volume. For example:

sudo resize2fs /dev/sdb1

10. In some cases, you may need to reboot for the changes to take effect.

Did this answer your question?