On Mon Feb 04, 2008 at 05:06:09AM -0600, Moshe Yudkowsky wrote: > Robin, thanks for the explanation. I have a further question. > > Robin Hill wrote: > >> Once the file system is mounted then hdX,Y maps according to the >> device.map file (which may actually bear no resemblance to the drive >> order at boot - I've had issues with this before). At boot time it maps >> to the BIOS boot order though, and (in my experience anyway) hd0 will >> always map to the drive the BIOS is booting from. > > At the time that I use grub to write to the MBR, hd2,1 is /dev/sdc1. > Therefore, I don't quite understand why this would not work: > > grub <<EOF > root(hd2,1) > setup(hd2) > EOF > > This would seem to be a command to have the MBR on hd2 written to use the > boot on hd2,1. It's valid when written. Are you saying that it's a command > for the MBR on /dev/sdc to find the data on (hd2,1), the location of which > might change at any time? That's... a very strange way to write the tool. > I thought it would be a command for the MBR on hd2 (sdc) to look at hd2,1 > (sdc1) to find its data, regardless of the boot order that caused sdc to be > the boot disk. > This is exactly what it does, yes - the hdX,Y are mapped by GRUB into BIOS disk interfaces (0x80 being the first, 0x81 the second and so on) and it writes (to hdc in this case) the instructions to look on the first partition of BIOS drive 0x82 (whichever drive that ends up being) for the rest of the bootloader. It is a bit of a strange way to work, but it's really the only way it _can_ work (and cover all circumstances). Unfortunately when you start playing with bootloaders you have to get down to the BIOS level, and things weren't written to make sense at that level (after all, when these standards were put in place everyone was booting from a single floppy disk system). If EFI becomes more standard then hopefully this will simplify but we're stuck with things as they are for now. Cheers, Robin -- ___ ( ' } | Robin Hill <robin@xxxxxxxxxxxxxxx> | / / ) | Little Jim says .... | // !! | "He fallen in de water !!" |
Attachment:
pgpMdKLJJGZp5.pgp
Description: PGP signature