When installing windows after linux..

I installed windows xp on my computer first then OpenSUSE 11.1. If I need to reinstall windows is there anything I need to do that would not be in step with the normal install process? Thanks for the help!

If you reinstall Windows, Windows will overwrite the MBR and prevent you accessing GRUB; you will need a LIVE CD or DVD to restore the GRUB pointer on the MBR. There should be no other impact on your Linux installation. (But I would still back up my /home partition in case!)

If openSUSE’s root partition is currently installed on a “primary” partition, then after reinstalling Windows you can use the LiveCD or DVD Rescue or Repair to reinstall grub to the openSUSE partition boot sector rather than the MBR. Then use sfdisk to mark the openSUSE partition as “active”. With this setup, the Windows MBR code will load openSUSE’s grub boot loader, which as before can also boot Windows. The advantage of this method is that it avoids touching the MBR again, and is easy to revert to having Windows control the boot should that ever be needed in the future.

Could you provide a little assistance on installing the grub on OpenSUSE’s boot partition? Thanks for the help!

The first step is to determine if this is reasonable option for your system depending upon how the disk is partitioned, as well as how grub was initially installed. In openSUSE, open a terminal window, and post back the output of:

sudo fdisk -lu
sudo cat /etc/grub.conf
sudo cat /boot/grub/device.map
sudo cat /boot/grub/menu.lst

If you haven’t reinstalled Windows yet, by far the easiest method would be to change the boot configuration now using YaST (rather than after the fact with a LiveCD or the DVD).

I have not yet reinstalled windows, looks like it was a good idea to ask first :wink:

Here is what came out:

linux-zr3q:/home/philip # fdisk -lu                                       

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes                               
Disk identifier: 0x852e852e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63   209728636   104864287    7  HPFS/NTFS
/dev/sda2       209728637   218114505     4192934+  82  Linux swap / Solaris
/dev/sda3   *   218114506   239079330    10482412+  83  Linux
/dev/sda4       239079331   488392064   124656367   83  Linux

linux-zr3q:/home/philip # cat /etc/grub.conf
setup --stage2=/boot/grub/stage2 --force-lba (hd0,2) (hd0,2)
quit

linux-zr3q:/home/philip # cat /boot/grub/device.map
(hd0)   /dev/disk/by-id/ata-WDC_WD2500AAJS-22VTA0_WD-WMART2077603


linux-zr3q:/home/philip # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Sun Dec 21 04:40:02 UTC 2008
default 0
timeout 8
gfxmenu (hd0,2)/boot/message
##YaST - activate

###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.1 - 2.6.27.7-9
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-WDC_WD2500AAJS-22VTA0_WD-WMART2077603-part3 pci=nomsi resume=/dev/disk/by-id/ata-WDC_WD2500AAJS-22VTA0_WD-WMART2077603-part2 splash=silent showopts vga=0x31b
    initrd /boot/initrd-2.6.27.7-9-pae

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.1 - 2.6.27.7-9
    root (hd0,2)
    kernel /boot/vmlinuz-2.6.27.7-9-pae root=/dev/disk/by-id/ata-WDC_WD2500AAJS-22VTA0_WD-WMART2077603-part3 showopts ide=nodma apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a pci=nomsi
    initrd /boot/initrd-2.6.27.7-9-pae

###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
    rootnoverify (hd0,0)
    chainloader +1

Quick side note. Since you mentioned being able to do it through Yast, I though I would take a quick look. Then a bit of a problem came up. I open Yast and then put in the password. Next click system and then Boot Loader, Kernel Settings, or System Backup and the machine freezes. It also froze when going into Security and Users and clicking on Local Security. It did not freeze when going into Hardware>Mouse Model. Obviously I have gone and messed something up at one point;)

I don’t know what the system freezing up problem is; that is very unusual. I would reboot and check that again, maybe check doing a few other things, too. Also do a filesystem check:

sudo e2fsck /dev/sda3
sudo e2fsck /dev/sda4

If that doesn’t clear up the problem, start a new thread for it.

As far as the boot setup, it appears you already have it the way as discussed. Grub was installed to the sda3 boot sector, sda3 is marked active, and openSUSE either installed the generic boot code to the MBR or more likely left the Windows code there (which will do the same thing). Consequently, after reinstalling Windows all you will need to do for dual-boot is to switch the “active” flag from the first partition (which Windows will) back to the third, as it is now. IIRC you could even do that within Windows in Computer Management/Disk Management. If not, you can do it from a LiveCD in a terminal window or from the DVD in Rescue at the command line, with this:


sfdisk -A3

Good luck.

Thanks so much for the help once again Mingus! Looks like the check on sda3 had a few things, does this mean anything?:

linux-zr3q:/home/philip # e2fsck /dev/sda3
e2fsck 1.41.1 (01-Sep-2008)
/dev/sda3 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? yes

/dev/sda3: recovering journal
Clearing orphaned inode 361001 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360999 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360998 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360997 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 33476 (uid=1000, gid=100, mode=0100600, size=24600)
Clearing orphaned inode 360995 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360994 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360990 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360988 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360964 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360956 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 360954 (uid=1000, gid=100, mode=0140755, size=0)
Clearing orphaned inode 50143 (uid=0, gid=0, mode=0100600, size=217016)
/dev/sda3: clean, 194682/655360 files, 1220152/2620603 blocks
linux-zr3q:/home/philip # e2fsck /dev/sda4
e2fsck 1.41.1 (01-Sep-2008)
/dev/sda4 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage.

Do you really want to continue (y/n)? yes

/dev/sda4: recovering journal
/dev/sda4: clean, 4995/7798784 files, 5891266/31164091 blocks

Another side note…
After running those commands, now the system will not restart. It only comes to a point with this information:

*fsck failed. Please repair manually and reboot. To root file system is currently mounted read-only. To remount it read-write do the following:

bash# mount -n -o remount, rw /

Attention: Only control-D will reboot the system in this maintenance mode, shutdown, or reboot will not work.

Give root password for login: (typed in)
(repair filesytem) #*

I tried typing in the comman bash#… exactly as written but it said that the bash# command could not be found. A little bit of guidance on the new issue? thanks!!

Boot from the DVD and choose Repair and choose repair filesystem. Also from Repair check the system’s base base packages.

When I ran the automatic repair these are the errors that I got:

/dev/sda3 corrupt
After trying to repair it these were the results:
-Inodes that were part of a corrupted orphan linked list found
-UNEXPEXTED INCONSISTENCY RUN fsck manually.(I.E. without -a or -p options)

/dev/sda4 corrupt
It was repaired successfully

fstab entry was replaced

A few of the packages were repaired

boot loader was repaired

At the very end when it tried to restart the system I got the red window saying that “error occured during the installation”

End result, the GRUB no longer has the windows boot option and when booting it ends up at the same place that I stated in the earlier post. grrr… Thanks as always!!!:slight_smile:

The Repair system is telling you to manually repair sda3. Boot from the DVD into Rescue, login as root, and do:

e2fsck -f /dev/sda3

After typeing root in it says:

*e2fsck: No such file or directory while trying to open /dev/sda2

The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains am ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:

e2fsck -b 8193 <device> *

Thanks!!