• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Using RAMdisks for /tmp and /var - Traffic Totals gone after power loss - Which setting to choose to write to disk?

Scheduled Pinned Locked Moved General pfSense Questions
14 Posts 5 Posters 1.5k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    stephenw10 Netgate Administrator
    last edited by stephenw10 Apr 15, 2023, 2:31 PM Apr 15, 2023, 2:29 PM

    A feature request to add backing that up might be best: https://redmine.pfsense.org/
    If there isn't one already.

    Otherwise that data will be lost if you have /var as a ramdisk.

    Steve

    Edit: There is: https://redmine.pfsense.org/issues/11797
    Add comments there

    1 Reply Last reply Reply Quote 1
    • F
      Finger79
      last edited by Dec 6, 2023, 3:41 PM

      I can't be the only one using both Traffic Totals and a RAMdisk. Is there a way to get some love on this bug?

      1 Reply Last reply Reply Quote 0
      • S
        stephenw10 Netgate Administrator
        last edited by Dec 6, 2023, 5:26 PM

        Add comments to the bug there.

        I use that combo here but I guess I just don't hit it often enough for it to be an issue.

        F 1 Reply Last reply Dec 6, 2023, 5:36 PM Reply Quote 0
        • F
          Finger79 @stephenw10
          last edited by Dec 6, 2023, 5:36 PM

          @stephenw10 I already did back in April. I don't have anything else to add. It's assigned to "John Cornwell" as of 2 years ago, but I have no idea who that is on the Netgate team.

          1 Reply Last reply Reply Quote 0
          • S
            stephenw10 Netgate Administrator
            last edited by Dec 6, 2023, 5:45 PM

            That was just the reporter. Not sure why it was set to that. Added a target version.

            M 1 Reply Last reply Mar 27, 2025, 11:55 PM Reply Quote 1
            • M
              Mission-Ghost @stephenw10
              last edited by Mar 27, 2025, 11:55 PM

              @stephenw10 this is inauspicious--aka--kicking the can down the road...again and again...from the redmine bug:

               Updated by Jim Pingle about 1 year ago
              
                  Plus Target Version changed from 24.03 to 24.07
              
              #5
              Updated by Jim Pingle 10 months ago
              
                  Plus Target Version changed from 24.07 to 24.08
              
              #6
              Updated by Jim Pingle 6 months ago
              
                  Plus Target Version changed from 24.08 to 24.11
              
              #7
              Updated by Jim Pingle 6 months ago
              
                  Plus Target Version changed from 24.11 to 25.01
              
              #8
              Updated by Jim Pingle 4 months ago
              
                  Plus Target Version changed from 25.01 to 25.03
              
              #9
              Updated by Jim Pingle about 2 months ago
              
                  Plus Target Version changed from 25.03 to 25.07
              
              

              I found no caveats in the manual about traffic totals being incompatible with ram disk, so I tried ram disk in attempt to further mitigate SSD wear in my 4200...only to have it fill up, blow up, and lock up the router requiring a hard reboot. Niiice.

              So I turned it off, but this would be a nice fix. But the history isn't supporting it even showing up in 25.07...

              F 1 Reply Last reply Mar 31, 2025, 2:04 AM Reply Quote 1
              • S
                stephenw10 Netgate Administrator
                last edited by Mar 28, 2025, 12:49 AM

                Hmm, doesn't seem like it would be that tricky. Looks like 3 files required to replicate what rrd does for example... 🤔

                1 Reply Last reply Reply Quote 1
                • F
                  Finger79
                  last edited by Finger79 Mar 28, 2025, 6:48 AM Mar 28, 2025, 6:16 AM

                  I haven't dabbled in the pfSense codebase, but I did see a Netgate developer solve a related issue by re-locating where another file/db is saved. So applying that here, perhaps move /var/db/vnstat/vnstat.db to /usr/local/pkg/vnstat/vnstat.db so this way we can have our cake and eat it too (still have a RAMdisk for /var but have the Traffic Totals database stored to non-volatile disk)...

                  I don't know if that's a possible solution or not.

                  Edit: It looks like /var/db/pkg saves to "zfs" instead of "tempfs," so perhaps the solution is as simple as moving the Traffic Totals database from /var/db/vnstat/vnstat.db to /var/db/pkg/vnstat/vnstat.db ?

                  1 Reply Last reply Reply Quote 0
                  • S
                    stephenw10 Netgate Administrator
                    last edited by Mar 28, 2025, 2:25 PM

                    Mmm, I'm not sure how much data is written by traffic totals but it would be better to have that data included in the RAM disk backup IMO. Most users enable RAM disks to minimise drive writes.

                    pfBlocker does that for example but uses quite a complex solution.

                    W 1 Reply Last reply Mar 29, 2025, 9:05 AM Reply Quote 0
                    • W
                      Waqar.UK @stephenw10
                      last edited by Waqar.UK Mar 29, 2025, 9:06 AM Mar 29, 2025, 9:05 AM

                      @stephenw10

                      True, I enable a RAM disk, my system has 8GB RAM and I run pfgblocker. my SSD which I have been using for almost 10 years, thankfully on 96% health. It is a TLC kingston SATA drive.

                      1 Reply Last reply Reply Quote 1
                      • J
                        JonathanLee @Finger79
                        last edited by Mar 30, 2025, 6:04 AM

                        @Finger79 some veritas and Symantec systems I use to work on years ago used a capacitor to write the data when power was lost. It was fat like 3 c batteries in a row. But it was for this very issue what ever was in ram needed to go directly to disk as fast as possible.

                        Make sure to upvote

                        1 Reply Last reply Reply Quote 0
                        • F
                          Finger79 @Mission-Ghost
                          last edited by Mar 31, 2025, 2:04 AM

                          @Mission-Ghost said in Using RAMdisks for /tmp and /var - Traffic Totals gone after power loss - Which setting to choose to write to disk?:

                          @stephenw10 this is inauspicious--aka--kicking the can down the road...again and again...from the redmine bug:

                           Updated by Jim Pingle about 1 year ago
                          
                              Plus Target Version changed from 24.03 to 24.07
                          
                          #5
                          Updated by Jim Pingle 10 months ago
                          
                              Plus Target Version changed from 24.07 to 24.08
                          
                          #6
                          Updated by Jim Pingle 6 months ago
                          
                              Plus Target Version changed from 24.08 to 24.11
                          
                          #7
                          Updated by Jim Pingle 6 months ago
                          
                              Plus Target Version changed from 24.11 to 25.01
                          
                          #8
                          Updated by Jim Pingle 4 months ago
                          
                              Plus Target Version changed from 25.01 to 25.03
                          
                          #9
                          Updated by Jim Pingle about 2 months ago
                          
                              Plus Target Version changed from 25.03 to 25.07
                          
                          

                          I found no caveats in the manual about traffic totals being incompatible with ram disk, so I tried ram disk in attempt to further mitigate SSD wear in my 4200...only to have it fill up, blow up, and lock up the router requiring a hard reboot. Niiice.

                          So I turned it off, but this would be a nice fix. But the history isn't supporting it even showing up in 25.07...

                          Thanks for the thread bump. I'm relieved I'm not the only person who's noticed this. I wonder if there is just a development staffing shortage, because even in the forums there's silence.

                          Are there any how-to guides on getting started with pfSense development? I have the GitHub repo starred. I just don't have a clue how to set up a development environment to be able to tackle some bugs myself.

                          1 Reply Last reply Reply Quote 0
                          • F
                            Finger79
                            last edited by Finger79 16 days ago 16 days ago

                            Confirmed still an issue as of May 2025 with pfSense CE 2.8.0 and Status Traffic Totals package version 2.3.2_7

                            I also updated the Redmine bugtracker: https://redmine.pfsense.org/issues/11797

                            1 Reply Last reply Reply Quote 2
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                              This community forum collects and processes your personal information.
                              consent.not_received