How to create bootable USB installer from 'memstick' IMG download?



  • I've have tried running 'dd' command from the terminal to write the memstick (2.0.3 i386 release) image file to the drive from both my Linux Ubuntu PC and my Mac but none of them will boot my PC. I have set the BIOS boot order to 1. removable, 2. CD Drive, and 3. Hard Drive and still no luck. When it tries to boot from the USB drive it gets stuck at verifying DMI pool and never loads. I also tried to find a Linux app which can create a bootable USB but have found nothing which would work for IMG files. I installed UNetbootin hoping that might work but it appears to only work with ISO files, not IMG files.

    I am just learning linux and don't have a Windows PC, only Ubuntu PC and Mac. The reason I need to be able to install from USB is that I just picked up a micro-ITX pc and it does not have a cd/dvd drive. Please note, I was able to create a bootable LiveCD install disk with my mac and it could boot and run the pfSense installer on my test Linux machine. Unfortunately, this is not the machine I want to ultimately run it on. Please help  ???



  • dd is all you need, but make sure it's un-gzipped before you dd it.



  • I already tried 'DD'ing the memstick IMG as mentioned in my initial post. However, I just thought of something which I might be doing wrong. Which version of the install release should I be using? I want to install to the hard drive on my mini-ITX box (not run pfSense from the USB).

    Therefore, should I be using the 'pfSense-LiveCD-2.0.3-RELEASE-i386-20130412-1022.iso', 'pfSense-memstick-2.0.3-RELEASE-i386-20130412-1022.img', or the another download?

    This is the syntax I used for 'DD' (1 for img and 2 for iso):

    1. sudo dd if=/path/to/file/pfSense-memstick-2.0.3-RELEASE-i386-20130412-1022.img of=/dev/sdc bs=1M

    2. sudo dd if=/path/to/file/pfSense-LiveCD-2.0.3-RELEASE-i386-20130412-1022.iso of=/dev/sdc bs=1M

    Are the above 'DD' command correct or am I still missing something?



  • Could someone PLEASE post a step-step list on how to properly prepare a USB drive for booting and installing pfSense to an internal hard drive using Linux-flavor OS?

    I have tried for hours using different combinations of 'DD' commands, USB disk partition formats, running DD when device is mounted or unmounted, and different release downloads without any success. This is getting extremely frustrating since it should be something which is easily accomplished or documented somewhere. I have found lots of explanation but they are all windows specific. Ugg!



  • I would try bs=16k

    The initial format of the destination drive does not matter. dd will overwrite the entire drive anyway.



  • @gderf:

    I would try bs=16k

    The initial format of the destination drive does not matter. dd will overwrite the entire drive anyway.

    This did not work either. What download should I use to create a bootable USB drive? What is the correct syntax for the 'dd' to create it?

    I am about to throw in the towel on creating a bootable pfSense USB drive and installing pfSense. I have had no trouble doing this for various linux distros. Has anyone else been able to accomplish this with version 2.0.3???



  • I seem to remember there have been difficulties when writing the Live CD Image to a USB thumb drive and then trying to boot it. Things (other than pfsense which I have not tried) will boot only so far and then hang.



  • @gderf:

    I seem to remember there have been difficulties when writing the Live CD Image to a USB thumb drive and then trying to boot it. Things (other than pfsense which I have not tried) will boot only so far and then hang.

    Do you know of any other way to install besides USB or LiveCD? Like I mentioned before, I was able to create a LiveCD and install psSense on my linux test PC. Unfortunately, the micro-ITX pc I want to install to does not have a cd/dvd drive.

    I just did another test with UNetbootin to install Clonezilla on the USB drive. It did the same thing as the pfSense 'dd' install where it hung on boot at something like 'Verifying DMI pool…' Maybe someone on this forum with PC hardware experience can help with this. Is this a BIOS thing? I just can believe that no one has had success installing pfSense to a memstick using a PC running Linux!



  • @rmflint:

    When it tries to boot from the USB drive it gets stuck at verifying DMI pool and never loads.

    Never is a very long time. How long did you wait?

    Please provide the complete text of what was on the screen (or a photo of the screen) so we can better determine at what stage in the boot this message appears. (I think it might be reported early in the system startup BEFORE FreeBSD gets control of the system.)

    @rmflint:

    Please note, I was able to create a bootable LiveCD install disk with my mac and it could boot and run the pfSense installer on my test Linux machine. Unfortunately, this is not the machine I want to ultimately run it on. Please help  ???

    What do you want to install pfSense to (a USB stick, Compact Flash card, SSD, magnetic drive etc)? You might be able to attach that storage device to your Linux PC, install pfSense on the drive there then attempt to boot the drive on the troublesome PC.

    Does the PC you want to run pfSense successfully boot and run a Linux image on a USB stick?

    What is the make and model of your mini-ITX board?



  • I re-downloaded the memstick i386 version then unzipped it onto my Ubuntu desktop folder. I then opened terminal and umouted the device (4GB USB Flash stick) then ran the following 'dd' command.

    dd if=/home/daf/Desktop/pfSense-memstick.img of=/dev/sdb1 bs=16k

    There where no errors generated so I assumed it ran correctly. After running the 'dd' command I was unable to mount the USB drive from the terminal or gparted but I assumed this was a normal result of the data overwritten onto the drive. I then restarted the PC with the USB drive plugged in. It appeared to ignore the drive and proceeded to boot from the internal hard drive into Ubuntu. This was done on my test PC which is an old emachine with an AMD Athlon 64 Processor 3800+. Also, as I noted before, I was able to load and test pfSense on this PC using a Live CD disk but this is not an option for the other mini-ITX PC I want to load pfSense to since it does not have a CD drive.

    The PC I want to finally install pfSense on is a mini-ITX. I believe the mobo is made by Jetway. The modo model number is 7F2WE1G-OC-PB. The CPU is and Intel socket 370, version VIA C7 running at 1000MHz. It has a 40GB internal drive which is where I ultimately want to install pfSense to. I was able to use the same USB Flash drive to load and run Ubuntu 13.04 from their Live CD ISO just to make sure it could load and run Linux.

    I want to install pfSense to the mini-ITX hard drive (SATA drive, not SSD) and use it as a standalone router only.



  • @rmflint:

    I re-downloaded the memstick i386 version then unzipped it onto my Ubuntu desktop folder. I then opened terminal and umouted the device (4GB USB Flash stick) then ran the following 'dd' command.

    dd if=/home/daf/Desktop/pfSense-memstick.img of=/dev/sdb1 bs=16k

    There where no errors generated so I assumed it ran correctly. After running the 'dd' command I was unable to mount the USB drive from the terminal or gparted but I assumed this was a normal result of the data overwritten onto the drive. I then restarted the PC with the USB drive plugged in. It appeared to ignore the drive and proceeded to boot from the internal hard drive into Ubuntu. This was done on my test PC which is an old emachine with an AMD Athlon 64 Processor 3800+. Also, as I noted before, I was able to load and test pfSense on this PC using a Live CD disk but this is not an option for the other mini-ITX PC I want to load pfSense to since it does not have a CD drive.

    The PC I want to finally install pfSense on is a mini-ITX. I believe the mobo is made by Jetway. The modo model number is 7F2WE1G-OC-PB. The CPU is and Intel socket 370, version VIA C7 running at 1000MHz. It has a 40GB internal drive which is where I ultimately want to install pfSense to. I was able to use the same USB Flash drive to load and run Ubuntu 13.04 from their Live CD ISO just to make sure it could load and run Linux.

    I want to install pfSense to the mini-ITX hard drive (SATA drive, not SSD) and use it as a standalone router only.

    I just did a test to verify that my test pc could actually boot from a USB drive by creating an Ubuntu installer using their ISO download. I created the USB drive installer using Ubuntu's 'Startup Disk Creator' application. After restart, my system had no problem booting from the USB drive. Therefore, this leads me to believe that using just the 'dd' command to write the pfSense IMG/ISO download to the USB flash drive is not the only step required. What else could be required? Are there any config files which need to be changed? A special boot loader?

    Can anyone tell the steps they might have used to create a working installer on a USB flash/thumb drive???



  • The easiest way for you to get this done is to remove the 40 GB internal drive from the mini-ITX and install it into a machine that has a CD drive in it, boot the pfsense Live CD, and install pfsense to the 40 GB internal drive. Then remove the 40 GB internal drive and put it back into the mini-ITX.



  • @rmflint:

    I re-downloaded the memstick i386 version then unzipped it onto my Ubuntu desktop folder. I then opened terminal and umouted the device (4GB USB Flash stick) then ran the following 'dd' command.

    dd if=/home/daf/Desktop/pfSense-memstick.img of=/dev/sdb1 bs=16k

    The of parameter should have been /dev/sdb to write the disk image to the whole disk (including the MBR, Master Boot Record) rather than /dev/sdb1 which writes it partition 1 (which doesn't update the MBR and hence does make the disk bootable and doesn't write the pfSense boot loader to the MBR and following sectors). The power of 1!

    @gderf:

    The easiest way for you to get this done is to remove the 40 GB internal drive from the mini-ITX and install it into a machine that has a CD drive in it, boot the pfsense Live CD, and install pfsense to the 40 GB internal drive. Then remove the 40 GB internal drive and put it back into the mini-ITX.

    I think this is probably the easiest way if you can't write the image to the USB stick in the correct way (you might not have the necessary privileges), or you then have trouble booting from the USB stick. If you do adopt this course, take care you don't overwrite the system disk on the other machine!



  • Thanks everyone for your advice. After numerous tries I was unable to create a bootable memstick installer. Therefor I went to plan B: Connected CD drive directly to mini-itx pc and installed from live-cd with no apparent problems on install.

    Unfortunately, I have now spent many frustrating hours trying to successfully connect a client machine to the pfsense box. After setting up the WAN (rl0) and LAN (fwe0) ports I still can't get either my linux pc or Mac to open the webgui via http://192.168.1.1. I thought maybe it was something as simple as the incorrect type of cable so I tried a crossover cable between the machines and still no luck. Can anyone tell me what I am missing or how to test/trouble shoot my setup???



  • @rmflint:

    After setting up the WAN (rl0) and LAN (fwe0) ports I still can't get either my linux pc or Mac to open the webgui via http://192.168.1.1. I thought maybe it was something as simple as the incorrect type of cable so I tried a crossover cable between the machines and still no luck. Can anyone tell me what I am missing or how to test/trouble shoot my setup???

    Are you sure the box you're trying to connect from is on the same subnet as your pfSense box? For example, the UNIX command to change your Linux box to the same subnet as your pfSense box would be:

    # ifconfig fwp0 inet 192.168.1.100 netmask 255.255.255.0
    

    If I work on my modem by connecting directly to it I have to change my machine LAN IP to match the subnet (I know that's the hard way to do things) then back to my pfSense box subnet after I'm done to be able to log onto my LAN.



  • @rmflint:

    After setting up the WAN (rl0) and LAN (fwe0) ports I still can't get either my linux pc or Mac to open the webgui via http://192.168.1.1.

    fwe is Ethernet emulation on FireWire. I suspect that is NOT the interface you want to use. Please post the output of pfSense shell command ifconfig so we can see what interfaces are present. I presume there is an onboard NIC. Have you added another NIC?





  • @cmb:

    dd is all you need, but make sure it's un-gzipped before you dd it.

    same issue, and it is unzipped, USB stick is erased

    sudo dd if=pfSense-memstick-2.0.3-RELEASE-amd64.img of=/dev/disk1 bs=1k
    

    command completes successfully, but it isn't possible to boot from the stick.
    is there a preferred command to unzip the image maybe? I've been letting OSX handle it.


  • Rebel Alliance Developer Netgate

    BSD:

    gzip -dc whatever.img.gz | dd of=/dev/adX
    

    or

    gzip -dc whatever.img.gz | dd of=/dev/adX obs=64k
    

    Mac:

    gzcat whatever.img.gz | dd of=/dev/diskX
    

    (Make sure diskX is not mounted and has no mounted slices first)

    Linux:

    gunzip -c whatever.img.gz | dd of=/dev/hdX
    

    Windows:
    Use Win32 Disk Imager or Physdiskwrite/PhysGUI, make sure to remove existing partitions in Disk Manager to be sure it's getting a clean write.

    It should "Just Work" in terms of booting. If it was written correctly, it's up to the BIOS from there. And the USB key can play a part in it. For example, my Soekris net6501 will boot on less than half of my USB sticks, due to quirks in its BIOS when dealing with older sticks.


Log in to reply