Re: Retaining windoze when replacing 9.0 with 9.1?

From: imotgm (imotgm_REMOVE_at_invalid-yahoo.com)
Date: 07/19/04


Date: Mon, 19 Jul 2004 10:55:10 GMT

On Sun, 18 Jul 2004 23:47:17 -0300, Shmuel (Seymour J.) Metz wrote:

 
> My concern is the MBR. Doesn't the SUSE install replace it, and
> squirel away the original contents so that GRUB can load windoze? What
> happens to the saved copy when I reinstall SUSE? If it helps, I have a
> separate partition for /boot.
>
> I have no intention of resizing the NT partition, or even looking at
> it; I just want to ensure that I don't break it more than m$ already
> has.

If grub has been working fine, up 'til now, leave it alone. When you do
the new install, don't erase the /grub directory on the boot partition,
let Suse overwrite the contents as it chooses, and install the new grub to
a floppy, instead of the MBR, leaving the old grub in the MBR intact, and
untouched. This will update the /grub/menu.lst as needed, with the correct
stanzas for the new kernel, but will leave the old MBR backup, as no
changes are made to the MBR, so no new backup is created. As all the new
files are in the same place as the old equivalent files were, grub won't
know the difference; Repeat, the original saved copy of the MBR, before
Linux, will be untouched.

I'm booting off of grub from Suse 8.0, which is long gone. I boot Mandrake
9.1, and 10.0, Suse 8.2, two copies, and 9.1, two copies, Slackware 9.1,
and 10.0, PCLOS on hard drive, Win98, and Win2K. I just removed Suse
7.2, and 8.1 and I'll be adding Libranet 2.8.1 in the next few days.

When I install a new OS, I never mount the boot partition, and install
grub to a floppy. Then, after booting from the floppy, I temporarily mount
the boot partition to /mnt/temp, and create a directory, ie
/mnt/temp/suse9.1 and copy the contents of the /boot directory into that.
Then I copy the boot stanza from the /boot/grub/menu.lst to the
/mnt/temp/grub/menu.lst, (the one used by grub, in the MBR) and add
/suse9.1 before /vmlinuz and /initrd in the stanza.

Below, are the stanzas for my two Suse9.1 installs, one on hda, and one
on hdg.

title Suse9.1 A
    kernel (hd0,0)/suse9.1-a/vmlinuz root=/dev/hda3 vga=0x31a splash=verbose desktop resume=/dev/hda2 showopts
    initrd (hd0,0)/suse9.1-a/initrd
    
title Suse9.1 G
    kernel (hd0,0)/suse9.1-e/vmlinuz root=/dev/hdg3 vga=0x31a splash=verbose desktop resume=/dev/hda2 showopts
    initrd (hd0,0)/suse9.1-e/initrd

This is to show the addition of the separate directories, as outlined
above. Even though they are both Suse 9.1, and could share a
common directory, I have given each their own, as I run different kernels
on each. You will note; I moved the second Suse9.1 from hde to hdg, but
did not change the name of the /suse9.1-e directory. As long as the root=
part of the stanza is correct, grub doesn't care what the name of the
directory is.

You, at this stage would not have to do this, as you are replacing one
install, with another, in the same partitions as the first. If you wish to
add another Linux OS, without removing the first, so that you are triple
booting, then the above would apply. In all cases, the grub in the MBR
remains the same, and only the /grub/menu.lst on the boot partition is
updated, with a new stanza.

You may wish to change your fstab, to not mount your boot partition, after
you're sure everything went properly with the install, and copy the
contents of the boot partition to the now empty /boot directory. Then add
a stanza to boot from that directory also. When Suse does a kernel update,
it will be to the one in the /boot directory, but not to the one on the
boot partition. Use the stanza for the /boot directory to try to boot
after the update. If it's munged, as has been the case for a lot of
people, the old kernel is still safe, and untouched on the partition. Make
sure you copy the /lib/modules/<current-kernel-modules> directory to
<current-kernel-modules-safe> before you let YOU do a kernel update, as it
will be replaced by a new one, for the new kernel, and remove the -safe
extension, from the directory name, before rebooting. That way, you will
have two sets of modules, one for each kernel. Without this, the old
kernel will not boot.

If the new kernel works well, copy the contents of /boot to a new
directory on the boot partition, ie /9.1-upg and modify the partition
stanza to point to that, or add a new one, as shown above. You can now
safely remove the original kernel, if you desire, or keep it as a backup,
your choice. If you remove it, remove the /lib/modules/<old-modules> that
went with it, and while you're there make that -safe copy of the new
modules, so you're ready for the next upgrade.

A little planning beforehand can save a lot of grief later. I got burned
and screwed once, a long time ago. Since adopting the above method, I
still get burned by kernel upgrades, now and then, but I never get
screwed. A simple reboot to the partition stanza, and life goes on.

That's much more than you asked for, but it's all related, and having a
separate boot partition allows you to take advantage of these options. If
you use them, sooner or later, you'll smile, and say, "Glad I did that",
instead of, "Damn, I wish I'd done that".

HTH ;-D

-- 
imotgm


Relevant Pages

  • Re: GRUB, MBR and NTLDR confusion
    ... that GRUB can be loaded on to the boot partition instead of the MBR ... What you want is to install it to the MBR of /dev/hda. ...
    (Ubuntu)
  • Re: booting Fedora 3 from boot disk
    ... my favorite arrangement for dual-boot machines is to install ... That can work too, and have done it that way, but still prefer grub on ... the MBR - with another bootable medium as backup to recover from Bill ... > if you use the same boot partition). ...
    (Fedora)
  • Re: [opensuse] device.map - Darryl/Carl/Boyd
    ... > doing a restore or recovery of the XP installation. ... someone suggested a nice simple how-to to fix the mbr ... I could ask a question of the OP, did you have grub write to the MBR ... install and then re-booted, and it went into XP without showing the Grub ...
    (SuSE)
  • Re: grub question
    ... I have two HD (sda sdb) and grub installed on the sda MBR. ... I want to install grub on the sdb MBR because the system is installed on ...
    (comp.os.linux.setup)
  • Re: GRUB problem: Booting Linux from USB Disk
    ... The reason modifying things to install GRUB (stage1) onto the MBR ...
    (comp.os.linux.misc)