POV-Ray : Newsgroups : povray.off-topic : Today's quest Server Time
29 Jul 2024 10:28:58 EDT (-0400)
  Today's quest (Message 11 to 20 of 22)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>
From: Jim Henderson
Subject: Re: Today's quest
Date: 29 Feb 2012 01:48:22
Message: <4f4dca36@news.povray.org>
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

From: Invisible
Subject: Re: Today's quest
Date: 29 Feb 2012 03:57:15
Message: <4f4de86b@news.povray.org>
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

From: Invisible
Subject: Re: Today's quest
Date: 29 Feb 2012 03:58:32
Message: <4f4de8b8@news.povray.org>
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

From: Invisible
Subject: The next quest
Date: 29 Feb 2012 05:52:45
Message: <4f4e037d$1@news.povray.org>
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

From: Invisible
Subject: Re: The next quest
Date: 29 Feb 2012 06:24:50
Message: <4f4e0b02$1@news.povray.org>
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

From: Francois Labreque
Subject: Re: Today's quest
Date: 29 Feb 2012 09:00:45
Message: <4f4e2f8d$1@news.povray.org>
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

From: Jim Henderson
Subject: Re: Today's quest
Date: 29 Feb 2012 13:34:01
Message: <4f4e6f99$1@news.povray.org>
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

From: Patrick Elliott
Subject: Re: Today's quest
Date: 29 Feb 2012 21:50:54
Message: <4f4ee40e@news.povray.org>
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

From: Jim Henderson
Subject: Re: Today's quest
Date: 29 Feb 2012 22:10:40
Message: <4f4ee8b0$1@news.povray.org>
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

From: Orchid Win7 v1
Subject: Re: Today's quest
Date: 1 Mar 2012 15:13:04
Message: <4f4fd850$1@news.povray.org>
>>> 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

<<< Previous 10 Messages Goto Latest 10 Messages Next 2 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.