Welcome, Guest. Please login or register.

Author Topic: iso image file to bootable usb stick  (Read 9970 times)

gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
iso image file to bootable usb stick
« on: July 09, 2015, 09:00:47 PM »
I am starting with generic-pc-1.8.2b42.iso file and I use (among other things) dd to write it to an 8GB Sandisk  USB stick. However, the resulting USB drive will not boot on any machine I have.


Any ideas?





andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 124
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #1 on: July 15, 2015, 10:33:30 AM »
what command are you using, also , normally you use DD for an IMG file, not an ISO

gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #2 on: July 15, 2015, 02:22:51 PM »
On a linux box I am using:


dd if=generic-pc-1.8.2b42.iso of=/dev/sde bs=1M


I have tried a few different choices for bs= but it doesn't make a difference.


The USB stick is good as writing generic-pc-1.8.2b42.img to it works fine.


If dd is not correct for writing isos, what is?

Lee Sharp

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
    • SmallWall
Re: iso image file to bootable usb stick
« Reply #3 on: July 20, 2015, 06:46:38 PM »
The CD-Rom image is a special image that will boot from and run a CD-Rom, and save the config to a floppy or USB stick.  For burning to a CD, use one of these. http://www.techdrivein.com/2011/03/9-good-cd-and-dvd-burning-tools-for.html

You want an image file if you are burning directly to a USB stick or CF-Card.  Also, the image is compressed, and uses small blocks, so try "zcat ./generic-pc-1.8.2b42.img | dd of=/dev/sdc bs=16k" as root. (sudo -i on ubuntu)

If you are wanting to make a "Live-CD" from the cd-rom image, you will have issues, as it will not find the parts it expects when booting.  If you want a flash drive to boot and imaged systems, I recommend a Linux CLI install for that.

gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #4 on: July 20, 2015, 07:03:33 PM »
Thanks Lee, but you miss my point.


I want to be able to boot from a USB flash drive for one purpose, and one purpose only: To be able to install the on USB drive version to the internal SD card - just like can be done from the Live-CD version.


What I am faced with now when an upgrade from the GUI goes bad: I have to remove the cover from my AUP router box, remove the SD card, take it to another machine, write the previous known to work version to the SD card, take the card back to the AUP, boot it, then restore the configuration from a backup copy.


Needless to say, I am not terribly interested in testing new versions under these circumstances.

Lee Sharp

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
    • SmallWall
Re: iso image file to bootable usb stick
« Reply #5 on: July 22, 2015, 04:10:10 PM »
I understood what you needed, but I was unclear in my response.

Because of the way it is built, there is not an easy way to install a LiveCD to USB.  You best bet is to make a Linux install to USB (For example, install Ubuntu Server to a 2 gig stick) and use it with zcat and dd to install the image, much like Chris's original m0n0wall installer CD.

gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #6 on: July 22, 2015, 04:41:12 PM »
Well, that's a step in the right direction, but still a convoluted solution. It would be easier to just run from USB rather than internal SD, at least while playing with new versions that might not boot.


Would it be possible to make a generic-pc version that is writable to, and bootable from a USB stick, just like we already have now, but that has an install to disk option from the console just like the Live-CD has?


Lee Sharp

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
    • SmallWall
Re: iso image file to bootable usb stick
« Reply #7 on: July 23, 2015, 06:10:37 AM »
I think it could probably be done.  It might just need to identify as CD-Rom to work.  Check out the SmallWall Hacking Guide. http://www.smallwall.org/docs/dev/index.html  Specifically the section on playing with images. http://www.smallwall.org/docs/dev/dev-workon.html

This will work for SmallWall, t1n1wall and m0n0wall images.

gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #8 on: July 25, 2015, 05:03:41 PM »
Thanks, but this is way more than I would be willing to get involved with, especially considering it would have to be done all over again for every incremental new release.








andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 124
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #9 on: August 05, 2015, 12:48:08 PM »
Hi, was away on a long vacation ...

I don't see a reason not to create an img file that contains an installer , like the iso file does, so we would have a serial and non-serial img as normal, and a serial an non-serial img that has an installer.  I need to think about it a bit more, and consider how to make sure that someone doesn't use the installer img for an upgrade through the UI etc.


gderf

  • Administrator
  • Newbie
  • *****
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #10 on: August 05, 2015, 02:22:03 PM »
Thanks, and welcome back.

Lee Sharp

  • Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
    • View Profile
    • SmallWall
Re: iso image file to bootable usb stick
« Reply #11 on: August 12, 2015, 05:08:00 AM »
I need to think about it a bit more, and consider how to make sure that someone doesn't use the installer img for an upgrade through the UI etc.

Wouldn't just having a different name trigger the improper image type error?

And I think a simple Linux based CLI installer might actually work out quite well.  Let me work on that a bit. :)  I can probably spin something up in a week or so.

andywhite

  • Administrator
  • Full Member
  • *****
  • Posts: 124
  • Karma: +0/-0
    • View Profile
Re: iso image file to bootable usb stick
« Reply #12 on: September 12, 2015, 03:12:54 PM »
There are now 'installer' images that you write to media as normal that give an install option like the cdrom version.

The firmware upgrade page should now prevent upgrades using installer images, and should also prevent upgrades with the wrong type (serial onto non serial)

It is possible to upgrade to an amd64 image on a an i386 based platform and vice versa , maybe this should be prevented to stop accidental breakage.