 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
OK, so I've been given a USB floppy drive with a disk in it containing
some BIOS utilities. Which works - after you enable booting from it in
the BIOS. But it's not exactly "fast".
My plan? To convert this into a bootable CD or maybe a USB drive. But how?
After much Googling, I discovered that there's an option to mkisofs
which makes it to El Torito floppy emulation. So I can basically take a
raw disk image of the floppy (which is only half full anyway) and make
an ISO-9660 CD image out of it.
So I booted up a VM running Debian Squeeze, and... mkisofs isn't a
recognised command? Seriously? OK, well maybe I just need to install it.
Er, no, the package manager claims to have no knowledge of any such
program. Wuh?! There /must/ be a way to install this, surely? Don't tell
me the mighty Debian doesn't support something as common as CD burning...
Well, Squeeze has /nothing/. But checking Lenny, I find a package that
at least /contains/ the binary. Except it isn't a binary, it's just a
symlink. The package documentation says "This is for compatibility only.
Please use genisofs instead."
OK, so for some reason they've renamed a standard Unix tool to another
name. But with identical functionality. Um, whatever. (Isn't this from
the guys who bought us Iceweasel, which is identical to Firefox?)
So, I ask genisofs to build me a CD image. First it complains that I
haven't added any files. Which is fair enough, I suppose. So I create an
empty folder, and tell it to use that. But now it complains that it
can't find the floppy image - even though it's /right there/!
Eventually I hunt through the manpage, and in the small print I discover
that the floppy image has to be /in/ the folder that you're making a CD
out of. (Presumably it shows up as a regular file on the disk, in
addition to being the boot code. Or something.) Once I moved the floppy
image, everything worked fine. And you know what? The CD boots and works
perfectly.
So now the guys from the USA can have their USB floppy drive back. I've
got a CD. ;-)
I wonder... would copying the CD image to a USB drive actually work? I
rather suspect not. I've never actually seen any PC boot from a flash
drive, ever - although I keep hearing that it's supposed to work...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Mon, 27 Feb 2012 13:35:22 +0000, Invisible wrote:
> I wonder... would copying the CD image to a USB drive actually work?
Yep. Use isohybrid to get it working.
I do this quite regularly with openSUSE ISO images in order to boot from
a USB flash drive instead. Installs are *much* quicker.
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 27/02/2012 16:53, Jim Henderson wrote:
> On Mon, 27 Feb 2012 13:35:22 +0000, Invisible wrote:
>
>> I wonder... would copying the CD image to a USB drive actually work?
>
> Yep. Use isohybrid to get it working.
>
> I do this quite regularly with openSUSE ISO images in order to boot from
> a USB flash drive instead. Installs are *much* quicker.
The seek time on a CD drive /is/ rather poor. I find that when I install
stuff onto a VM, using an ISO image on a networked file server, it runs
/way/ faster than if I really did put the physical CD into the local
machine's drive and run it without any VM overhead.
So, uh, anyway... Can I literally just do a block-level copy from the
ISO image to the flash drive? Or do I have to /do/ stuff to it first to
make it work?
Also, is there a quick way to test whether a particular PC even
/supports/ booting from flash? Like I say, I've never seen it actually
work IRL. Is there some easily available image I can test with?
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Mon, 27 Feb 2012 20:15:13 +0000, Orchid Win7 v1 wrote:
> So, uh, anyway... Can I literally just do a block-level copy from the
> ISO image to the flash drive? Or do I have to /do/ stuff to it first to
> make it work?
You have to use isohybrid to make it work. Try a google search as that
should tell you what it does and how to use it.
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/27/2012 6:35 AM, Invisible wrote:
> I wonder... would copying the CD image to a USB drive actually work? I
> rather suspect not. I've never actually seen any PC boot from a flash
> drive, ever - although I keep hearing that it's supposed to work...
Had to do precisely that to install a new copy of the Linux for the EePC
I installed a new, bigger, SSD drive into it. So, yeah, you can, but not
all of them can be formatted to be booted, and the BIOS needs to support
the ability to boot from USB devices.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/27/2012 3:01 PM, Jim Henderson wrote:
> On Mon, 27 Feb 2012 20:15:13 +0000, Orchid Win7 v1 wrote:
>
>> So, uh, anyway... Can I literally just do a block-level copy from the
>> ISO image to the flash drive? Or do I have to /do/ stuff to it first to
>> make it work?
>
> You have to use isohybrid to make it work. Try a google search as that
> should tell you what it does and how to use it.
>
> Jim
Or, just a search on, "make usb flash drive bootable". Pages and pages
of ways to do it, most of them Linux based, but some others.
Looking over one of those pages, you are actually doing:
1. Format
2. Partition
3. Copy over the needed files (or install to it, I supposed).
4. Make it bootable (presumably the same way you do an HDD, but marking
the partition as "live".
This makes it looks like a normal HDD to the system, as long as the
system recognizes USB as a boot option.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 28/02/2012 10:02 AM, Patrick Elliott wrote:
> Or, just a search on, "make usb flash drive bootable". Pages and pages
> of ways to do it, most of them Linux based, but some others.
Someone probably has a ready-made script to boot Linux from a flash
drive, probably using Grub. But I'm trying to boot MS-DOS. I imagine
that's going to be harder. (USB didn't /exist/ when MS-DOS was written,
after all...)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Tue, 28 Feb 2012 13:01:02 +0000, Invisible wrote:
> On 28/02/2012 10:02 AM, Patrick Elliott wrote:
>
>> Or, just a search on, "make usb flash drive bootable". Pages and pages
>> of ways to do it, most of them Linux based, but some others.
>
> Someone probably has a ready-made script to boot Linux from a flash
> drive, probably using Grub. But I'm trying to boot MS-DOS. I imagine
> that's going to be harder. (USB didn't /exist/ when MS-DOS was written,
> after all...)
Did you read the *isohybrid* info like I've suggested *twice* now?
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/28/2012 6:01 AM, Invisible wrote:
> On 28/02/2012 10:02 AM, Patrick Elliott wrote:
>
>> Or, just a search on, "make usb flash drive bootable". Pages and pages
>> of ways to do it, most of them Linux based, but some others.
>
> Someone probably has a ready-made script to boot Linux from a flash
> drive, probably using Grub. But I'm trying to boot MS-DOS. I imagine
> that's going to be harder. (USB didn't /exist/ when MS-DOS was written,
> after all...)
http://www.bootdisk.com/pendrive.htm
Gives a number of examples, some of which are "basically" what I said
before. But, no, its exactly the same process. As long as the stick has
been formatted, and set up, to be bootable, it doesn't care, any more
than the system does, that its a flash drive, instead of an HDD.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/27/2012 12:15, Orchid Win7 v1 wrote:
> So, uh, anyway... Can I literally just do a block-level copy from the ISO
Do *not* do a block-level copy to a USB stick if you ever want that stick to
ever work again.
--
Darren New, San Diego CA, USA (PST)
People tell me I am the counter-example.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Tue, 28 Feb 2012 19:02:19 -0800, Darren New wrote:
> On 2/27/2012 12:15, Orchid Win7 v1 wrote:
>> So, uh, anyway... Can I literally just do a block-level copy from the
>> ISO
>
> Do *not* do a block-level copy to a USB stick if you ever want that
> stick to ever work again.
Unless I'm misunderstanding what you mean by this, no, this isn't correct
- you can do:
dd if=/path/to/iso/dvd.iso of=/dev/sdg
And create a bootable USB flash drive if the iso is prepped with
isohybrid.
And when done, you can reformat the device very easily:
dd if=/dev/zero of=/dev/sdg
fdisk /dev/sdg
Piece of cake.
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 28/02/2012 05:14 PM, Jim Henderson wrote:
> Did you read the *isohybrid* info like I've suggested *twice* now?
Yeah, I did.
As best as I can tell, there's a thing called isolinux which lets you
boot Linux from a CD-ROM. And then isohybrid allows you to modify such
an image so it can be booted from any block device [that the BIOS
supports]. I'm not immediately seeing how this relates to booting
another OS.
I did, however, see several references which seem to suggest that just
grabbing a random Linux live CD and dumping it onto a flash drive will
probably work, so I might just try that to see if my BIOS even
/supports/ such a thing...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 29/02/2012 03:02 AM, Darren New wrote:
> On 2/27/2012 12:15, Orchid Win7 v1 wrote:
>> So, uh, anyway... Can I literally just do a block-level copy from the ISO
>
> Do *not* do a block-level copy to a USB stick if you ever want that
> stick to ever work again.
Any specific reason?
I mean, I gather it's fairly easy to utterly screw up the filesystem in
this way - but you can always just format the drive again. It's not hard.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 27/02/2012 01:35 PM, Invisible wrote:
> I wonder... would copying the CD image to a USB drive actually work? I
> rather suspect not. I've never actually seen any PC boot from a flash
> drive, ever - although I keep hearing that it's supposed to work...
OK, well... It turns out that writing my CD image to a flash drive
doesn't work at all. But if I write a Linux live CD image to it instead,
then it boots just fine. (At least, with the one PC that I tested with.)
Weird thing #1: For this to work, you have to write the image over the
top of the entire drive, not just one partition of it. Which is strange,
because I'm pretty sure that an ISO-9660 file system doesn't contain a
valid IBM BIOS partition table at the start.
Weird thing #2: Once you've done this, it boots just fine, but Windows
becomes awfully confused. It seems to see that only part of the drive is
partitioned, but it utterly refuses to allow you to repartition it. So
it is now impossible to use the whole capacity of the drive...
...from Windows. A quick trip to Linux land and it's a trivial operation
to edit the partition table and get your drive back. :-P
I did try booting Linux from the flash drive. It did seem a bit quicker,
but not that much. (Then again, I was testing with OpenSUSE, arguably
the slowest distro ever made.) I might actually make a habit of booting
Linux install disks in this way in future. As for my original CD... well
it's a damned site quicker than a floppy disk! :-P That's good enough
for me.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 29/02/2012 10:52 AM, Invisible wrote:
> Weird thing #1: For this to work, you have to write the image over the
> top of the entire drive, not just one partition of it. Which is strange,
> because I'm pretty sure that an ISO-9660 file system doesn't contain a
> valid IBM BIOS partition table at the start.
OK, so I did some digging. It turns out that for a Linux CD image to be
usable for booting from a flash drive, 1) it must use isolinux as the
boot loader, and 2) once the CD image has been created, you must run
isohybrid over it, which edits the file a bit.
But what exactly does isohybrid /do/ to the file that makes it work on a
USB flash drive?
Well, it turns out that isohybrid is just a Perl script. [That sound you
just heard was me being sick in the corner.] Since Perl only supports
textual manipulation, all of the "real" work must be being done by some
external tool. So if I can just find out what it is...
...oh dear God. You know what? It turns out you /can/ perform binary
manipulations in Perl. The world is not safe any more. >_<
So what does this script actually do? Well, since it's written in Perl,
I can only take guesses based on the comments in the source code. But it
/appears/ that it searches the ISO image to figure out where isolinux is
stored, and then it creates a valid IBM BIOS partition table at the
front of the CD image, and generates a boot block that runs isolinux.
Quite how it's possible to insert a partition table into a ISO-9660 file
system without breaking it, I'm not sure. But that appears to be what
the trick amounts to. I can imagine it being possible to modify a CD
image to make a bootable flash image. But I'm quite surprised that a
single image can simultaneously be both at once.
It /looks/ like it might even be possible to set up the partition table
so that the rest of the flash drive can be mounted read/write. (But that
presumably would stop the image working on a CD any more.)
In summary, being able to boot a CD image from a flash drive isn't
automatic; the image has to be specially set up with this in mind. (So
it might not work with /every/ Linux distro, for example.) In
particular, if I wanted /my/ CD image to boot this way, I'd have to
figure out how to make it boot with isolinux, and then configure it with
this cursed Perl script.
(Random fact: There's also a C translation of the same program. No, I
couldn't really read that either...)
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Le 2012-02-28 08:01, Invisible a écrit :
> On 28/02/2012 10:02 AM, Patrick Elliott wrote:
>
>> Or, just a search on, "make usb flash drive bootable". Pages and pages
>> of ways to do it, most of them Linux based, but some others.
>
> Someone probably has a ready-made script to boot Linux from a flash
> drive, probably using Grub. But I'm trying to boot MS-DOS. I imagine
> that's going to be harder. (USB didn't /exist/ when MS-DOS was written,
> after all...)
This should be extremely simple. MS-DOS talks to the BIOS, not the
hardware directly. If your BIOS can boot from USB, it'll provide the
necessary functionality to run MS-DOS from a USB device.
The problem is that MS-DOS only understands FAT8 and FAT16, so you'll
have to format your USB drive using those - which means using a thumb
drive of 2GB or less.
- Format your USB drive to make sure it is completely empty.
- Copy IO.SYS from a bootable MS-DOS diskette to the USB drive. FIRST.
As it has to be on sector 1.
- Copy MSDOS.SYS from the diskette to the USB drive.
- Copy COMMAND.COM from the diskette to the USB drive.
- ATTRIB +H +S *.SYS
- Voilà!
- You may now copy the rest of the DOS utilities to your USB drive.
Alternate way of doing it.
- Muck with your BIOS to make the USB drive look like C:
- Boot form the diskette
- FORMAT C: /S
- Tada!
- You may now copy the rest of the DOS utilities to your USB drive.
Note:
IO.SYS, MSDOS.SYS, COMMAND.COM, FORMAT.EXE and ATTRIB.EXE should to be
of the same vintage for best results.
DISCLAIMER: I haven't tried it, but it should work.
--
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/* flabreque */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/* @ */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/* gmail.com */}camera{orthographic location<6,1.25,-6>look_at a }
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 29 Feb 2012 08:57:41 +0000, Invisible wrote:
> On 28/02/2012 05:14 PM, Jim Henderson wrote:
>
>> Did you read the *isohybrid* info like I've suggested *twice* now?
>
> Yeah, I did.
So then you must've seen:
http://www.syslinux.org/wiki/index.php/
ISOLINUX#Can_I_boot_other_operating_systems_with_ISOLINUX.3F
Which explains exactly how to do what you're trying to do?
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/29/2012 1:58 AM, Invisible wrote:
> On 29/02/2012 03:02 AM, Darren New wrote:
>> On 2/27/2012 12:15, Orchid Win7 v1 wrote:
>>> So, uh, anyway... Can I literally just do a block-level copy from the
>>> ISO
>>
>> Do *not* do a block-level copy to a USB stick if you ever want that
>> stick to ever work again.
>
> Any specific reason?
>
> I mean, I gather it's fairly easy to utterly screw up the filesystem in
> this way - but you can always just format the drive again. It's not hard.
One issue may be that some are specially designed, including security
locking, and other secondary partitions, and they may simply stop
working at all, if things go missing that needs to be there. But, yeah,
would be kind of interesting to know why.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Wed, 29 Feb 2012 19:50:48 -0700, Patrick Elliott wrote:
> One issue may be that some are specially designed, including security
> locking, and other secondary partitions, and they may simply stop
> working at all, if things go missing that needs to be there.
Sure, but that's not what Darren's implication is - his implication is
that you should never, ever, under any circumstances do a block-level
copy to a USB device.
That's just flat incorrect, unless he means something different than I do
when he says "block level copy".
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>>> Did you read the *isohybrid* info like I've suggested *twice* now?
>>
>> Yeah, I did.
>
> So then you must've seen:
>
> http://www.syslinux.org/wiki/index.php/
> ISOLINUX#Can_I_boot_other_operating_systems_with_ISOLINUX.3F
>
> Which explains exactly how to do what you're trying to do?
I think "explains" would be exaggerating a bit... More like "vaguely
hints at what the necessary commands might perhaps be".
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Thu, 01 Mar 2012 20:13:01 +0000, Orchid Win7 v1 wrote:
> I think "explains" would be exaggerating a bit... More like "vaguely
> hints at what the necessary commands might perhaps be".
Well, the documentation does explain how the thing works - it doesn't
make sense (and no documentation ever does) to duplicate information for
every specific task being described.
Jim
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On 2/29/2012 0:58, Invisible wrote:
> Any specific reason?
I've occasionally done this, and it screws up the chip to the point where
it's no longer recognized as anything when you plug it in. Perhaps I was
using something that actually overwrote the control information, tho, and
perhaps the Linux block devices start the writing after that point. I'm not
sure why.
--
Darren New, San Diego CA, USA (PST)
People tell me I am the counter-example.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|
 |