help-grub
[Top][All Lists]
Advanced

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

[no subject]


From: plmalternate plmalternate
Subject:
Date: Sun, 27 Apr 2014 08:57:25 -0400

Can anyone point me toward some approach that I might could hammer and
whittle into a bash-scriptable way of determining which partition grub
is looking in for stage 2 files (that is to say wherever it has to
look after getting everything it can out of the
before-the-first-partition area?

I used bootinfoscript from the ubuntu 14.04 repository but the only
relevant part of its output gives me:

"Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of
    the same hard drive for core.img. core.img is at this location and looks
    in partition 94 for ."

I only have 8 partitions, not 94 and that "for ." looks like some
variable didn't get set.  So I can't see any way to use that.

I also found in this old thread:
http://ubuntuforums.org/showthread.php?t=837791
this code:

sudo dd if=/dev/sda  bs=1 skip=1049 count=2 | hexdump

which was supposed to give an output that could be interpreted to give
the info I'm after but
the thread was about grub-legacy and the scheme for interpretation
given there didn't seem applicable to the output I got which was:

2+0 records in
2+0 records out
2 bytes (2 B) copied, 0.000104627 s, 19.1 kB/s
0000000 ffff
0000002

It won't do to look for /boot/grub because any or all OSs on any or
all partition could have once BEEN the partition with stage 2 files
but not be any more. Nor do I think it would do to simply look for
evidence of which OS was installed most recently and assume that is
the one
with stage 2 files because the most recent could have been installed
without reinstalling grub.

To reiterate, I'm not looking to find this information out for my
present rig, which is trivial. I looking for something I might could
work into a scriptable way to solve the general case.
Thanks for reading.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]