Re: restoring MBR
On Sun, 2011-07-31 at 17:30 +0200, Camaleón wrote:
> On Sun, 31 Jul 2011 17:19:31 +0200, Tomas Kral wrote:
> > On Sun, 2011-07-31 at 14:06 +0200, Camaleón wrote:
> >> On Sun, 31 Jul 2011 20:14:17 +1000, Andrew McGlashan wrote:
> >> > On Sat, July 30, 2011 6:40 am, Camaleón wrote:
> >> >>>>> One of my (home made) overnight cron jobs does this:
> >> >>>>>
> >> >>>>> dd if=/dev/sda \
> >> >>>>> of=$DST/mbr_backup.bin \
> >> >>>>> bs=512 \
> >> >>>>> count=1 >> $LOG 2>&1
> >> >
> >> > Okay, well this script isn't perfect and it sure won't help after the
> >> > problem, but it will save all possible MBRs and fdisk output for a
> >> > bunch of candidate disks:
> >> (...)
> >> This should be done _at install time_ when things can badly break. Once
> >> you've lost your MBR making a backup of the _wrong_ MBR is of course
> >> useless.
> > Not sure if I am quite in the subject.
> > But in the old Potato days, the installer always asked to stick in a
> > floppy disk to write a new MBR on it. Leaving hard drive untouched.
> Sure. The expert installer has the option to do not install any
> bootloader or to install it on a partition instead MBR. Not sure what
> happened to the OP but it seems that finally the MBR was replaced somehow.
> > Just in case something went wrong with the newly installed system, user
> > could always boot back in the old system, just by removing the floppy
> > from the drive.
> > Also, there used to be command grub-floppy.
> Yes, there are many options available. For instance, I removed my
> notebook hard disk when I installed wheezy on external USB disk... just
> in case ;-)
> But regardless the option the user select at install time (do not install
> any bootloader, install it in a partition or another place or just
> putting it into MBR), it would be nice the installer makes a copy of the
> original MBR and leaves it under "/boot".
Good thinking, I just found
tcat@lynx:~$ /usr/sbin/grub-floppy --help
This program is broken, unsupported upstream, and has been deprecated in
favour of grub-mkrescue (grub-pc package)
grub-mkrescue looks like a new tool to create a rescue image
I have no experience with it so far, not sure if this one is present at
install time, and if it makes sense at all
Also my Squeeze CD-ROM has got option boot-rescue, I can only guess user
can do MBR maintenance there
Since Potato (my first Debian installation), I keep two installations on
my system, stable / testing, I boot into testing from Stable using grub.
When testing becomes stable enough I upgrade it to stable, and after a
while old stable gives room to a new testing.
It works good for me, I can always look back and see what setup I had
before, and what I might have been missing in the new system.
This requires more partions of HD.
/boot is a separate partition on my system, it has kernel images there
Also in Patato and later I had to have custom kernels under /boot there
because my hardware was experimental at that time and not all drivers
were present in default flavour
I still remember flavours (Vanilla, IDE, Laptop, etc.)
Now everything seems single monolithic kernels by platform focus point
In the process I have always rescue CDs, used to be rescue floppies
though, now possibly becoming rescue USBs :=)
Tomas Kral <email@example.com>