Jump to content

Manually boot a USB stick (boot files)


Cixert

Recommended Posts

Manually boot a USB stick (boot files)

I am trying to boot a USB stick by manually dropping the Windows files and I can't.
On a normal hard drive, I would create a primary partition, mark it as active, and just copy the Windows startup files to boot.
For NT 5.x (2000-XP-2003) I would put:
AUTOEXEC.BAT
boot.ini
Bootfont.bin
CONFIG.SYS
IO.SYS
MSDOS.SYS
NTBOOTDD.SYS
NTDETECT.COM
ntldr

And with this the hard disk starts, however, transferred to a stick this does not work.
Although I read in several tutorials that the process is the same, or not?

Some of these tutorials mention that you also have to transfer the boot files from a CD or DVD and others do not mention it.
The issue of making a CD or DVD bootable is something that has eluded me for years, I don't know if this same system has to be transferred to a USB stick.
Do USB sticks lack MBR?

I'm not interested in using Rufus-like programs, although I've tried them too. With Linux they have worked correctly for me, but not in Windows. I have tried to boot a version of  Windows Seven Lite that comes with the .RAR format on a USB stick using these programs and they do not work for me.
I don't know how the Windows NT 6 and 10 boot files work, I don't know if I could make these systems bootable manually by copying and pasting files like on NT 5, I would like that...

Link to comment
Share on other sites


USB sticks can be seen EITHER as "fixed" (very few) or "removable" (most), at least on XP/Vista/7.

Windows won't put a MBR on "removable" sticks, or if you prefer, "removable" USB sticks are NOT partitioned, they are normally "super-floppies", i.e. their first sector is a PBR and not a MBR.

There are several different approaches to have the MBR on a removable stick, mainly:
1) write manually a MBR and partition table to it[1]
2) add a driver to the running Windows install that can make the stick be seen a "fixed"
3) use the stick "Manufacturer's tools" to "flip" the removable bit
4) make an image of the stick, mount it in a virtual drive, partition/format it, then dd it back to the stick

Then there may be some issues with the BIOS of the specific machine, some *need* a second (minimal, hidden) partition to see the stick as "fixed" at boot time. 

Then the booting sequence remains the same:
BIOS->MBR->PBR of active partition->bootloader or system file (i.e. IO.SYS or NTLDR or BOOTMGR)->OS

Of course either BOOT.INI or /boot/BCD need to have correct settings.

Choose among 1-4 above and I will point you to the details/tools needed, though the easiest would still remain uing one of the several partitioning/formatting tools that we have now available, namely I would recommend you RMPREPUSB.

jaclaz

 

[1] once there is a pre-written MBR and partition table on the stick, Disk Manager will allow formatting of the partition/volume in it BUT (if there are more than a single volume on a "removable" stick, only one will be mounted and assigned a drive letter)

 

Link to comment
Share on other sites

On 12/3/2020 at 10:39 AM, jaclaz said:

USB sticks can be seen EITHER as "fixed" (very few) or "removable" (most), at least on XP/Vista/7.

Windows won't put a MBR on "removable" sticks, or if you prefer, "removable" USB sticks are NOT partitioned, they are normally "super-floppies", i.e. their first sector is a PBR and not a MBR.

There are several different approaches to have the MBR on a removable stick, mainly:
1) write manually a MBR and partition table to it[1]
2) add a driver to the running Windows install that can make the stick be seen a "fixed"
3) use the stick "Manufacturer's tools" to "flip" the removable bit
4) make an image of the stick, mount it in a virtual drive, partition/format it, then dd it back to the stick

Then there may be some issues with the BIOS of the specific machine, some *need* a second (minimal, hidden) partition to see the stick as "fixed" at boot time. 

Then the booting sequence remains the same:
BIOS->MBR->PBR of active partition->bootloader or system file (i.e. IO.SYS or NTLDR or BOOTMGR)->OS

Of course either BOOT.INI or /boot/BCD need to have correct settings.

Choose among 1-4 above and I will point you to the details/tools needed, though the easiest would still remain uing one of the several partitioning/formatting tools that we have now available, namely I would recommend you RMPREPUSB.

jaclaz

 

[1] once there is a pre-written MBR and partition table on the stick, Disk Manager will allow formatting of the partition/volume in it BUT (if there are more than a single volume on a "removable" stick, only one will be mounted and assigned a drive letter)

 

Thanks for the explanation.
I'm going to try option 1.
1) write manually a MBR and partition table to it [1]
I would like to know how the MBR knows that it has to start a specific file on the hard disk partition.
Yes, I mark the active partition from Windows or a partitions program like Mini-Tools Partition Wizard.
But how does the MBR know to start NTLDR for Windows NT 5 and BOOTMGR for Windows NT 6?
It is something that I cannot understand, since just by marking the active partition and pasting NTLDR (among others) Windows 2000 and XP start up on a traditional hard drive without having to install them (I don't know if this also works with Windows Vista or later).

Edited by Cixert
Link to comment
Share on other sites

The MBR doesn't know that, the PBR does.

ALL the MBR code does (a "normal", "standard"  MBR) is:
1) check if in the partition table a primary partition table is defined AND it is marked active
2) chainload the first sector of that partition (the PBR or bootsector[1])

Then the PBR code invokes (chainloads) the OS file (like io.sys for DOS) or the bootmanager/bootloader (like NTLDR or BOOTMGR) which filename is embedded in it.

In Vista (and later) there is a program, bootsect.exe that with the options /NT52 or /NT60 changes the bootsector code to invoke either NTLDR or BOOTMGR, the booting mechanism remains exactly the same.

Within limits (same length), you can even hexedit the string with the name of the file in the bootsector, as an example it is possible (though NOT advised) to change "NTLDR" to "GRLDR" to have the /NT52 boosector invoke the grub4dos grldr file.

If you prefer, the normal boot sequence (BIOS) is:

BIOS->MBR->PBR of primary, active partition->*whatever* the PBR invokes

jaclaz

 

 

[1] even if technically in NTFS the bootsector is actually 16 sectors long (or in FAT32 usually 3 sectors long) or - more properly - the boot code is multi-sector - the MBR only chainloads the first sector and the code in it loads the "rest of itself". 

Edited by jaclaz
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...