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

    Reduce boot time [SOLVED]

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 3 Posters 7.3k 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.
    • R
      r31griffo
      last edited by

      G'day everyone,

      I'm a very recent convert from IPCop, I've made the switch because all of the functionality I had to 'add' to IPCop through unsupported addons cames standard in pfSense.  I look forward to using some of its more advanced capabilities, I have to admit that I'm very impressed with pfSense and its feature set straight out of the box.

      The only downside I have noticed is a slightly longer downtime, and this is by no means a criticism just a comparison.  I have improved mine slightly by changing the /boot/loader.conf so that it time-outs in 1 second but I think the biggest gains can be made at the beginning when it boots.  I've noticed for about 15 seconds at boot time the following is displayed:

      F1   FreeBSD

      Boot:  F1

      Not knowing anything about FreeBSD, is this the bootblock menu?  If so, I should be able to change the timeout value using boot0cfg the problem is I can't seem to figure out the right syntax when entering the command. I've tried boot0cfg -t 18 and variations of this without any luck, I'm hoping someone can help me with this.

      Also is there a way to change this timeout during the installation of pfSense?

      Thanks in advance,

      Griffo

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        If you press F1 does it start to boot immediately? Or does it still pause?

        Usually it doesn't display that prompt very long, but I've never timed it.

        Edit: Try this:

        # sysctl kern.geom.debugflags=0x16
        # fdisk -B ad0
        

        And answer 'y' to both prompts.

        That should get rid of the F1 prompt altogether.

        Edit 2: Forgot the debugflags step.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • D
          danswartz
          last edited by

          Hmm, when I tried this, the last step got me this:

          fdisk -B ad0

          ******* Working on device /dev/ad0 *******
          parameters extracted from in-core disklabel are:
          cylinders=59554 heads=16 sectors/track=63 (1008 blks/cyl)

          Figures below won't work with BIOS for partitions not in cyl 1
          parameters to be used for BIOS calculations are:
          cylinders=59554 heads=16 sectors/track=63 (1008 blks/cyl)

          Media sector size is 512
          Warning: BIOS sector numbering starts with sector 1
          Information from DOS bootblock is:
          The data for partition 1 is:
          sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
              start 63, size 60030369 (29311 Meg), flag 80 (active)
                  beg: cyl 0/ head 1/ sector 1;
                  end: cyl 161/ head 15/ sector 63
          The data for partition 2 is:
          <unused>The data for partition 3 is:
          <unused>The data for partition 4 is:
          <unused>Do you want to change the boot code? [n] y

          We haven't changed the partition table yet.  This is your last chance.
          parameters extracted from in-core disklabel are:
          cylinders=59554 heads=16 sectors/track=63 (1008 blks/cyl)

          Figures below won't work with BIOS for partitions not in cyl 1
          parameters to be used for BIOS calculations are:
          cylinders=59554 heads=16 sectors/track=63 (1008 blks/cyl)

          Information from DOS bootblock is:
          1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
              start 63, size 60030369 (29311 Meg), flag 80 (active)
                  beg: cyl 0/ head 1/ sector 1;
                  end: cyl 161/ head 15/ sector 63
          2: <unused>3: <unused>4: <unused>Should we write new partition table? [n] y
          fdisk: Class not found <==== Problem?</unused></unused></unused></unused></unused></unused>

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            @danswartz:

            Hmm, when I tried this, the last step got me this:
            fdisk: Class not found <==== Problem?

            I got the same error but it worked for me. If you get a message like "fdisk: failed to write sector zero" then there is a problem – namely, that you need to do the debugflags sysctl first.

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • D
              danswartz
              last edited by

              Cool, thanks!

              1 Reply Last reply Reply Quote 0
              • R
                r31griffo
                last edited by

                @jimp:

                If you press F1 does it start to boot immediately? Or does it still pause?

                Usually it doesn't display that prompt very long, but I've never timed it.

                It was booting 3 seconds after I pressed F1

                @jimp:

                @danswartz:

                Hmm, when I tried this, the last step got me this:
                fdisk: Class not found <==== Problem?

                I got the same error but it worked for me. If you get a message like "fdisk: failed to write sector zero" then there is a problem – namely, that you need to do the debugflags sysctl first.

                I recieved 2 errors:
                fdisk: Class not found
                fdisk: Failed to write sector zero

                Using the  sysctl kern.geom.debugflags=0x16 command it worked a treat.

                This just shaved 10 seconds off the total boot time…you are now my personal hero

                NOTE TO OTHERS THAT TRY THIS:
                A LOT OF DEBUG INFORMATION WILL BE DISPLAYED ON THE SCREEN WHEN YOU TYPE THE SECOND COMMAND.  THE FDISK COMMAND WILL LOOK LIKE IT DISAPPEARS AS YOU TYPE IT, THIS IS NOT A PROBLEM JUST FINISH THE COMMAND AND PRESS ENTER.  ALTHOUGH I'M SURE THERE IS A COMMAND TO STOP THIS DEBUG INFO, IT WILL STOP DEBUGGING WHEN YOU RESTART THE COMPUTER.

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  The debug info may only display on the console, not if you do it via ssh, and even then it may only happen if you're using gmirror.

                  To get rid of it, use:

                  sysctl kern.geom.debugflags=0
                  

                  Or, as you noticed, a reboot will also take care of it.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • jimpJ
                    jimp Rebel Alliance Developer Netgate
                    last edited by

                    I also dropped this stuff into an FAQ entry for future reference:

                    http://doc.pfsense.org/index.php/Remove_F1_Boot_Prompt

                    And the debug should really be =16, not 0x16, my memory was fuzzy on that one so I looked it up again. It worked with 0x16 but that may be why the debug messages were printing, since it wasn't quite the right mode, it had more debug info turned on.

                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                    Need help fast? Netgate Global Support!

                    Do not Chat/PM for help!

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