[conspire] Help with GRUB

Rick Moen rick at linuxmafia.com
Thu Nov 5 16:26:55 PST 2009

Quoting Paul Zander (paulz at ieee.org):

> Thanks for detailed advise.  Some specific replies are below.

Hmm.  Well.  I'd like to take a moment to attempt some constructive
suggestions about how to do quoting in replies.  You're using:


...which, like GMail, has some rather horrible and antisocial defaults 
for reply semantics.  Here is a page (rather old; last updated 2003)
that might be of some help:  http://mailformat.dan.info/config/yahoo.html

You're probably not quite aware of how unfortunately difficult to parse
your replies are.  One suspects your Web-based editor is set for "rich
text", with proportional typefaces and all of that rot, paragraph-long
lines, and no concept of attribution and quotation prefixes for quoted
prior text.  What you want, for starters, is plain ASCII text, "screen
width" (line length) somewhere between 65 and 72 characters, and the
setting labelled "Include _part_ of the original message when replying".

This online exchange suggests that Yahoo _may_ have more recently 
made the above sorts of fixes to its reply behaviour impossible:

But these suggest it might be tame-able:

If you could please make an effort to implement the ideas on those 
pages, it would make your postings that quote prior messages a great
deal easier to understand.  The current example is a bit... unfortunate.

(Also, for some reason, you posted the same thing to the mailing list

> I'm still in the steep part of the learning curve on grub.   Knowing
> about "b" would have been a useful thing.

I really do recommend that you start with the two links I posted
immediately as recommended resources.  Here they are again:


You might also, for surrounding context and overview, want to read

> For openers, I was certainly confused. 
> Now I know that sda, sdb, etc are defined by the hardware connections.
> However hd0 does not always map to sda.

Er, how so?  To the best of my understanding, it should.  (Caveat:
Back in the days when Steve Litt wrote the troubleshooters.com article
cited above, it was common for then-prevalent cheap PATA aka "IDE"
chipsets to be driven by Linux's drivers/ide driver set, which 
used device nodes of the form /dev/hdXX.  In recent years, the
drivers/ide set has been almost entirely replaced by Jeff Garzik's
libata family, introduced primarily for then-new SATA chipsets.
Garzik's design leverages the kernel's SCSI layer, with the result 
that it uses /dev/sdXX device addressing.  So, the /dev/hdXX notation
referred to by Litt's article is now vanishingly rare on modern

To back up just a bit, it's important to remember that GRUB was/is a
project (GRand Unified Bootloader) launched with little-to-no connection
to the Linux kernel -- having been written for the GNU Project's HURD 
kernel.  So, it has its own, idiosyncratic device-node naming scheme.
It assigns "hd0" to the first mass-storage device, "hd1" to the second,
and so on.  Partitions are likewise numbered in zero-based fashion, with
quirks corresponding to that of the partitioning scheme.  E.g., the
first four _primary_ partitions on hd0 are hd0,0 hd0,1, hd0,2, hd0,3,
corresponding to /dev/sda1, /dev/sda2, dev/sda3/ dev/sda4  -- _but_ it's
quite common for the first partition that _exists_ on a drive to be a
"logical" partition, the first of which is hd0,4 aka (in Linux terms)

> At this point, I can get grub to boot debian from the hard drive by
> modifying menu.lst to read (hd2,4).  From the above, I now understand
> that there are possibly cleaner fixes to my work-around.   I will
> experiment with them.

Again, I would encourage you to _avoid_ fooling with the contents of
menu.lst until you have tested particular combinations of settings for
booting at the GRUB boot-time command line.  _Then_ you can safely
put those details into menu.lst, having validated them.

> What I know is that I took computer to have windows re-installed after
> it got some serious malware.  I told the installer it was OK to
> over-write the MBR.  

Aha.  _Now_ the other shoe drops.  I don't believe you mentioned that
fact until now, but I rather suspected it.  Just to clear up any
confusion, I should at this point correct a typo (or think-o, or
something) in my prior post:

>> One of the unanswered questions, IIRC, is what on Earth happened to
>> your system.  It seems reasonable to suppose that either there was
>> some substantive hardware change, e.g., insertion or removal of hard
>> drives, rejumpering, etc., or that you or some piece of hardware
>> operating on your behalf attempted to rewrite your bootloader setup
>> and got wrong the identification of filesystems.

I meant to say _software_, not hardware.

(By the way, one of the many reasons why you should view e-mail with
monospaced typefaces, which invariably is one of the things Web-based
mail readers get wrong by default, is so that you can correctly read and
write underlining and similar things, such as I use above.)

So, as I strongly suspected, "what on Earth happened to your system" was
an MS-Windows re-installation -- which, of course, overwrote your MBR,
which wiped out the first-stage GRUB bootloader that you had been
relying on being there to initiate the boot process.

> However I have not been able to get Windows to boot.  Most likely 
> that install was not correct.

I obviously have no way of knowing whether that is correct.  However, in
your shoes, I'd start out with the assumption that MS-Windows on
/dev/sda1 (what GRUB calls "hd0,0") is perfectly fine, and that all you
need to do is re-establish GRUB Stage 1 in the MBR, GRUB Stage 1.5 the
first 30 kilobytes of hard disk immediately following the MBR, and GRUB
Stage 2 in hd0,4 (/dev/sda5 in Linux terminology, i.e., your Linux root
filesystem) with instructions in menu.lst to do "chain loading" to 
start up Windows NT "OS Loader" (the Microsoft bootloader) in the
superblock of hd0,0 (/dev/sda1 in Linux terminology, i.e., your NTFS
partition for MS-Windows).

I really don't know a lot about that, because I don't run MS-Windows,
but the logical place to look, to see how this stuff's supposed to work,
is in your old menu.lst.  I sure hope you made a copy of that before you
started messing with it, by the way.  You may recall that I kept saying
please check your boot notions at the GRUB command line before altering
menu.lst.  There was a reason for that.

(Aside:  As an old-time user and fan of the dirt-simple lilo bootloader,
I find it hysterically funny how many people tout GRUB as "easier."
However, to be fair, the writing of GRUB Stages 1, 1.5, and 2 code
referred to above is transparent to the user, and gets carried out when
you either use the "setup" directive at the GRUB boot-time command line
or the grub-install command at the Linux root-user command line.)

FWIW, the grotesquely over-commented menu.lst provided by Debian

# examples
# title         Windows 95/98/NT/2000
# root          (hd0,0)
# makeactive
# chainloader   +1

All of the substantive contents of my server's menu.lst (slightly
simplified for presentation here) are:

default         0
timeout         5
color cyan/blue white/blue

title           Debian GNU/Linux
root            (hd0,0)
kernel          /vmlinuz root=/dev/sda7 ro 
initrd          /initrd.img

(Again, that machine boots only Linux.)

More information about the conspire mailing list