I have always managed to create bootable linux usb devices using only dd. But when it comes to Windows, the computer fails to boot from USB .. - I don't know why it doesn't work that way, but the most important is: Why it is required to write the MBR into the device in order to get Windows boot properly?
- 129
3 Answers
MBR is only required if the boot firmware is either BIOS or in a BIOS compatibility mode. If the firmware is in full UEFI mode without compatibility support then Windows will expect the boot disk to be partitioned as GPT.
Windows boot support for disk partitions can be found at Windows support for hard disks that are larger than 2 TB
System BIOS + MBR UEFI + GPT BIOS + GPT UEFI + MBR
Windows 7 Supported Supported; (64-bit only) Boot volume not supported Boot volume not supported
Windows Vist Supported Supported; (64-bit only) Boot volume not supported Boot volume not supported
Windows XP Supported Not supported Boot volume not supported Boot volume not supported
- 95,412
Your premise is incorrect. Not all Linux distros can boot just by dd the image to the flash drive. For example in old Ubuntu versions you have to use a tool to create Ubuntu install/live USB drive. In Ubuntu 5.x or 6.x you even have to use separate CDs for live session and for installation.
Most Linux distros nowadays use hybrid ISOs so that you can just write the whole ISO into the disk and it'll work. However that doesn't mean all Linux distros support that. Knoppix has just changed to hybrid ISO in the lastest version (8.1)
What is a Hybrid Image?
We are used to downloading ISO images from Ubuntu mirrors whenever a new release comes out. At the same time when these images can be burnt directly to a CD-ROM disc, for creating a startup installation USB, one needs to use specific USB creation tools like 'Startup Disk Creator' (included by default in Ubuntu), 'UNetbootin', etc. With hybrid images, you can simply write the data -including the filesystem- of the image to a USB drive by using the 'dd' command. Notice that just copying its content, after mounting it, won't work, as it wouldn't copy the MBR and the partition table, as well as additional sectors at the end of the image.
A normal ISO will have all zeros at the beginning. A hybrid ISO will contain an MBR at the beginning so that the BIOS will think that's a valid boot sector and load it
Hybrid Setup for BIOS and EFI from CD/DVD and USB stick
The EL Torito Boot Catalog can offer in the same ISO filesystem alternative boot images for PC-BIOS and for EFI.
But El Torito is interpreted by the firmware only if presented on an optical medium: CD, DVD, BD. For booting PC-BIOS and EFI from USB stick or other hard-disk-like devices, there is need for an MBR and, if desired, for a GPT.
http://wiki.osdev.org/El-Torito#Hybrid_Setup_for_BIOS_and_EFI_from_CD.2FDVD_and_USB_stick
Linux bootloaders support booting from either MBR and GPT in both BIOS and UEFI systems so there'll be no problem. However the USB flash drive won't be writable anymore in Windows because it's recognized as a CD or DVD drive. You need to clean the drive and recreate using MBR or GPT scheme like this. You still need tools to make bootable Linux pendrives if you want to use the drive for normal data storage as well as booting or if you want to live boot with persistent data.
OTOH Windows doesn't use a hybrid ISO and typically USB-installer makers will just copy the boot.wim, install.wim and other necessary files then flash Windows bootloader to the drive. As Windows bootloader requires GPT on UEFI systems and MBR on BIOS systems, if you're booting MBR flash drive on UEFI it won't work.
For more information:
- 30,396
- 15
- 136
- 260
Your premise is incorrect.
The MBR is always required if the PC has a BIOS.
If you managed to make a bootable disk or flash drive using dd, then you either used the existing MBR of that device, or the dd command wrote a fresh copy to the first sector.
The MBR installed in the first sector is required for every device that emulates a hard disk drive by the PC architecture and BIOS. This requirement is not related to any OS.
I have always managed to create bootable linux usb devices using only dd.
If you used dd to copy a hydrid ISO image to a USB flash drive, then there definitely is a MBR in that image.
Whereas if you tried to use an ordinary ISO image, that USB flash drive would not boot. See what is the difference between the usb booting mechanism and optical disk booting mechanism?
But when it comes to Windows, the computer fails to boot from USB ..
USB is a bus, not a device.
You need a device for booting.
Surely you would encounter a difference booting from a USB HDD or SDD versus a USB flash drive.
Why it is required to write the MBR into the device in order to get Windows boot properly?
Probably because, by default, Windows does not treat (or format) USB flash drives as equivalent to a hard drive. For a USB flash drive Windows writes a device boot sector that has no partition table, just like a floppy drive.
Linux, on the other hand, treats a USB flash drive just like a HDD, and always writes a MBR with a partition table.
When you claim that you "write the MBR into the device", no doubt you are using a Linux system instead of Windows.
ADDENDUM
As proof that Windows does not install a partition table for a USB flash drive, here's a hex dump of the first sector of a USB flash drive that was first "cleaned" with a dd if=/dev/zero of=/dev/sdb count=1, and then formated on a Win7 system using the default parameters.
Note that there is a text string where the partition table is supposed to be.
- 18,591