PDA

View Full Version : Partition types keep changing during Windows Boot



DirkEbert
12-21-2004, 07:15 AM
Today, I installed KNOPPIX 3.7 on my Thinkpad notebook. I have the problem, that when booting into WinXP, Windows does not find the second NTFS partition (with the user data) because the partition type is changed.

The partition layout is (should be) the following:
/dev/hda1 WinXP System, NTFS (Type 0x07)
/dev/hda2 WinXP User Data, NTFS (Type 0x07)
/dev/hda3 IBM Service, FAT32 (Type 0x0c)
/dev/hda4 KNOPPIX, ext3 (Type 0x83)
(There is an empty PCMCIA Disk at /dev/hde that contains not partitions)

LILO is installed in the MBR

When I boot into WinXP (/dev/hda1), it can not find the data partition (/dev/hda2). In the drive-manager, the partition can be seen, but no "letter" is assigned. The menu entry for assigning a drive letter is greyed out. (Same for /dev/hda3)

A subsequent boot into KNOPPIX shows that the partition types of /dev/hda2 and /dev/hda3 have been changed to "hidden":
/dev/hda1 WinXP System, NTFS (Type 0x07)
/dev/hda2 WinXP User Data, hidden NTFS (Type 0x17)
/dev/hda3 IBM Service, hidden FAT32 (Type 0x1c)
/dev/hda4 KNOPPIX, ext3 (Type 0x83)

changing them back does not really help, because at the next boot (into Windows) the types are changed again. Booting into KNOPPIX does not change them.

My current "solution" was to correct the types with fdisk and to re-install the WinXP MBR. Now Windows finds its data partition, but obviously I can not boot KNOPPIX without CD.

What can I do to prevent this change of partition types during boot?

Harry Kuhman
12-21-2004, 03:30 PM
......changing them back does not really help, because at the next boot (into Windows) the types are changed again. Booting into KNOPPIX does not change them......
Why in the world is Windows changing the partition types when you boot?

The answer to the above is likely the key to everything. Might there be some sort of recovery that is trying to take place from a back up copy of the MBR? (If so you might have to find the back-up copy of the partition table and undo these hidden partitions there too.) I've used a geat boot manager called XOSL that can hide and unhide partitions at boot time, and was going to suggest that it might help you - until I read that Windows itself seems to be re-doing the hiding after you fix it. You might still want to look at XOSL, but it sounds like the Windows partition screwing would happen after you boot with XOSL too (unless it happens to overwrite a corrupted backup of the partition table).

I would also check your BIOS closely to see if it is in any way over writing that partition table with a corrupt backup. It doesn't seem likely if Knoppix sees the partitions as good after a reboot and only Windows does not, but it certainly seems worth checking.

Harry Kuhman
12-21-2004, 03:39 PM
...
My current "solution" was to correct the types with fdisk and to re-install the WinXP MBR. Now Windows finds its data partition, but obviously I can not boot KNOPPIX without CD.

What can I do to prevent this change of partition types during boot?
I personally don't believe in installing Knoppix to a hard drive (your and many other posts here about strange problems aftwerwards should help explain why), so I'm not the best to comment on this, but it certainly seems that your problems are coming from installing lilo on the MBR. There is no need to do this, and lots of reasons not to.

As I mentioned in a previous post, I like to use XOSL (http://www2.arnes.si/~fkomar/xosl.org/home.html) for booting multi-operating system computers (and even for booting computers with one OS). When using a boot manager like XOSL you install the boot manager in the MBR and you install Lilo on the Linux partition. You can boot two or more OSs this way with no problem at all. Another good boot manager is Smart Boot Manager (http://btmgr.webframe.org/). It's not as fancy as XOSL, doesn't have as many features, but is smaller and even easier to install.

DirkEbert
12-22-2004, 03:15 AM
Thanks to everybody for the help. Now, I have the solution for the problem of changing partition types during windows boot.

Actually, the reason is a LILO feature. As old DOS and Windows systems could not boot from any other drive than "C:" and the drive letters were assigned to the partitions in sequence during boot time, LILO uses the "trick" of hiding partitions to give "other" operating systems the impression of booting from the firtst partition (that is mapped to C:).

Unfortunately, if you have a separate data partition like in my case this causes trouble because Windows does not "see" the hidden partition so the user data is unaccessible.

The solution is to switch off or limit the partition table manipulation. As in my case WinXP is on /dev/hda1, I switched of all partition table manipulation by inserting the following 2 lines into /etc/lilo.conf:


[...]
change-rules
reset
[...]

This deletes all previously defined rules, including the rules predefined when LILO is started. After installing the modified LILO in the MBR, both KNOPPIX and Windows are booting fine and the partition types do not change any more.

More on LILO's "Partition table manipulation" be found here:
http://www-user.tu-chemnitz.de/~mibe/linux/lilo/user/d4hnode51.html