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

    (solved)Automatic Boot from USB harddrive

    Scheduled Pinned Locked Moved General pfSense Questions
    30 Posts 6 Posters 27.7k 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.
    • M
      morocon
      last edited by

      ok i will give it a try and come back for feed back.

      regards

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

        I've actually been having the same issue but wanted to search the internet plenty before posting. Glad I waited.

        I have tried the above mentioned fix and it works. I am also using pfsense v2.0 beta 5 and the file on my box was actually /boot/loader.conf

        This file is empty by default and it is there specifically to add overrides to the default loader configuration.

        I am liking the idea of using pfsense to boot off of a flashdrive that is plugged directly to the motherboards usb header using an adapter. This way the flash drive will not get messed with, plus it's almost as good as a solid state drive because it will likely never go bad.

        Seems to me that pfsense loads most of what it does into memory so a slow usb flash drive should affect perf much should it? (besides swap of course)

        Also, will this file be preserved after an update?

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

          Don't touch loader.conf - use loader.conf.local - create it if it does not exist.

          loader.conf.local is not touched by the upgrade process, but loader.conf may be overwritten.

          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
          • M
            morocon
            last edited by

            After a short check, it seems that what i'm looking for is not in loader.conf.

            I took a picture of the menu i would like to modify:

            I would like  menu "3 Boot PFsense Using USB device" to take place as "1 Bot Pfsense [default]". I did not find any mention on this subject in loader.conf.

            Coudl some one put light on this?

            Thanks

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

              You cannot change the default of the boot menu in that way.

              I'm not sure how many different ways I can tell you this in the same thread, but you need to edit /boot/loader.conf.local and add

              kern.cam.boot_delay=10000
              

              It does not already exist there, you need to add it, not edit the value.

              The boot menu option only sets that variable. Adding it to loader.conf.local sets the value the same way.

              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
              • M
                morocon
                last edited by

                @jimp:

                You cannot change the default of the boot menu in that way.

                I'm not sure how many different ways I can tell you this in the same thread, but you need to edit /boot/loader.conf.local and add

                kern.cam.boot_delay=10000
                

                It does not already exist there, you need to add it, not edit the value.

                The boot menu option only sets that variable. Adding it to loader.conf.local sets the value the same way.

                You could repeat it as long as you want, it doesn't work at all. Same result! If i'm not in front of the computer and select option 3 from the menu, PFsense did not boot up and just comes to prompt waiting for me to give instruction.

                Delay is not what i'm waiting for…How could i explain you this. I want the device to start on USB hard drive (where Pfsense is installed) even if i do not have keyboard nor screen. If it is not possible just say it.

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

                  But I'm telling you that all option 3 does it set precisely that variable and nothing else related to bootup. It sets two others but they are related to network cards, not booting. Behold:

                  From our beastie.4th patch that drives the menu:

                  +		dup bootusbkey @ = if
                  +			s" 0" s" hw.mca.enabled" setenv
                  +			s" 0" s" hw.bce.tso_enable" setenv
                  +			s" 10000" s" kern.cam.boot_delay" setenv
                  
                  

                  So if you want to try adding the other two to /boot/loader.conf.local as well, try:

                  hw.mca.enabled=0
                  hw.bce.tso_enable=0
                  kern.cam.boot_delay=10000
                  

                  Make sure when you edit that file that it's named properly (all lower case letters) and you probably should edit it from the shell with vi or ee to be safest.

                  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
                  • A
                    acjohnson
                    last edited by

                    morocon-

                    Have you even tried adding these options to the file yet? If you try it you may be pleasantly surprised that it works just as jimp has been telling you.

                    Sorry for causing the confusion with the loader.conf.local file. Didn't realize I had to create it. I have just tested it and it works great.

                    Thank you!

                    1 Reply Last reply Reply Quote 0
                    • M
                      morocon
                      last edited by

                      Yes i have tried! but it did not boot on USB drive

                      here is my beastie start section, i suspect something wrong in it

                      
                      : beastie-start
                      	s" beastie_disable" getenv
                      	dup -1 <> if
                      		s" YES" compare-insensitive 0= if
                      			exit
                      		then
                      	else
                      		drop
                      	then
                      	beastie-menu
                      	s" autoboot_delay" getenv
                      	dup -1 = if
                      		drop
                      		10
                      	else
                      		0 0 2swap >number drop drop drop
                      	then
                      	begin
                      		dup tkey
                      		0 25 at-xy
                      		dup 32 = if nip 0 swap then
                      		dup -1 = if 0 boot then
                      		dup 13 = if 0 boot then
                      		dup bootkey @ = if 0 boot then
                      		dup bootacpikey @ = if
                      			acpienabled? if
                      				s" acpi_load" unsetenv
                      				s" 1" s" hint.acpi.0.disabled" setenv
                      				s" 1" s" loader.acpi_disabled_by_user" setenv
                      				s" 0" s" hw.mca.enabled" setenv
                      				s" 0" s" hw.bce.tso_enable" setenv
                      			else
                      				s" YES" s" acpi_load" setenv
                      				s" 0" s" hint.acpi.0.disabled" setenv
                                                      s" 0" s" hw.mca.enabled" setenv
                                                      s" 0" s" hw.bce.tso_enable" setenv
                      			then
                      			0 boot
                      		then
                      		dup bootsafekey @ = if
                      			s" arch-i386" environment? if
                      				drop
                      				s" acpi_load" unsetenv
                      				s" 1" s" hint.acpi.0.disabled" setenv
                      				s" 1" s" loader.acpi_disabled_by_user" setenv
                      				s" 1" s" hint.apic.0.disabled" setenv
                                                      s" 0" s" hw.mca.enabled" setenv
                                                      s" 0" s" hw.bce.tso_enable" setenv
                      			then
                      			s" 0" s" hw.ata.ata_dma" setenv
                      			s" 0" s" hw.ata.atapi_dma" setenv
                      			s" 0" s" hw.ata.wc" setenv
                      			s" 0" s" hw.eisa_slots" setenv
                      			s" 1" s" hint.kbdmux.0.disabled" setenv
                      			s" 0" s" hw.mca.enabled" setenv
                      			s" 0" s" hw.bce.tso_enable" setenv
                      			0 boot
                      		then
                      		dup bootusbkey @ = if
                      			s" 0" s" hw.mca.enabled" setenv
                      			s" 0" s" hw.bce.tso_enable" setenv
                      			s" 10000" s" kern.cam.boot_delay" setenv
                      			0 boot
                      		then
                      		dup bootverbosekey @ = if
                      			s" 0" s" hw.mca.enabled" setenv
                      			s" 0" s" hw.bce.tso_enable" setenv
                      			s" YES" s" boot_verbose" setenv
                      			0 boot
                      		then
                      		dup bootsinglekey @ = if
                      			s" 0" s" hw.mca.enabled" setenv
                      			s" 0" s" hw.bce.tso_enable" setenv
                      			s" YES" s" boot_single" setenv
                      			0 boot
                      		then
                      		dup escapekey @ = if
                      			2drop
                      			s" NO" s" autoboot_delay" setenv
                      			exit
                      		then
                      		rebootkey @ = if 0 reboot then
                      	again
                      ;
                      
                      previous
                      

                      I'm not confident with freebsd bash coding, but i suposed somewhere at the beginning of this section is defined what dup menu will be loaded as default. I would like ti to be bootusbkey. Unfortunatly, and even with modification you recommended, it doesn't start, but just come to a prompt that talk about vfs.mountfrom.options whish should have been set to read write.

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

                        Nothing is wrong with that. As you can see the section I posted is within the part you posted (mine just had the +'s because it was from a patch file not the actual file, and I trimmed the surrounding irrelevant text).

                        If the menu option worked but adding it to loader.conf.local does not, then you must not be putting the right values into loader.conf.local or the file isn't in the right place, or something else must be wrong.

                        Further, you need to give exact precise error messages and not "a prompt that talk about vfs.mountfrom.options". Take a cell phone picture of the screen if you have to, but be precise.

                        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
                        • M
                          morocon
                          last edited by

                          here it is:

                          http://pfsensepict.dyndns.org

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

                            Sure that's the right URL?

                            Host pfsensepict.dyndns.org not found: 3(NXDOMAIN)
                            

                            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
                            • M
                              morocon
                              last edited by

                              oops, try again, it should be working now that i activated it! :)

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

                                Remove this from /boot/loader.conf and /boot/loader.conf.local

                                autoboot_delay="3"
                                

                                It probably is ignoring the other lines because it says there is a syntax error on that line.

                                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
                                • M
                                  morocon
                                  last edited by

                                  Thaanks, do you have a sample of how it should be written?

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

                                    /boot/loader.conf should probably be empty.

                                    And if you want to mimic option 3 exactly, /boot/loader.conf.local should only contain:

                                    hw.mca.enabled=0
                                    hw.bce.tso_enable=0
                                    kern.cam.boot_delay=10000
                                    

                                    Nothing else.

                                    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
                                    • M
                                      morocon
                                      last edited by

                                      @jimp:

                                      /boot/loader.conf should probably be empty.

                                      And if you want to mimic option 3 exactly, /boot/loader.conf.local should only contain:

                                      hw.mca.enabled=0
                                      hw.bce.tso_enable=0
                                      kern.cam.boot_delay=10000
                                      

                                      Nothing else.

                                      Ok i will do so.

                                      I found a file call loader.conf (<>loader.conf.local)where the " autoboot_delay="3" " is writen, what should i do with this one?

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

                                        Remove it from both files.

                                        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
                                        • M
                                          morocon
                                          last edited by

                                          @jimp:

                                          Remove it from both files.

                                          You are the hitman jimp!

                                          Ok i guess there was some thing wrong in my usb drive, so i decided to start from scrash and re-install f sense on it.

                                          Then i create the file /boot/loader.conf/local (as you recommended it) including

                                          hw.mca.enabled=0
                                          hw.bce.tso_enable=0
                                          kern.cam.boot_delay=10000
                                          

                                          Then reboot, then….Miracle! It works!!

                                          Thanks guys

                                          1 Reply Last reply Reply Quote 0
                                          • M
                                            MrKoen
                                            last edited by

                                            Same situation here. I'm using a 2,5 inch USB disk drive for my pfSense server. I needed to press 3 in the pfSense boot menu to get it to work. Using the steps outlined in this forum topic I was able to have it boot using USB support automatically. I have put the easy steps together in a tutorial at http://www.zomers.eu/knowledge/pfSense/Pages/Configure-pfSense-2.0-RC1-to-boot-from-USB-disk.aspx

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