From: Zhu Yi <yi.zhu@intel.com>
To: Robert Millan <rmh@aybabtu.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Backup old boot sectors before installation
Date: Mon, 28 Dec 2009 14:55:14 +0800 [thread overview]
Message-ID: <1261983314.6037.84.camel@debian> (raw)
In-Reply-To: <20091224212119.GI12122@thorin>
On Fri, 2009-12-25 at 05:21 +0800, Robert Millan wrote:
> I think making a backup is a fine idea, but I'd rather avoid the "option
> creep". It doesn't hurt to simply dump the files in /boot/grub/. If user
> later discovers that valuable data was overwritten, she can figure out
> how to call dd just as she can figure out the right parameters for
> grub-install.
OK. My only concern is the start position of grub core.img (as in disk
sectors) is a variable (see find_usable_region_xxx). This ends up the
backup file is not a simple dump. I used below format in my patch.
<512 bytes MBR> + <U64 start position> + <sizeof(core.img) old sectors>
Option 2 is to put the start position in a separated file.
Option 3 is to use the information in boot.img (as I used in my patch as
a verification method) to get the start position, i.e. `od -j92 -N8 -An
-td8 $grubdir/boot.img`.
Option 4 is to backup everything from MBR to the end of core.img
(including the holes in the middle). This ends up with a bigger image.
Option 1~3 requires the recover has the knowledge of the backup file
format somehow, but a simple dd is enough for option 4. What do you
think?
Thanks,
-yi
next prev parent reply other threads:[~2009-12-28 6:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-11 9:26 [PATCH] Backup old boot sectors before installation Zhu Yi
2009-12-11 9:39 ` Felix Zielcke
2009-12-11 22:23 ` Carles Pina i Estany
2009-12-14 2:48 ` Zhu Yi
2009-12-14 2:58 ` Isaac Dupree
2009-12-14 3:32 ` Zhu Yi
2009-12-14 2:59 ` kashyap garimella
2009-12-14 3:08 ` richardvoigt
2009-12-14 3:24 ` Isaac Dupree
2009-12-14 3:35 ` Zhu Yi
2009-12-14 3:52 ` Isaac Dupree
2009-12-14 3:15 ` Zhu Yi
2009-12-24 21:21 ` Robert Millan
2009-12-28 6:55 ` Zhu Yi [this message]
2009-12-28 22:04 ` Isaac Dupree
2009-12-29 3:21 ` Zhu Yi
2009-12-29 3:59 ` richardvoigt
2009-12-29 7:21 ` Zhu Yi
2010-01-07 19:15 ` rmh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261983314.6037.84.camel@debian \
--to=yi.zhu@intel.com \
--cc=grub-devel@gnu.org \
--cc=rmh@aybabtu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.