[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian images and USB sticks


> Does the method described in the manual (copying to /dev/sdX) work under
> UEFI? Or it's basically the same thing as copying to a partition?

The main difference is that copying to /dev/sdX overwrites the MBR and
the partition tables, while copying to /dev/sdXn keeps the partitioning
(and the other partitions' content) unchanged.

BIOS booting from MBR does not necessarily need a partition table.
(It's the parted MBR code which looks for a partition marked as bootable,
 not the BIOS firmware which simply starts the MBR code as x86 program.)

But UEFI wants to see a EFI System Partition announced by MBR or GPT.
By copying the Debian ISO image to a partition you do not create a new
EFI System Partition. By copying it to the base device, you give it
the partition tables which are stored in the ISO.

So if you put the Debian ISO into a partition, then for UEFI you'd
need to extract the content of the EFI System Partition from the ISO
and put it into a separate MBR partition of type 0xef.

Debian i386 and amd64 netinst ISOs have their EFI System Partition content
in file  /boot/grub/efi.img . In general you can ask a partition editor
to print the table

  $ /sbin/fdisk -lu debian-8.2.0-i386-netinst.iso
  Device                         Boot Start    End Sectors  Size Id Type
  debian-8.2.0-i386-netinst.iso1 *        0 645119  645120  315M  0 Empty
  debian-8.2.0-i386-netinst.iso2       4020   4659     640  320K ef EFI (FAT-12/16

and use dd to cut out the content of the partition with id "ef":

  dd if=debian-8.2.0-i386-netinst.iso bs=512 skip=4020 count=640 of=my_esp.img

The next problem might be that the starting system software normally
expects to wake up on /dev/srY or /dev/sdX, not on /dev/sdX1.
That's the realm of the debian-cd project. My scope ends when the
boot loader has started.
(It is the most interesting part of your adventure that the system
 boots from /dev/sdX1 via BIOS. There is some hope it will do for
 UEFI, too.)

Have a nice day :)


Reply to: