OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • Disk Usage and Management
« previous next »
  • Print
Pages: [1]

Author Topic: Disk Usage and Management  (Read 13650 times)

CLI_Novice

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Disk Usage and Management
« on: February 25, 2023, 03:34:31 am »
My Hard Drive ran out of space, so I think everything stopped logging. Here is DF-m output:

Filesystem               1M-blocks   Used Avail Capacity  Mounted on
/dev/gpt/rootfs             110079 100558   715    99%    /
devfs                            0      0     0   100%    /dev
/dev/gpt/efifs                 255      1   254     1%    /boot/efi
tmpfs                         3995   3995     0   100%    /var/log
tmpfs                         3995      2  3993     0%    /tmp
devfs                            0      0     0   100%    /var/dhcpd/dev
devfs                            0      0     0   100%    /var/unbound/dev
/usr/local/lib/python3.9    110079 100558   715    99%    /var/unbound/usr/local/lib/python3.9

Is there any way to tell everything to log for one or two months and delte everything older?

Thanks
Logged

cookiemonster

  • Hero Member
  • *****
  • Posts: 1830
  • Karma: 95
    • View Profile
Re: Disk Usage and Management
« Reply #1 on: February 26, 2023, 10:08:41 pm »
In my opinion it would be better to reduce the logging that is happening. Unless of course you need to have that much logging. If so and then the answer to your question would require you to script it and add your script(s) to cron manually.
Logged

CLI_Novice

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Disk Usage and Management
« Reply #2 on: March 09, 2023, 02:40:51 pm »
Thanks for your response.

I guess I have to rebuild yet another router with a humungous Hard drive. I dont have skills required to implement your suggestion.

It would be nice if there was a "Disk Management" Plugin for us "GUI" folks so I could just add a USB thumb drive and designate it for logging
Logged

meschmesch

  • Full Member
  • ***
  • Posts: 184
  • Karma: 5
    • View Profile
Re: Disk Usage and Management
« Reply #3 on: April 12, 2023, 10:06:47 am »
Hello,
I have the same problem, that opnsense occupies almost 60G of the disk. I emptied the log, but still:
Quote
root@OPNsense-Main:~ # df -h
Filesystem                  Size    Used   Avail Capacity  Mounted on
/dev/gpt/rootfs             108G     56G     43G    57%    /
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
devfs                       1.0K    1.0K      0B   100%    /var/unbound/dev
/usr/local/lib/python3.9    108G     56G     43G    57%    /var/unbound/usr/local/lib/python3.9

What is this python3.9 thing about? When I go to the folder /var/unbound/usr/local/lib/python3.9 and do a du -hs, it only reports a size of 375M??

Quote
root@OPNsense-Main:/usr/local/lib/python3.9 # du -hs
375M    .

Any idea? Reboot didn't do anything.
Logged

Patrick M. Hausen

  • Hero Member
  • *****
  • Posts: 6935
  • Karma: 584
    • View Profile
Re: Disk Usage and Management
« Reply #4 on: April 12, 2023, 12:48:14 pm »
@meschmesch: that's just an additional mountpoint within the root filesystem. The `df` output is irrelevant.
Note that the numbers are identical to /.

Try for example

Code: [Select]
cd /
du -skx * | sort -rn

Then cd into the largest directory and work downwards repeating the commands above.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

meschmesch

  • Full Member
  • ***
  • Posts: 184
  • Karma: 5
    • View Profile
Re: Disk Usage and Management
« Reply #5 on: April 12, 2023, 02:02:54 pm »
@pmhausen, you are a genious  :) It was elasticsearch (zenarmor). Erase Reporting Data did the job. Thank you!
Logged

CLI_Novice

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Disk Usage and Management
« Reply #6 on: June 03, 2023, 09:48:52 pm »
Just Installed a new 1tb SSD, only 2 days in and:

SYSTEM: LOG FILES: GENERAL>

2023-06-03T18:19:19   Notice   syslog-ng   Suspending write operation because of an I/O error; fd='31', time_reopen='60'   
2023-06-03T18:19:19   Error   syslog-ng   I/O error occurred while writing; fd='31', error='No space left on device (28)'   
2023-06-03T18:19:19   Notice   syslog-ng   Error suspend timeout has elapsed, attempting to write again; fd='31'   
2023-06-03T18:19:14   Notice   syslog-ng   Suspending write operation because of an I/O error; fd='24', time_reopen='60'   
2023-06-03T18:19:14   Error   syslog-ng   I/O error occurred while writing; fd='24', error='No space left on device (28)'

Is this writing to RAM only. I wish there was a plugin or better menu options as per where on the drive to store log files.
Logged

cookiemonster

  • Hero Member
  • *****
  • Posts: 1830
  • Karma: 95
    • View Profile
Re: Disk Usage and Management
« Reply #7 on: June 03, 2023, 10:47:46 pm »
In system > Logging - see that you have all tickboxes unticked and the "preserve log (days)" empty. That will leave you with deafult logging which should be manageable even on small disks.
Then on system > settings > Miscellaneous , there is a section "Disk / Memory Settings (reboot to apply changes)"
You seem to have enabled the use of ram for /tmp and /var/log.
Disable those and your logs will go the filesystem where the first settings will rotate them.
Logged

CLI_Novice

  • Newbie
  • *
  • Posts: 6
  • Karma: 0
    • View Profile
Re: Disk Usage and Management
« Reply #8 on: June 04, 2023, 02:29:31 pm »
Thank You So Much cookiemonster!
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • Tutorials and FAQs »
  • Disk Usage and Management
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2