Help: I borked my WindowsXP boot when installing OpenSUSE 11.3

fdisk -l

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e85f9

Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2103296 82 Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sdb2 262 2873 20972544 83 Linux
/dev/sdb3 2873 14594 94143488 83 Linux

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x83c583c5

Device Boot Start End Blocks Id System
/dev/sda1 1 19458 156288000 7 HPFS/NTFS
/dev/sda4 * 1 1 0 0 Empty
Partition 4 does not end on cylinder boundary.

I know /dev/sda1 is the NTFS partition containing the winXP installation.

It’s an NTFS partition for sure (has an NTFS partition ID at least). But if the script didn’t find what it was looking for in the bootsector,

  • either your XP bootsector uses another string (and I would be interested to know which one, so I coul add it to the script)
  • or your XP bootsector doesn’t contain a valid bootcode (any more).

Could you please copy/paste the following command to a terminal and post the result:

dd if=/dev/sda1 bs=512 count=1 2>/dev/null | tr -cd ":alnum:] :space:]"

It reads all alphanumeric and space characters in the bootsector of sda1.

ah7013 wrote:
> Found this on ubuntu forums. Try changing Windows XP entry to this:

i’m pretty that ubuntu during the time frame of the posts you
referenced (2006 to 2008) and openSUSE 11.3 use different versions of
grub, very different versions–and i personally wouldn’t go over
there and bring info back to here for use…

heck, i wouldn’t even search a SuSE/SUSE/openSUSE forum and ‘try’ a
grub ‘fix’ from a two to four year old post…things just move MUCH
too fast for that to anywhere near smart!

sure, Linux is Linux, but Ubuntu is not openSUSE in many many ways…


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]
When it comes to chocolate, resistance is futile.

How come that fdisk found /dev/sdb before /dev/sda? Are your hds mapped ?
Can I see :
cat /boot/grub/device.map
Do you have an IDE and a SATA drive ?

If your Windows bootloader is/were ok, one of the following entries should chainload the XP bootmanager :


title Windows1
root (hd1,0)
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

title Windows2
root (hd1,0)
makeactive
chainloader +1

title Windows3
root (hd0,0)
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

title Windows4
root (h0,0)
makeactive
chainloader +1

You can just copy/paste and append that to /boot/grub/menu.lst, then reboot and pick every time a different one. When you get the right one, you can remove the others.

provided you’re using openSUSE (?). I was kind of confused by DenverD’s post above (?).
If you’re on Ubuntu, it’s totally different !

dd if=/dev/sda1 bs=512 count=1 2>/dev/null | tr -cd “:alnum:] :space:]”

pyjZzseo NtMWRiZY2W OlnUBYYPgNtmtyACuJ5Lm0UAae7kKOZC2sSR t84KaXNQfeAk
KIguDjycPhQIutz5xlemAwwOh
WZy4lUqQGofP
MMh
obVUaT

Reposting using CODE tags for better readability of whitespace

dd if=/dev/sda1 bs=512 count=1 2>/dev/null | tr -cd “:alnum:] :space:]”

pyjZzseo        NtMWRiZY2W      OlnUBYYPgNtmtyACuJ5Lm0UAae7kKOZC2sSR    t84KaXNQfeAk
    KIguDjycPhQIutz5xlemAwwOh
                                WZy4lUqQGofP
MMh
   obVUaT

No luck. All of the above give an Error 13.

I guess at this point I can probably assume that - at the very least - I need to reinstall a windows bootloader, and at worst that I need to reinstall WinXP.

That bootsector doesn’t look right.

It doesn’t work right either :frowning:

I guess at this point I can probably assume that - at the very least - I need to reinstall a windows bootloader, and at worst that I need to reinstall WinXP.

The bootsector is garbaged. I’m not a Windows specialist But I think that Windows saves a copy od the bootsector somewhere … If you have that either in a file or in another sector, it would be easy to fix. But do you know why/how this happened ?
Otherwise … yep you have to reinstall Windows bootloader … but before doing that, you should install Grub in another partition’s bootsector under Linux (I don’t recall which is which), because a Windows repair CD or whatever is going to rewrite your MBR, with the consequence that you won’t be able to boot Linux anymore.

I have to get out. Just post the output of
mount
and somebody will tell you how to install grub in your root partition. It’s uncomplicated.
Good luck.

I can’t figure out how/why this happened. I’ve installed OpenSUSE (and other linux distros) as dual-boot on existing windows machines several times before, and so long as I pay attention during the partitioning phase I’ve never had problems. This is the first time I’ve EVER seen the install process trash a windows boot sector.

The timing of this particular adventure couldn’t have been worse though.

mount

/dev/sdb2 on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
devtmpfs on /dev type devtmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,mode=1777)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sdb3 on /home type ext4 (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)

please try again wrote:
> provided you’re using openSUSE (?). I was kind of confused by DenverD’s
> post above (?).
> If you’re on Ubuntu, it’s totally different !

sorry, you can’t tell in the web forum that i responded directly to
(and therefor about) ah7013’s advice in post #6 of this thread…

it was posted as a warning to the poster with the problem to NOT use
post #6 as a fix potential…


DenverD
CAVEAT: http://is.gd/bpoMD [posted via NNTP w/openSUSE 10.3]
When it comes to chocolate, resistance is futile.

OK. You choosed to install Linux on your second HD, right ?
You didn’t tell me if you were using an IDE disk together with a SATA one.
Are you able to mount that NTFS partition ?

mount -t ntfs /dev/sda1 /mnt

Can you post your /etc/fstab ?

cat /etc/fstab

and the ouput of the following command

blkid

With this informations, we (or you) could rewrite an /etc/fstab (if necessary) which would still work if you switch harddisk order in the BIOS. So installing Grub in the MBR of your second harddisk and switching hd order after a Windows repair/reinstall wouldn’t bother Linux, then reinstall Grub in the MBR of your first disk and switch BIOS boot order back …

This is one possibility among others, and you might hear others here too.

You can also have a look at the examples I posted in the french forum : Grub pour les nuls
The explanation is in french but the examples might give you an idea. What I suggest is to replace device names (/dev/sdb2, /dev/sdb3) with UUIDs, so if you switch hd order and sdb become sda, the UUIDs won’t change… otherwise the system won’t find the root device anymore and it won’t be able to start. But I don’t know how your /etc/fstab look like. Maybe it does already mount by UUIDs. …

The mystery is resolved.

Turns out this laptop has a “feature” known as SafeBoot from McAfee. This means the boot sector is secured via encryption, so it’s no wonder GRUB couldn’t launch anything even when the menu.lst entries were correct.

Many thanks to everybody who took the time to think through the situation and reply to this thread. Unfortunately, your efforts have been foiled by the evil that is McAfee. This machine has been re-imaged back to single-boot WinXP and shall remain that way forever.

Arrrrrrrrrg :frowning:

Can’t you turn this abortion off in the BIOS??

Another thought just occurred to me - using a USB drive as a boot loader to point to the appropriate partition.

I’ve started a new thread (How to create a USB boot drive (like the old boot floppies)?) with this question so we’ll see what kinds of responses I get back.