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

    Disk Size, Memory Status… etc does not show after a fresh install

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    7 Posts 3 Posters 1.6k 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.
    • A
      azkerm
      last edited by

      Hi Guys,

      I was trying to expand pfsense disk space from 30GB (when installing initially) to 150 GB since I'm planning on using squid for caching. I've tried searching for plenty of articles to do achieve this so that I can use pfsense peacefully. But I couldn't find a proper one which could help me doing this as I've tried the gparted which didn't show resizing at all. and the pfsense installed system showed that it was an unknown disk.

      So I decided to install a fresh copy by following this article here which did help me to install and get the interfaces but soon after I logged in, I did not see the disk usage, memory usage… etc as it only showed the percentages.

      What my problem is;

      • For the old pfsense, how am I suppose to expand the disk usage, if so I can use the existing one

      • Else, for the newly installed one. The disk space is not showing; is it because of the disk space (150GB) that I've given??

      P.S.: Both the VM are on a Thick provision lazy zeroed

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        This function generates the disk usage number, from /usr/local/www/includes/functions.inc.php

        function disk_usage() {
        $dfout = "";
        exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout);
        $diskusage = trim($dfout[0]);
        
        return $diskusage;
        }
        

        Maybe there is some problem with the number being too big somewhere. Try bits of the "exec" command from the command line - "/bin/df -h" etc - and see what the real output is. Then it might become obvious what the problem is, and even how to fix it.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • A
          azkerm
          last edited by

          Sorry I'm lost .. are you advising me to create a bash script?? using that function??

          If I'm wrong, please advise where & what should I exactly need  to do. And is this the existing one that I have to do??

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            He's asking you to try the command, or parts of it at the command line.
            The code used is:

            /bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1
            

            You can see that's actually 4 separate commands piped into each other so you can try the various parts to see which is snipping your GB values.

            [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(4): /bin/df -h
            Filesystem           Size    Used   Avail Capacity  Mounted on
            /dev/ufs/pfsense0    442M    252M    154M    62%    /
            devfs                1.0k    1.0k      0B   100%    /dev
            /dev/ufs/cf           49M    2.0M     43M     4%    /cf
            /dev/md0              38M    386k     35M     1%    /tmp
            /dev/md1              57M     22M     31M    41%    /var
            devfs                1.0k    1.0k      0B   100%    /var/dhcpd/dev
            [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(5): /bin/df -h | /usr/bin/grep -w '/'
            /dev/ufs/pfsense0    442M    252M    154M    62%    /
            [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(6): /bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' 
            62%
            [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(7): /bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1
            62
            [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(8): 
            
            

            Looks like it's only supposed to show the percentage. Just use 'df -h' at the cli to find see your full usage.

            Steve

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              Ok, so that above is true except that that's not the relevant bit!  ::)
              If you look at the dashboard widget it usually shows '62% of 442MB' or similar. The code that generates that is:

              
               of 
              

              Hence why is yours not showing the values for 'of'? Do the same as above to find out:

              [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(9): /bin/df -h
              Filesystem           Size    Used   Avail Capacity  Mounted on
              /dev/ufs/pfsense0    442M    252M    154M    62%    /
              devfs                1.0k    1.0k      0B   100%    /dev
              /dev/ufs/cf           49M    2.0M     43M     4%    /cf
              /dev/md0              38M    402k     35M     1%    /tmp
              /dev/md1              57M     22M     31M    41%    /var
              devfs                1.0k    1.0k      0B   100%    /var/dhcpd/dev
              [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(10): /bin/df -h / | /usr/bin/grep -v 'Size' 
              /dev/ufs/pfsense0    442M    252M    154M    62%    /
              [2.1.1-PRERELEASE][root@pfsense.localdomain]/root(11): /bin/df -h / | /usr/bin/grep -v 'Size' | /usr/bin/awk '{ print $2 }'
              442M
              
              

              Steve

              1 Reply Last reply Reply Quote 0
              • A
                azkerm
                last edited by

                Okay! I'm totally lost now. Below is what I get

                
                [2.1-RELEASE][admin@pfsense.localhost]/root(3):  /bin/df -h
                Filesystem     Size    Used   Avail Capacity  Mounted on
                /dev/da0s1a     13G    701M     11G     5%    /
                devfs          1.0k    1.0k      0B   100%    /dev
                /dev/md0       3.6M     56k    3.3M     2%    /var/run
                devfs          1.0k    1.0k      0B   100%    /var/dhcpd/dev
                [2.1-RELEASE][admin@pfsense.localhost]/root(4): /bin/df -h | /usr/bin/grep -w '/'
                /dev/da0s1a     13G    701M     11G     5%    /
                [2.1-RELEASE][admin@pfsense.localhost]/root(5): /bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }'
                5%
                [2.1-RELEASE][admin@pfsense.localhost]/root(6): /bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1
                5
                [2.1-RELEASE][admin@pfsense.localhost]/root(7): 
                
                

                Also when I use gpart show

                
                [2.1-RELEASE][admin@pfsense.localhost]/root(8): gpart show
                =>       63  314572737  da0  MBR  (150G)
                         63   31455207    1  freebsd  [active]  (15G)
                   31455270  283117530       - free -  (135G)
                
                =>       0  31455207  da0s1  BSD  (15G)
                         0        16         - free -  (8.0k)
                        16  29358039      1  freebsd-ufs  (14G)
                  29358055   2097152      2  freebsd-swap  (1.0G)
                
                

                I need to expand the storage… where I'm lost doing so...

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  So what do you see on the dashboard? From your output above I would exepct to see, '5% of 13G'.

                  So your problem is not that you're not seeing a value rather that the root slice is not the filling the drive?

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.