[prev in list] [next in list] [prev in thread] [next in thread] 

List:       grub-help
Subject:    RE: Help-grub Digest, Vol 18, Issue 12
From:       Jorge Canas <jcanas2000 () hotmail ! com>
Date:       2009-08-06 20:28:57
Message-ID: COL108-W26B2AE1AB92B40B57E004D90A0 () phx ! gbl
[Download RAW message or body]

Thanks for your responses.

For documentation purposes, I would like to add that I have indeed verified that \
dd'ing only the first 512 bytes of the hard drive (i.e. the MBR or LBA Sector 0) will \
NOT make the new hard drive a bootable drive, at least not in my setup.

The reason for that is that GRUB Legacy is writing some instructions to the next few \
sectors that follow the MBR.  I do not know if Grub Legacy does this on all setups or \
if just does this on those which have a "DOS compatible" partition table (see "--DOS" \
flag for sfdisk) like mine.

Thanks!

- Jorge



> I believe that grub records the location of the next stage within the
> initial boot loader code there.  You are correct in that it is safe to copy
> the MSDOS era boot loaders in that way; they search for a flag (boot/active)
> on a primary partition and chain a loader within that.
> 
> What you should do to recover from this is, using the recovery CD do the
> following:
> 
> Mount your root partitions somewhere
> mount -o bind /dev (/root/partition)/dev
> mount -o bind /sys (/root/partition)/sys
> mount -o bind /proc (/root/partition)/proc
> chroot (/root/partition) /bin/bash
> ( /bin/sh will likely also work, but you're probably used to bash in
> interactive mode )
> standard grub setup / reinstall commands for your distribution.
> 
> In my case I'd manually invoke the grub shell, usually with a specified
> device map file, and then
> http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html.
> 
> On Wed, Jul 29, 2009 at 7:39 AM, adrian15 <adrian15sgd@gmail.com> wrote:
> 
> > Jorge Canas escribió:
> > 
> > > If the first 446 bytes of the MBR can be reused, even if the harddrives
> > > are of different size, then can someone please throw me a bone and explain
> > > why cloning the MBR as described here does not produce a bootable harddrive?
> > > 
> > 
> > I think that you are talking about Grub legacy and I do not know if it is
> > currently supported in this mailing list.
> > 
> > Grub legacy uses something called stage1_5 which it is stored between MBR
> > end and the first partition beginning.
> > 
> > As long as you are not copying it the boot fails.
> > I do not know how to copy stage1_5 but it can be done.
> > 
> > Another workaround is to force grub not to link stage1 to stage1_5 which
> > can be done with install command manually or using the Super Grub Disk's
> > hacked's grub's setup command. But it is not recommended.
> > 
> > adrian15

_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®. 
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009



[Attachment #3 (text/html)]

<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Thanks for your responses.<br><br>For documentation purposes, I would like to add \
that I have indeed verified that dd'ing only the first 512 bytes of the hard drive \
(i.e. the MBR or LBA Sector 0) will NOT make the new hard drive a bootable drive, at \
least not in my setup.<br><br>The reason for that is that GRUB Legacy is writing some \
instructions to the next few sectors that follow the MBR.&nbsp; I do not know if Grub \
Legacy does this on all setups or if just does this on those which have a "DOS \
compatible" partition table (see "--DOS" flag for sfdisk) like \
mine.<br><br>Thanks!<br><br>- Jorge<br><br><br><br>&gt; I believe that grub records \
the location of the next stage within the<br>&gt; initial boot loader code there.  \
You are correct in that it is safe to copy<br>&gt; the MSDOS era boot loaders in that \
way; they search for a flag (boot/active)<br>&gt; on a primary partition and chain a \
loader within that.<br>&gt; <br>&gt; What you should do to recover from this is, \
using the recovery CD do the<br>&gt; following:<br>&gt; <br>&gt; Mount your root \
partitions somewhere<br>&gt; mount -o bind /dev (/root/partition)/dev<br>&gt; mount \
-o bind /sys (/root/partition)/sys<br>&gt; mount -o bind /proc \
(/root/partition)/proc<br>&gt; chroot (/root/partition) /bin/bash<br>&gt; ( /bin/sh \
will likely also work, but you're probably used to bash in<br>&gt; interactive mode \
)<br>&gt; standard grub setup / reinstall commands for your distribution.<br>&gt; \
<br>&gt; In my case I'd manually invoke the grub shell, usually with a \
specified<br>&gt; device map file, and then<br>&gt; \
http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html.<br>&gt; \
<br>&gt; On Wed, Jul 29, 2009 at 7:39 AM, adrian15 &lt;adrian15sgd@gmail.com&gt; \
wrote:<br>&gt; <br>&gt; &gt; Jorge Canas escribió:<br>&gt; &gt;<br>&gt; &gt;&gt; If \
the first 446 bytes of the MBR can be reused, even if the harddrives<br>&gt; &gt;&gt; \
are of different size, then can someone please throw me a bone and explain<br>&gt; \
&gt;&gt; why cloning the MBR as described here does not produce a bootable \
harddrive?<br>&gt; &gt;&gt;<br>&gt; &gt;<br>&gt; &gt; I think that you are talking \
about Grub legacy and I do not know if it is<br>&gt; &gt; currently supported in this \
mailing list.<br>&gt; &gt;<br>&gt; &gt; Grub legacy uses something called stage1_5 \
which it is stored between MBR<br>&gt; &gt; end and the first partition \
beginning.<br>&gt; &gt;<br>&gt; &gt; As long as you are not copying it the boot \
fails.<br>&gt; &gt; I do not know how to copy stage1_5 but it can be done.<br>&gt; \
&gt;<br>&gt; &gt; Another workaround is to force grub not to link stage1 to stage1_5 \
which<br>&gt; &gt; can be done with install command manually or using the Super Grub \
Disk's<br>&gt; &gt; hacked's grub's setup command. But it is not recommended.<br>&gt; \
&gt;<br>&gt; &gt; adrian15<br><br /><hr />Express your personality in color! Preview \
and select themes for Hotmail®.  <a \
href='http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009' \
target='_new'>Try it now.</a></body> </html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic