Skip to main content
8 events
when toggle format what by license comment
Apr 1, 2021 at 17:45 comment added Joshua An interesting technique is to make sectors 2-63 a partition and give it a type. (Like say Hidden FAT-12) Modern Windows doesn't allow scribbling on \\PHYSICALDRIVE0 to write inside a partition anymore; you have to use the partition's device.
Jun 12, 2020 at 13:48 history edited CommunityBot
Commonmark migration
Mar 8, 2018 at 20:33 vote accept sherrellbc
Feb 26, 2018 at 13:37 vote accept sherrellbc
Feb 26, 2018 at 13:37
Feb 24, 2018 at 19:48 comment added grawity_u1686 @sherrellbc: I believe some bootloaders (e.g. Lilo) would put stage 2 in a file, and then hardcode that file's LBA location in the MBR code. Perhaps risky but very widespread. (Didn't MSDOS have something like that?)
Feb 24, 2018 at 19:32 comment added sherrellbc Thanks for the link and quote. My investigation into this led to my finding that GRUB has its MBR and stage stages stored in the first sectors on disk (after the MBR but before the first partition), but I could not find references to this anywhere. This led me to wonder how it would compensate for the case where the user attempted to install into an existing system that did not have this "reserved" space. This quote shows that it requires it, unless the files are riskily stored in the filesystem. I also found that fdisk reserves the first 2048 sectors and cfdisk reserves the first 63.
Feb 24, 2018 at 19:29 comment added sherrellbc Well, sure. I did not intend to imply this was the only way to boot. It just used to be how it was done before GRUB attempted the whole "unified bootloader" thing. I can also verify that this is implemented in practice. I spent some time last week stepping through the GRUB code in QEMU. I extracted its three stages (Download from my post in this thread). I found that GRUB overwrote the MBR in the 0th sector and had its equivalent of the VBR in the 1st sector, and then its second stage in the 2nd sector.
Feb 24, 2018 at 18:59 history answered Kamil Maciorowski CC BY-SA 3.0