[GTALUG] question -- how to boot from USB with multiple ISOs?

Nigel Auger subs1 at augermax.com
Thu Oct 1 17:08:20 UTC 2015


Here is another take on the problem. I use Grub for DOS (grub4dos). The
Grub version is the legacy version 1 not the current version 2. There are
many caveats which I list below and hope I don't forget any. Some are due
to my lack of knowledge meaning I simply have not gotten around to
researching the area more deeply. This is probably a very old approach
(i.e. from the Windows XP days). In spite of the limitations, I really like
this approach. I have about four or five bootable USB sticks in my
collection. It has saved me innumerable times when I could not boot a
system, both Linux and Windows 7. It is extremely flexible in that you can
simply go into the menu.lst file on the stick with a text editor, edit it
quickly, and boot your system. You can create a useful rescue tool from
which you can boot things like (1) Kaspersky rescue disk, (2) Truecrypt
rescue ISO, (3) Windows 7 install ISO, (4) various Linux liveDVDs, etc. In
the latter case I have used PCLinuxOS and KUbuntu 12.04 successfully.

Limitation / Caveat (1) - This solution is (maybe) limited to 8 GB first
partitions / USB sticks. To date I have never been successful in getting it
to boot from either a first partition or, in the case of a one partition
only stick, an entire USB stick that is larger than 8 GB. I am sure there
are many on this message board who know how to move past this perceived
limitation but for my purposes, I was happy to live with it so I never
investigated further. I have successfully used larger sticks that were set
up with multiple partitions where the first partition is always 8 GB.

Limitation / Caveat (2) - ISO files that you want to boot MUST be
contiguous. This can be frustrating. The best approach is to make a base
template with the base Grub for DOS files which are tiny, set up your stick
using dd from an image or another stick, and then copy over your ISOs. You
MUST do this to a freshly (re)formatted USB stick to ensure the ISO is
written contiguously. Plan to leave say 20% free space. You cannot simply
erase an ISO you no longer want and copy over a new one, you have to start
from scratch by reformatting the USB stick. Flash drives are different
animals than magnetic storage media (traditional hard drives).

Limitation / Caveat (3) - I made my first original and now template USB
using a tool in a Windows XP Pro virtual machine. You only need to do this
once since once you have the MBR (master boot record) of the USB stick set
up, you can easily clone it using dd. I am happy to provide the image file
to anyone who wants it so you can avoid going the through the hoops I did
to create your template stick.

Limitation / Caveat (4) - In terms of BIOS, I stopped at Windows 7 meaning
I do not nor have I ever experimented with UEFI. In other words, I have no
idea if you can use this Grub for DOS solution on a system with UEFI.

Caveat (5) Drive assignment - I believe this is more a concern when dealing
with Windows than Linux since Linux provides much more control. The first
drive (i.e. sda) is often assigned to the USB stick and the second (i.e.
sdb) is assigned to the first hard drive in the system on which you are
booting. This can and should be reversed using some mapping commands in the
boot code in the menu.lst file. If you don't do this you can experience
problems when trying to repair a Windows system since the Windows repair
software doesn't check. The best example of how this can go wrong is, on
more than one occasion, I wiped out the MBR on the USB Grub for DOS stick
instead of on the SSD I was trying to repair. An example of the drive
mapping code I refer to is as follows:

title Windows 7 DVD ISO on this USB Stick
find --set-root /Windows_7_64.iso
map (hd0) (hd1)
map (hd1) (hd0)
map /Windows_7_64.iso (hd32)
map --hook
root (hd32)
chainloader (hd32)

There is probably a fair bit of dated information on the internet about
this solution. I have not looked in quite a while though.

Once again, I am happy to provide the image file for a Grub for DOS
template to save people from trying to create it from scratch. If anyone is
interested, let me know and I will post it on a public Dropbox link.


On Tue, Sep 29, 2015 at 1:39 PM, William Park <opengeometry at yahoo.ca> wrote:

> I'm replying via Yahoo web, so sorry about formatting... text option is
> nowhere to be found.
>
> A solution that almost worked is "memdisk" from Syslinux.  Essentially,
> you configure the usual "syslinux.cfg", but your kernel is "memdisk" and
> your initrd is the ISO image you want.  I say "almost worked", because
>     - it boots the ISO you want -- you see dots filling up the screen
>     - ISO boots -- you see its boot splash
>     - then, it complains that it can't find the live filesystem that it
> just loaded.
>
> All other solutions I tried or read about, extracts ISO and puts the
> content into partition.  That's not what I want.  Also, you forget which
> partition is what OS, and end up putting new release ISO into wrong
> partition.
> I want to keep the downloaded ISO as is.
>
> Old ISO designed for pure CD/DVD will not boot off USB, because it doesn't
> have harddisk emulation layer.  You can tell by 'fdisk -l'.  If it shows
> partition, then it has harddisk emulation.  You can turn those old ISO into
> bootable ISO using 'isohybrid', but this modifies the ISO file.
>
> Nowdays, all Linux/Windows ISO can boot off USB.  You can even install
> Windows onto USB stick and boot off it, but few things doesn't work, like
> "Windows Update". :-)
>
> Still looking...  Heck, time I spent on this, it would be cheaper to just
> buy a pack of USB sticks.
> --
> William
>
> On Tuesday, September 29, 2015 9:42 AM, D. Hugh Redelmeier <
> hugh at mimosa.com> wrote:
>
>
> | And the dd of one ISO also only works in the case that it is actually
> | and image capable of working from USB instead of a CD/DVD, which is
> | certainly true for many these days but is also not generic.
>
> I have found that creating bootable USB sticks from dd-ing .iso files
> to work very well for those distros that intend it.
>
> This mechanism doesn't allow you to store other goodies on the stick.
>
> I would like to have a convenient place to store my customization
> data: some packages I always install, some updates to avoid repeated
> fetching from the internet, some public keys, etc.  Only the
> unetbootin-like processes seem to support this.
>
>
> ---
> Talk Mailing List
> talk at gtalug.org
> http://gtalug.org/mailman/listinfo/talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20151001/84c725d8/attachment.html>


More information about the talk mailing list