Jump to content











Photo
- - - - -

Booting XP setup from an 8Gb flash drive - questions


  • Please log in to reply
9 replies to this topic

#1 Legoman

Legoman
  • Members
  • 5 posts
  •  
    United Kingdom

Posted 24 May 2008 - 04:22 PM

Hi all,

I've spent this morning getting an 8Gb Flash drive booting XP boot.ini using a combination of HP USB Disk Storage Format Tool, Ranish Partition Manager and bootsect.exe ;)

My aim is to use the USB_Multiboot script for text mode setup of Windows XP.

It was an interesting experience and I have a few questions for the forum:

Does it matter what type of IPL is in the MBR to boot a USB stick? The IPL appears to be an HP modified version of a standard MS-DOS IPL.

Does the partition have to start at CHS 0,1,1? I understand that LBA sector 63 defines a USB-HDD and LBA sector 32 defines a USB-ZIP (removable?). Is this used by the BIOS or the OS?

Does the partition have to occupy the entire USB stick? In order to have a FAT16X (type 0E) partition I created a 1.9Gb partition. Over 6Gb is unallocated space.

In the boot.ini file I have set rdisk(1) in the ARC paths. What does this do? Does it tell the PC that the disk/partition is on a different bus (i.e. USB)?

Does the disk number in the bootsector at offset 0x24h have to be 0x80h (128)?

I'd be very grateful if anyone has any comments or answers.

Thank you.

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 24 May 2008 - 05:22 PM

Hmmm, ;), lots of questions!

Let's see:

Does it matter what type of IPL is in the MBR to boot a USB stick? The IPL appears to be an HP modified version of a standard MS-DOS IPL.

No. It does not matter theoretically, the HP utility uses a W2K/XP MBR, modified to skip some checks, probably for a wider compatibility with some mothernoard BIOS.
Read this:
http://www.boot-land...?showtopic=2246
http://www.boot-land...opic=2246&st=15

And this:
http://www.boot-land...?showtopic=4476
(Vista and bitlocker may be a "special" case)

Does the partition have to start at CHS 0,1,1? I understand that LBA sector 63 defines a USB-HDD and LBA sector 32 defines a USB-ZIP (removable?). Is this used by the BIOS or the OS?

Not really, it depends on the geometry of the drive as the BIOS "senses" it or if you prefer as the controller on the USB device reports it.
Read this:
http://home.graffiti...B/USBstick.html
You can have a bootsector as 0/0/32. :thumbup:

On some Operating Systems, (usually old DOS versions), not respecting "cylinder/head boundaries" may cause problems:
http://en.wikipedia....der-head-sector

some utilities (Partition Magic for example) won't like it as well:
http://www.911cd.net...showtopic=21186
even if it is harmless on most current OS's and filesystems in NORMAL operation, it is not recommended to have partitions END on a non-boundary, (this would likely cause overlapping partitions, expecially if resizing them) but experience with first partition starting at a non-head boundary never caused a problem to me with any OS I tried.

If geometry is reported as nx255x63 , as most (read almost ALL) BIOS and devices will do, or if it is sensed as nx128x63 or nx16x63, 0/1/1 is LBA 63, if the device is "sensed" as nx64x32, as for example Qemu does for some smallish hard disk images, 0/1/1 will be LBA 32.

If you use a LBA format (partition ID 0C,0E or 07), the CHS information should be totally ignored.
http://www.win.tue.n...on_types-1.html

Read this also:
http://www.boot-land...?showtopic=4488
AND links therein, where you will find more details about the "particularity" of ZIP drives, here also:
http://www.win.tue.n.../zip/zip-1.html

And, if you are familiar with batch language, have a look at this too:
http://www.boot-land...?showtopic=4488

And to this:
http://www.911cd.net...showtopic=20089
(which you can use directly to "automagically" do what you did manually)


Does the partition have to occupy the entire USB stick? In order to have a FAT16X (type 0E) partition I created a 1.9Gb partition. Over 6Gb is unallocated space.

No, if you use a "limited in size" filesystem, you'll have unused space, but nothing prevents you from having mutiple partitions on the device, though you will need (to access them all from 2K/XP/2003), to either find the "manufacturer tool" to flip the "removable" bit or use a filter driver, read this:
http://www.boot-land...?showtopic=4560

In the boot.ini file I have set rdisk(1) in the ARC paths. What does this do? Does it tell the PC that the disk/partition is on a different bus (i.e. USB)?

No "racism" about different buses, just the number of the disk, the one you boot from is always first drive (or disk 0)
Arcpath syntax, read here:
http://www.msfn.org/...-...0.html&st=2
http://www.msfn.org/...f...5.html&st=2

Does the disk number in the bootsector at offset 0x24h have to be 0x80h (128)?

Yes, this is not negotiable. :thumbup:

But if you want to boot from a non-80 in the bootsector partition, you could well use a workaround like directly chainloading system file or loader through grub4dos.
Browse a bit in the grub4dos section of the forum, you'll find several interesting links/ways, ideas:
http://www.boot-land...s/?showforum=66

and here is a more general guide:
http://www.911cd.net...showtopic=18846


I guess you have some homework to do now, :thumbup: but you actually ASKED for it! :thumbup:


jaclaz

#3 Legoman

Legoman
  • Members
  • 5 posts
  •  
    United Kingdom

Posted 24 May 2008 - 07:03 PM

And to this:
http://www.911cd.net...showtopic=20089
(which you can use directly to "automagically" do what you did manually)

I do intend to use that to put the XP setup files into the partition on the stick but I couldn't see how it would create the partition.

PeToUSB wouldn't format the stick because it was over 2Gb in size.

I didn't want to format the entire space with a FAT32X partition because I understand that this is very slow when installing XP from USB.

Ranish Partition Manager flipped when it saw the superfloppy bootsector in place of the MBR (came up with a weird error box) so I couldn't use that.

The HP tool did create a FAT32 partition occupying the entire space and wrote an MBR to the stick.

RPM then "saw" the stick as a hard disk and I was able to delete the FAT32 partition, create a 1.9Gb FAT16X partition and format it. After that I used bootsect.exe to write an NTLDR bootsector into the partition.

Unfortunately, when I formatted the partition my two existing hard drives were also visible to RPM so it set the drive number in the bootsector to 130 (0x82h). This caused a few issues when i tried to boot the USB stick ;)

Only when I realised this did I hexedit the boot sector to change offset 0x24h to 0x80h! Hence, my query regarding this :thumbup:


No, if you use a "limited in size" filesystem, you'll have unused space, but nothing prevents you from having mutiple partitions on the device, though you will need (to access them all from 2K/XP/2003), to either find the "manufacturer tool" to flip the "removable" bit or use a filter driver, read this:
http://www.boot-land...?showtopic=4560

http://www.boot-land...?...ost&p=34730 is a great explanation of the different "modes" that USB sticks can be in. That's increased my understanding. Thanks.


To further the discussion I'd like to use RPM as the IPL in the MBR on the USB stick and then switch different partitions in and out of the partition table as needed. Can you see any reason not do this?


I guess you have some homework to do now, :thumbup: but you actually ASKED for it! :thumbup:

Indeed I did :thumbup:

#4 windrv

windrv

    Member

  • Developer
  • 86 posts
  •  
    China

Posted 25 May 2008 - 02:38 AM

Why take all those troubles?

Just put in your usb stick and run up Diskless Angel to partition it and then disable and remove the usb stick and re-insert it.

If you want to have ntfs format, just run up My Computer to do re-formatting.

Then use grubinst_gui.exe to put the mbr to the usb stick, you could specify what bootfile you want to use by the mbr code put to your usb stick.

#5 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 25 May 2008 - 10:53 AM

I personally am against writing anything to the the hidden sectors of a disk. (1-62) (like having grub4dos grldr.mbr installed) as there are several utilities (unfortunately widely in use) that won't interpreter correctly data in those sectors or will overwrite them.

But there is NO chance of using anything but grub4dos as it's features are by far superior to any other bootmanager/bootloader.

The "easy" solution I found is simply to:
1) leave the MBR as is (2K/XP/2003) - or the HP utility modified one.
2) chainload grldr from NTLDR/BOOT.INI
3) if "passing through" NTLDR/BOOT.INI is inconvenient for any reason, change the name of the loader invoked in the bootsector:
http://www.boot-land...?showtopic=2362

Nothing against RPM, mind you, it's a very convenient app, that I actually love, but it's a DOS one, and needs rebooting to another OS or using a VM to be used.

Try Swissknife:
http://www.compuapps.../swissknife.htm

jaclaz

#6 Legoman

Legoman
  • Members
  • 5 posts
  •  
    United Kingdom

Posted 26 May 2008 - 10:41 AM

O.K., I'm continuing my adventure with this 8Gb UFD.

I've discovered that to get the flash drive to be recognised as a bootable USB-HDD one (and ONLY one) partition must exist in the MBR partition table and that partition must start at absolute sector 63 (logical head 1).

If the partition starts on a cylinder boundary (CHS 1,0,1) then the flash drive is recognised as removable.

If more than one partition exists in the partition table then the flash drive is recognised as removable.

If only one partition exists but doesn't start at sector 63 (CHS 0,1,1) then the flash drive is treated as removable.

I don't know whether this is a limitation of my BIOS or I'm just misunderstanding things.

It seems a bit limiting only to have a single partition on the flash drive. RPM would help as I could switch partitions in and out of the partition table but not if they all have to start at sector 63.

;)

#7 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 May 2008 - 11:07 AM

NO, either we are using different terms or you have a very peculiar motherboard BIOS.

BIOS does NOT care whether the stick is seen as "removable" or "fixed", nor does DOS.

The only thing the BIOS may "recognize" is whether the first sector is a MBR or a bootsector, i.e. "HD like" or "superfloppy".

2K, XP and 2003 will see the drive as "removable" REGARDLESS whether the MBR is there or not, if there is, it will see it as a "removable" "HD like" device (thus allowing access to one, and only one partition, First active), if there is no MBR, it will see it as "removable" "super-floppy" device, and this DEPENDS EXCLUSIVELY to the "fixed/removable" bit is set (or filtered by a filter driver).

I guess that what you really mean by this:

I've discovered that to get the flash drive to be recognised as a bootable USB-HDD one (and ONLY one) partition must exist in the MBR partition table and that partition must start at absolute sector 63 (logical head 1).

If the partition starts on a cylinder boundary (CHS 1,0,1) then the flash drive is recognised as removable.

If more than one partition exists in the partition table then the flash drive is recognised as removable.

If only one partition exists but doesn't start at sector 63 (CHS 0,1,1) then the flash drive is treated as removable.


Is:

I managed to boot off the USB stick only if one partition exists on the stick and starts at absolute sector 63.

I wasn't able to boot if the partition starts on a cylinder boundary (CHS 1,0,1)

I wasn't able to boot if more than one partition exists in the partition table.

I wasn't able to boot if only one partition exists but doesn't start at sector 63 (CHS 0,1,1)


Do the following:
1) re-create the stick formatting in the various ways you reported (working and not working)
2) save each MBR and partition(s) bootsector using an app like HDhacker:
http://dimio.altervista.org/eng/
giving them "understable" filenames, like:
test_01.MBR
test_01_part_01.bss
etc.
3) compress them to a .zip or .7z archive.
4) attach them to a post where you describe the steps you did for each set of files.

I'll have a look at them and maybe I will be able to help you.

jaclaz

#8 Legoman

Legoman
  • Members
  • 5 posts
  •  
    United Kingdom

Posted 26 May 2008 - 04:04 PM

I must have a very peculiar motherboard BIOS then ;)

The motherboard is an ASUS M2N32-WS Pro.

I've tried booting from the stick on a second PC and it works wherever the partition starts and when there are two partitions on the stick so I'm sure the process I am using is correct.

For the record:

1) Format entire stick using the HP USB Disk Storage Format Tool v2.0.6 (GUI) with a FAT32 partition
2) Use RPM to delete the FAT32 partition then create a 1.9Gb FAT16X partition starting at sector 63
3) Use bootsect to write an NTLDR bootsector to the partition
The IPL in the MBR remains unchanged


I note that both PeToUSB and the HP utility both start their partitions at sector 63 (CHS 0,1,1) and only create a single partition. I wonder whether this is for enhanced compatability with picky motherboards like mine?

I don't doubt that this restriction is not enforced on other motherboards; indeed I have proved that on my second PC. However, it appears that some BIOSs will only recognise a USB stick as a USB-HDD if it is partitioned in a particular way.

#9 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 26 May 2008 - 08:22 PM

The only ones that does make some sense (though of course completely stupid ;)) is:
First partition must start at 0/1/1
as this is the normal way any DOS drive has been fdisked/formatted.

The BIOS should completely ignore the presence of other partitions.

(I assume as given that you already tried different BIOS settings on the ASUS)

What happens if you change the partition ID of second and subsequent partitions to a "Hidden" one?

I would also be curious to know if changing the partition type from 06 (CHS) to 0E (LBA) makes any difference.


jaclaz

#10 Legoman

Legoman
  • Members
  • 5 posts
  •  
    United Kingdom

Posted 28 May 2008 - 07:27 PM

I think that the BIOS may be treating the USB-HDD as a psuedo USB-FDD, hence the requirement to only have a single partition starting at absolute sector 63 (0,1,1).

The original (only) partition is LBA enabled (type 0E). I've tried setting a second partition to type 1E and type 16 (hidden) to no avail. It won't tolerate any more than one entry of any type in the partition table.

I'm not overly fussed as I can manually add/remove other entries to the partition table when using it on other PCs.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users