This article is for the WRN-2010S or WRN-2110S, if you need instructions for the W810S or WRN-1610 please see this article
When the OS drive on the WRN is almost full, WAVE displays the following error notification:
Reason: System disk */option/Hanwha/mediaserver/var/data is almost full
There are a number of reasons why this can occur and a number of fixes, listed below.
Configuring the drive configuration
Open the WAVE Client.
Right-click the location server and select Server Settings.
Confirm /opt/Hanwha/mediaserver/var/data is set to Reserved and is NOT set as the drive for 'Stores analytics and motion data'.
Open a web browser and navigate to:
https://ip_address_of_waveserver:7001/
Then log in using your credentials.
In the menu tree on the left, click Servers.
The URL will change to https://ip_address:7001/#/settings/servers/[server_ID]
Add ?advanced= to the end of the URL. Example:
https://ip_address:7001/#/settings/servers/bbcf2bd-af31-ccab-abcd-efg-1234?advanced=
In the Storage Locations section, change the Reserved space for /opt/Hanwha/mediaserver/var/data to 2GB.
Delete unnecessary programs
Both Thunderbird and LibreOffice can be removed:
sudo apt purge thunderbird sudo apt purge libreoffice
Modify Ownership of /etc and /system Folders
To ensure the system folders have the correct ownership:
Open Ubuntu Terminal and issue the following commands:
ls –l /etc ls –l /system
If the ownership is not set to root:root, enter the following commands:
sudo chown -R root:root /etc sudo chown -R root:root /system
Confirm the folder permissions have been set correctly and all the files are owned by root:root.
Confirm Largest Files on OS Drive
To confirm large files are filling up the OS drive, use the Disk Usage Utility on Ubuntu Desktop to check whether the /var/log/syslog file is one of the largest files on the OS drive and may grow to 5-7 GB.
If the log file is already 5-7GB in size, run the following command
sudo rm /var/log/syslog
This will remove the log
Modify the rsyslog File
To modify the rsyslog file:
Open Ubuntu Terminal and run the following command
sudo nano /etc/logrotate.d/rsyslog
Add the line su root syslog to the top of the file, above the /var/log/sys line
and make the changes shown in the following screenshot
Save the file and exit.
Modify the 50-default.conf File
To modify the 50-default.conf file:
Open Ubuntu Terminal and navigate to /etc/rsyslog.d/
Run the
sudo nano /etc/rsyslog.d/50-default.conf
command to modify the 50-default.conf file
Add a free line under the statement auth,authpriv.* and insert the following lines:
$outchannel mysyslog,/var/log/syslog,367001600 *.*;auth,authpriv.none :omfile:$mysyslog
Comment out *.*;auth,authpriv.none ~/var/log/syslog by placing a # in front of it.
Save the file and exit.
Restart rsyslog Service
To restart rsyslog service:
Open Ubuntu Terminal.
Run the following command
sudo systemctl restart rsyslog.service
Run the following command
sudo systemctl status rsyslog.service
to ensure it is running.
Run the following command
sudo logrotate –d /etc/logrotate.d/rsyslog
You should see the service enact the rotation.
Monitor the WAVE server over several days to ensure the syslog files are rotating correctly after reaching 350MB. If the system is working correctly, you should see the syslog, syslog.1 and syslog.2 files in the /var/log/ folder.
The amount of time will vary for each system based on the number of cameras connected.
Journals
Setup the journal to limit the number of journals and their sizes.
The following commands reduced the current disk usage to 100M and limits the number of journal files to 5
sudo journalctl --vacuum-size=100M sudo journalctl --vacuum-files=5
Open the /etc/systemd/journald.conf file:
sudo nano /etc/systemd/journald.conf
and make the following edits:
SystemMaxUse=100M
SystemKeepFree=50M
SystemMaxFileSize=50M
SystemMaxFiles=5
After saving the above changes, run the command:
sudo systemctl restart systemd-journald
to apply the changes to the systemd-journald service.
Snap Cache
Setup snaps to only retain the last two versions, clear the snapd cache, and remove unneeded snaps on the system.
sudo snap set system refresh.retain=2
sudo sh -c 'rm -rf /var/lib/snapd/cache/*'
LANG=C snap list --all | awk '/disabled/{print $1, $3}' | while read snapname revision; do sudo snap remove "$snapname" --revision="$revision"; done