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

      Hi everyone,

      Congratulation for all your nice job!!

      I'm not sure this the right place to post, so dear mods, feel free to move it wher it should be.

      I googled a lot but actualy do not find what i'm looking for (maybe because i'm a newbie).

      I installed PFSENSE BETA5 on a Usb HDD from a memory stick. everythings fine.

      Trouble:

      As you could imagine, if i installed PFsense on a removable device, this is because the flash memory on the computer is dead (i used a thin client computer).

      My trouble is that booting from USB is not automatic (default will always start from AD0 device which is supposed to be en embed media). So this means that actualy my device could not work as production (without keyboard, screen…and guy in front of it  :)).

      So i would like to modify the default boot menu option in order the default settings to be the USB harddrive.

      Please don't waste your time arguying about the USB device, when i say production, i mean a bench test production  ;). of course when we go to the full production we will selected a better computer.

      So, Could someone point me to the step by step howto modify the default boot sequence in order it start on USB dev as default?  ???

      (i'm totaly noob with freebsd :( )

      Regards

      1 Reply Last reply Reply Quote 0
      • Cry HavokC
        Cry Havok
        last edited by

        Are you talking about the BIOS boot menu, or the FreeBSD/pfSense one?

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

          Hi,

          I'm not sure, but i guess this is PFsense/freebsd one.

          The one where it give you choice from starting on embed hard drive, or safe mode, or USB.

          I would like to modify the default value which start after 3 seconds, and that is actualy pointing to embed harddrive to USB.

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

            The boot menu option to boot from USB does not change the boot device, it just inserts a 10-second delay into the boot process to allow USB devices to be fully detected before proceeding.

            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

              If it does work when using that option, but not when left alone, just make that setting permanent. It's described here:
              http://doc.pfsense.org/index.php/Boot_Troubleshooting

              Just need to add

              kern.cam.boot_delay=10000
              

              To /boot/loader.conf.local

              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

                Thanks for your help, but maybe i was not clear enough (please appologize if so)….

                when i said
                "I would like to modify the default value which start after 3 seconds, and that is actualy pointing to embed harddrive to USB."

                I do not want to modify the 3 secondes delay. I want to change the default boot...I want my device to boot automaticly on USB drive.

                I did not see any information on your url related to USB drive boot automaticly....I do not have /dev/ad0 or /dev/ad0s1
                on this device...I only have usb drive.

                regards

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

                  Then perhaps there is some confusion here.

                  What is not automatic? What exactly do you have to do manually to make it work?

                  Does it start to boot and then stop at a mountroot> prompt?

                  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

                    Ok i will try to be as clear as possible….

                    The device i used did not have hard disk nor flash memory.

                    So i installed  pfsense on 40Go Usb hard drive with Usb memory stick.

                    it works but i should be in front of the device with keyboard and screen each time i boot it up in order to selest the boot option (start from USB) in order it load pfsense. What i want it just that the device start directly from the usb hard drive it was installed without any human action.

                    I guess i have to modify the bot up menu, but don't know where it is loacated and how to do so.

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

                      Then – as I mentioned before -- make the loader.conf.local changes I suggested. That's what the menu option does, it adds that delay setting.

                      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

                        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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.