OPNsense Forum

English Forums => Zenarmor (Sensei) => Topic started by: Nikotine on November 03, 2021, 01:52:04 pm

Title: Remove Sensei swap
Post by: Nikotine on November 03, 2021, 01:52:04 pm
Does anyone know how to remove the swap that Sensei created?
I had a situation last week where it used up all my RAM.
Now that I've fixed that issue, how do I remove the swap?

(https://i.imgur.com/hlOyo3m.png)

Should I remove these files, or the whole folder?

(https://i.imgur.com/W8qh6XW.png?1)

Code: [Select]
root@opnsense:~ # df -h
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/gpt/rootfs     13G    6.9G    5.5G    56%    /
devfs              1.0K    1.0K      0B   100%    /dev
fdescfs            1.0K    1.0K      0B   100%    /dev/fd
procfs             4.0K    4.0K      0B   100%    /proc
devfs              1.0K    1.0K      0B   100%    /var/dhcpd/dev
devfs              1.0K    1.0K      0B   100%    /var/unbound/dev
/dev/md43           48M     56K     44M     0%    /usr/local/sensei/output/active/temp
Title: Re: Remove Sensei swap
Post by: athurdent on November 03, 2021, 03:54:23 pm
Looks like a memory device.
https://www.freebsd.org/cgi/man.cgi?query=mdconfig&apropos=0&sektion=8&manpath=FreeBSD+13.0-RELEASE+and+Ports&arch=default&format=html
Title: Re: Remove Sensei swap
Post by: sy on November 03, 2021, 07:19:33 pm
Hi @Nikotine,

It is a temporary Ramdisk that Zenarmor writes IPDR files and just 50 MB. It just uses max. 50 MB of Ram.
Title: Re: Remove Sensei swap
Post by: Nikotine on November 04, 2021, 01:24:51 pm
Hi @sy,
Temporary, but persistent after a reboot.
I know it doesn't harm that it's there, just... nice if it were gone  :)
Title: Re: Remove Sensei swap
Post by: dinguz on November 04, 2021, 06:34:13 pm
The Sensei swap area is created at install time, and so has always been there; you probably just didn't notice it before. As it is supposed to be there, I would suggest not trying to delete it ;-)
Title: Re: Remove Sensei swap
Post by: sy on November 04, 2021, 06:45:57 pm
Hi Nikotine,

I mean Zenarmor uses it for temporary purpose. IPDR files are created there then removes after streamed to the DB. It is creating during installation.
Title: Re: Remove Sensei swap
Post by: Nikotine on November 05, 2021, 03:21:30 pm
Oh ok, I really thought it wasn't there until I made that mistake.
Must not have noticed it then before.
Title: Re: Remove Sensei swap
Post by: benyamin on November 05, 2021, 05:18:11 pm
I'd say the memory disk is most likely a malloc backed device created every time Sensei starts.

If the files on the memory disk hold potentially sensitive information they will not survive system halt and cannot be recovered. Also, if data in files on the memory disk are corrupted or contain an exploit or malware, a process stop or panic will delete them when the device is recreated, and a system panic or restart will likely delete them upon halt.

Best to leave it be methinks.  ;)

@Nikotine, you might want to post a link to this topic in the other thread so people coming across it can benefit from the expertise on this board.
Title: Re: Remove Sensei swap
Post by: sy on November 05, 2021, 06:26:39 pm
Hi @benyamin,

There are just last seconds IPDR data in this memory disk. They are injected to the DB then the engine writes new ones. So if anything happens to be able to lose data, it will be just the last seconds' session info. The reason to use mem disk is to prevent intensive I/O operations on the disk.
Title: Re: Remove Sensei swap
Post by: benyamin on November 06, 2021, 12:30:56 am
Yep, faster than most disk too...  ;)
Title: Re: Remove Sensei swap
Post by: athurdent on November 06, 2021, 05:09:24 am
Hi @benyamin,

There are just last seconds IPDR data in this memory disk. They are injected to the DB then the engine writes new ones. So if anything happens to be able to lose data, it will be just the last seconds' session info. The reason to use mem disk is to prevent intensive I/O operations on the disk.

Nice, thank you for the insight! 👍