I am trying to figure out why the savedefault cmd with the once option is rendering my machine unbootable. Here is what I do first:

$GRUB_SHELL --batch --device-map=$GRUB_DIR/device.map <<EOF >> $GRUB_LOGF
root (hd0,2)
setup --stage2=$GRUB_DIR/stage2 --prefix=$GRUB_DIR (hd0)
quit
EOF

I omitted some steps (such as 'grub-install --just-copy') but basically this successfully installs onto all 4 HDDs. (hd0,2) is the / partition and is a RAID1. $GRUB_DIR is /boot/grub which is on the / partition mentioned above. grub.conf is setup to boot entry 4 by default and menu.lst is linked to grub.conf. I don't think the contents of these files is bad because the system boots into the grub menu with entry 4 highlighted no problem and can boot into any image selected.

If, however, I issue the following command after the above install batch command:

$GRUB_SHELL --batch --device-map=$GRUB_DIR/device.map <<EOF >> $GRUB_LOGF
root (hd0,2)
savedefault --stage2=$GRUB_DIR/stage2 --default=0 --once
quit
EOF

My machine hangs at the subsequent boot after the loading stage2 message.

device.map looks like this:
# leading comment
(hd0) /dev/hda
(hd1) /dev/hdb
(hd2) /dev/hdc
(hd3) /dev/hdd

In trying to figure out what happened by running the savedefault cmd I looked at the stage1 sector and mapped it to the byte offsets in the grub documentation. Viewed with 'hexdump -x', here is the boot sector:

offset value
------ ------
3e 0203
40 00
41 80
42 8000
44 4b4c 0003
48 eafa 7c50
1fe aa55

I tried to find stage2 using 'dd if=/dev/hda seek=<different variations of the value (in decimal) found at offset 44>' and viewing it with hexdump but I must be missing something because I wasn't seeing anything.

My questions:

-how to find stage2 on disk so I can verify that the saved entry byte is the only thing that changes when I do the savedefault?

-what am I doing wrong with the savedefault command (with the --once option) that is causing it to fail boot after running it?

I can supply more details if needed...

thanks!
Brett



_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to