OPNsense Forum

English Forums => Zenarmor (Sensei) => Topic started by: k0ns0l3 on April 05, 2022, 04:45:01 pm

Title: SWAP
Post by: k0ns0l3 on April 05, 2022, 04:45:01 pm
Does anyone know how to remove the SWAP created by Sensei?
Thank you and best regards 8)



k0ns0l3
Title: Re: SWAP
Post by: mb on April 05, 2022, 05:38:50 pm
Hi @k0ns0l3,

This tmpfs is meant to speed up processing writing/ingesting reporting logs; and saves a considerable amount of disk I/O in large networks.

In small networks, it might not be too important. We can make this a configurable setting.

Quick question: what is the reason you want to remove it?
Title: Re: SWAP
Post by: k0ns0l3 on April 05, 2022, 05:55:39 pm
Hi mb  8)

I tried Sensei and uninstalled again so do not need anymore swap (Two are unnecessary)  ;)

Thank you and best regards 8)

k0ns0l3
Title: Re: SWAP
Post by: lrosenman on April 05, 2022, 11:06:44 pm
how did you remove Sensei/ZenArmor?  IIRC the pkg remove *SHOULD* delete the tmpfs.
Title: Re: SWAP
Post by: k0ns0l3 on April 06, 2022, 01:08:30 am
how did you remove Sensei/ZenArmor?  IIRC the pkg remove *SHOULD* delete the tmpfs.

Zenarmor-Sensei→Configuration→Uninstall on your OPNsense GUI —> Uninstall Zenarmor Packet Engine

I hope it's the right way  :)
Title: Re: SWAP
Post by: lrosenman on April 06, 2022, 01:27:03 am
check and see if the plugin is still installed.
Title: Re: SWAP
Post by: k0ns0l3 on April 06, 2022, 10:03:06 pm
everything is uninstalled checked  8)
Title: Re: SWAP
Post by: lrosenman on April 06, 2022, 10:42:40 pm
I'm out of ideas.

@franco, @mb, @sy?
Title: Re: SWAP
Post by: mb on April 06, 2022, 10:53:52 pm
@lrosenman thanks.

@k0ns0l3 run below command on the console, that should unmount the file system.

Code: [Select]
/sbin/umount /dev/md43
Title: Re: SWAP
Post by: Patrick M. Hausen on April 06, 2022, 11:02:50 pm
Followed by
Code: [Select]
mdconfig -d -u 43
What I simply don't know is, whether the RAM disk will be recreated at reboot.
Title: Re: SWAP
Post by: k0ns0l3 on April 07, 2022, 05:54:25 am
Code: [Select]
swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/gpt/swapfs   8388608        0  8388608     0%
/dev/md98         2097152        0  2097152     0%
Total            10485760        0 10485760     0%
@mb
Code: [Select]
/sbin/umount /dev/md98
umount: /dev/md98: unknown file system

@pmhausen
Code: [Select]
mdconfig -d -u 98
mdconfig: ioctl(/dev/mdctl): Device busy

funny  :(
Title: Re: SWAP
Post by: franco on April 07, 2022, 10:37:37 am
Well, nothing in core/plugins creates memory disks so this must be an extra script left behind somewhere in /usr/local/etc/rc.syshook.d ...


# grep -nr mdconfig /usr/local/etc/rc.syshook.d


Cheers,
Franco
Title: Re: SWAP
Post by: k0ns0l3 on April 07, 2022, 01:01:35 pm
@Franco

Code: [Select]
grep -nr mdconfig /usr/local/etc/rc.syshook.d
root@OPNsense:~ #

Code: [Select]
/usr/local/etc/rc.syshook.d # ls
backup carp early monitor start stop update

I didn't notice anything unusual  :-\

in my eyes this is a bug at installation and uninstall from    
Zenarmor (Sensei)
Title: Re: SWAP
Post by: franco on April 07, 2022, 01:34:19 pm
I must admit I haven't read all of the thread but the question is: if it sticks after reboot it's a leftover script somewhere, isn't it?


Cheers,
Franco
Title: Re: SWAP
Post by: k0ns0l3 on April 07, 2022, 02:28:22 pm
at the moment I am overwhelmed myself and find no solution,in any case, this is not a clean uninstall of Zenarmor  ;)

now I have two swap  8)

Greetings
Title: Re: SWAP
Post by: mb on April 07, 2022, 04:21:39 pm
Hi @k0ns0l3

/dev/md98 did not seem familiar to me. Zenarmor's memdisk device is  /dev/md43.

Let me check with the team again.

Other than that, zenarmor's memdisk should not survive reboots unless you have the Zenarmor Packet Engine is set to be enabled at boot time. Memdisk is created by the rc service script.

Title: Re: SWAP
Post by: mb on April 07, 2022, 04:29:07 pm
Hi @k0ns0l3

Checked this with the team. /dev/md98 is not related to Zenarmor.

Maybe some other plugin is creating that?

Anyhow feel free to reach out to the support. Team will be happy to have a look.
Title: Re: SWAP
Post by: k0ns0l3 on April 07, 2022, 05:12:55 pm
@mb

Hi @k0ns0l3

/dev/md98 did not seem familiar to me. Zenarmor's memdisk device is  /dev/md43.

Let me check with the team again.

Other than that, zenarmor's memdisk should not survive reboots unless you have the Zenarmor Packet Engine is set to be enabled at boot time. Memdisk is created by the rc service script.

Code: [Select]
mdconfig -d -u md43
mdconfig: ioctl(/dev/mdctl): No such file or directory

Code: [Select]
/sbin/umount /dev/43
umount: /dev/43: statfs: No such file or directory
umount: /dev/43: unknown file system

used this tutorial : https://www.sunnyvalley.io/docs/installing/installation#installing-on-opnsense ,nothing out of the ordinary


Greetings  8)