Categories
Knowledge Support Support exacqVision Server Categories Products

Replacing a Drive in Ubuntu 20.04 or later, Using GParted (Legacy)

This procedure is applicable to replacing the primary hard drive of a Linux-based exacqVision system. It assumes that the operating device is installed to an on-board flash device. Do NOT use this procedure when simply adding a drive to a system.

  1. Run GParted from System, Administration, GParted. Select the empty hard drive from the drop-down list in the top-right corner. Note that the drive is unallocated, which indicates that you have selected the correct hard drive. Select Create Partition Table from the Device menu.


  2. Select gpt from the Select New Partition Table Type drop-down list. Click Apply.


  3. Right-click in the unallocated space and select New to open the Create New Partition window. Select 20000 (or more) in the New Size (MiB) box. Select linux-swap in the File System drop-down list. In the Label field, type swap. Click Add.


  4. Right-click the unallocated space and select New to open the Create New Partition window. Select 10000 (or more) in the New Size (MiB) box. Select ext4 in the File System drop-down list. In the Label field, type /mnt/export. Click Add.


  5. Right-click the unallocated space and select New to open the Create New Partition window. Select the highest available number in the Set New Size (MiB) box. Make sure Free Space Preceding and Free Space Following are both zero. Select ext4 in the File System drop-down list. In the Label field, type /mnt/edvr/1. Click Add.


  6. Click the green checkmark and then click Apply. Wait for the operations to complete.
  7. Open a Terminal window by selecting ApplicationsAccessories, and then Terminal. Enter the following command:

    sudo gedit /etc/fstab
  8. Add the following lines to the end of the fstab file:

    LABEL=swap none swap sw 0 0
    tmpfs /tmp tmpfs defaults,size=10g 0 0
    tmpfs /var/tmp tmpfs defaults
    LABEL=/mnt/export /mnt/export ext4 relatime,errors=remount-ro 0 0
    LABEL=/mnt/edvr/1 /mnt/edvr/1 ext4 relatime,errors=remount-ro 0 0


  9. In the terminal window, enter the following commands.

    sudo /etc/init.d/edvrserver stop
    sudo udevadm trigger

    sudo mount -a

    To create your export directories and change ownership:
    Note: in the following commands both “admin” and “user” should be changed to the relevant account names for the machine having issues.

    sudo mkdir /mnt/export/admin
    sudo mkdir /mnt/export/user
    sudo chown admin /mnt/export/admin
    sudo chown user /mnt/export/user
    sudo /etc/init.d/edvrserver start
  10. In a Terminal window, enter the following commands:
    Note: in the following commands both “admin” and “user” should be changed to the relevant account names for the machine having issues.

    sudo rm -r /home/admin/exacqVision\ Files
    sudo rm -r /home/user/exacqVision\ Files
    sudo ln -s /mnt/export/admin /home/admin/exacqVision\ Files
    sudo ln -s /mnt/export/user /home/user/exacqVision\ Files
  11. Run exacqVision Client and check the Storage configuration. You should see the new drive in the list of attached storage devices

Categories
Knowledge Support Support exacqVision Server Categories Products exacqVision Hardware

Manually Checking a Drive for Errors in Linux

Run fsck

On Linux systems, if a disk encounters a filesystem error, the physical drive may still be good but require a file system consistency check. Perform the following steps to attempt to correct this.

If the affected volume is a video storage volume:

  1. Stop the ExacqVision server service. Open a Terminal window and enter:
    sudo service edvrserver stop<br><br>
  2. Unmount the volume:
    sudo umount /mnt/edvr/X

    Replace the ‘X’ with your volume number.
    Example: If you have a write error on /mnt/edvr/2, you would enter:
    sudo umount /mnt/edvr/2

    NOTE: If this command fails, see Appendix below.<br><br>
  3. Run fsck on this volume, again replacing ‘X’ with the volume number:
    sudo fsck -yv /mnt/edvr/X

    This command will tell the system to automatically attempt to fix any issues it encounters. This may take minutes or several hours depending on the number of filesystem errors and the size of the volume. When completed, the Terminal will return to a prompt awaiting a new command. <br><br>
  4. When you have run fsck on all the affected storage volumes, reboot the system by entering:
    reboot

    OR

    Return to the Desktop and use the power icon to restart the machine. The drives will remount upon boot up.<br>br>

<br>


Appendix

If drive fails to unmount, you will need to open the fstab file and comment out the mount point of the drive in question.
sudo gedit /etc/fstab

  1. You will need to place a #‘ character to the left of ‘Label=/mnt/edvr/X’
  2. Save
  3. Reboot the machine.
  4. The drive that was commented out should not be mounted at this point.

Continue with step 3 above.
Reminder: Do not forget to re-edit the fstab after the fsck is finished and remove the # you added.

<br>

What does fsck do?

The fsck command performs a consistency check and attempts to repair the filesystem from errors.

What causes filesystem errors?

When system processes or user activity require saving data or making changes to the filesystem, that data is first written to a buffer in memory (RAM). The system periodically moves the data waiting in the buffer to the hard disk. Therefore, at any moment, there is a difference between file changes waiting to be written to disk and what exists on the disks.

Filesystem errors and inconsistencies can develop due to hardware degradation, system halts, or unclean shutdowns. Sudden power loss and forced shutdowns occurring before the changes in the buffer are moved to permanent disk storage.

Components checked by fsck

Inodes
Inodes contain metadata about a file, which includes information like: whether the file is read/write or read-only, the type of file, the user ID of the file owner, file creation and modification date and time, and the number of bytes in the file.

Data Blocks
These contain the data that actually makes up the file.

Superblocks
The superblock contains details about the filesystem, such as the state of the filesystem, the filesystem size, the filesystem name and volume name(s), path name of the mount point, and number of inodes. Every change to the inodes also requires changes to the superblock.

<br>