View Full Version : XP installation has “moved”: ideas on solving.
Paul Komski
05-10-2003, 09:05 PM
Whether by accident or by design, it is possible to have made a WinXP (or W2K) partiton inaccessible by the system no longer recognising either where it is now or what drive letter is assigned to it.
The following are all examples of things that can cause this (there are bound to be others too):-
Installing an earlier version of Windows after the later version is happily installed.
Reinstating partition image files but not to their original positions.
Copying a whole system partition to another part of the drive in order to move its position or create a backup.
Changing the files (notably the 3 bootloaders – boot.ini, ntldr and netdetect.com) in the root of the C partition or by changing the format of C from FAT to NTFS; this means that DOS-based apps can no longer either read or write to it.
Splitting, merging, deleting, converting (esp from FAT to NTFS) or hiding partitions on the drive.
Marking a partition, other than C, as active can also cause related and more intricate problems.
Forcing a changed drive letter for any system partition.
As long as the partition containing the previously working os is not written over or obliterated by formatting, etc then I have always, eventually, been able to get it functioning normally again. Sometimes this has taken a lot of "juggling".
In essence this often means doing a repair installation of XP and for which it is essential that you have the installation CD and know the product key. Remember to enable the BIOS to be able to boot from the CD. It is also recommended to always attempt these repairs by booting to the CD and not running it from within windows; the prompts are harder to read but less confusing. Bad luck if you only have a restore disk or restore files on the HDD; you may then be into the road of using recovery software.
However, the above manouvres can trick the system into not displaying the installation you want to repair and appear to leave you stumped. What may seem strange is that you will usually be able to logon to the problem partition to do a “repair” using the recovery console, but when you try to actually repair the whole installation it does not show up in the list.
I would advise that all the following steps be taken. If you have real important data then backup the whole drive by slaving it to another pc and make an image of it there before starting. As a minimum, backup just the important partitions using something like Norton's Ghost or PQ's DriveImage or DriveCopy.
First make a copy of the three main boot loaders from C onto a floppy. It is wise to have a copy of these in any case. You may have to edit just the boot.ini file manually, but generally the original one will work fine and usually be able to get you back into your system.
Recommend removing any slave drive temporarily so that drive lettering is less likely to get confusing.
With or without this floppy, you may still get a “hal.dll is missing or corrupt” message after attempting to boot.
Now if you can’t get into any OS you will need Partition Magic (or similar) on floppies. Start it and ensure that C: (assuming this is the normal boot partition) is the only active partition. Unhide any hidden partitions (utilities or os installations may have done this hiding during their various processes). Finally I would suggest converting all partitions from NTFS to FAT32 using PM. You can convert them back afterwards when you are ready. Hopefully no file encryption is in place or this wont work. The ideas behing this are to make everything as visible as possible to everything. As a minimum convert C to FAT32 if it is NTFS.
Boot to the install CD and see if your installation is now visible in the list after pressing enter for a new installation. If so then go ahead and repair it.
If that doesn’t work then boot to the CD again but this time to the recovery console. Log on to the relevant installation and run both fixboot and fixmbr from the command prompt.
If still no success then you will need to create a new (or parallel) installation of XP. Hopefully you will have enough room on the HDD (about 1.5GB is the absolute minimun). After this is installed you should have access to your pc again and probably the multiboot options will work normally. The various boot loading processes should however have been corrected. If not, then at least the system should now see your problem installation, so that when you now boot to the install CD it will allow you to repair it at last!
I have spent much of the last 3 days experimenting with these processes so I thought I would post these thoughts on so others can get some help or ideas if needed and also as a reference that I can refer back to as the grey cells die away.
Paul Komski
05-11-2003, 06:28 AM
Couple of things I didn't mention - the post was long enough.
Marking other than C as active can cause peculiar results when you try to repair from the list of xp installations. This is largely to do with drive letter assignments, which are stored on the HDD and in the registry by the XP installation(s) but also in other markers in the boot process - especially during a new installation, which creates a "temporary" boot sequence and "boot.ini".
Say you have two installations of XP on D and F (C being the active partition containing W9x/me/2k). One of the XPs may not show up in the list available to repair. If at this stage you go and either hide or mark as active one of the XP partitions, you may find that the other one, sometimes both, now appears in the list.
It may however only appear to appear there. You try to repair the one on D and it is the one on F that gets repaired. Both installations might "think" they have the same drive letter but the install setup has to give them different letters and may only actually repair one of them, regardless of which one is chosen.
Make everything "visible and FAT", mark C as active and do another parallel installation somewhere else to correct this and allow you to repair the correct installation. The new parallel install seems to correct all the troublesome drive letter assignments and markers in the boot processes.
You can (and maybe should) try and manually edit the boot.ini file and add an entry for the problem partition before repairing, if your problem installation is not shown in the bootup list. This usually just results in the "hal.dll corrupt" or other message, when it is then selected from the bootup list.
I think the hal.dll error can also appear following certain hardware changes, but this is not something I have researched. Perhaps its something to do with the product activation processes.
None of the above relates to dynamic drive or other drive overlays if they are in place, and which is another possible way to get back into one's inaccessible OS; or NOT of course!
HE HE There are two bonuses from such an experimenting session. One is that one learns ones product key by heart. The other is that "getting ones hands dirty" is really really instructive; unlike the learning from a book or the web, which is useful but second best! ;)
Paul Komski
05-11-2003, 09:25 AM
One note about the lines in boot.ini such as:- multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
The partitions are numbered starting at (1); first all primary partitions; then all logical volumes in the extended primary partition. So (6) would refer to the third logical partition in an extended partition (which itself is not referenced); and even if the extended partition resides, physically, BETWEEN the other primary partitions.
Also, if there is only one option to choose from, then this will be booted into automatically without showing the options at startup - even if the timeout is, say, 30. If you don't want the options to timeout then set the value to -1 and the options will stay displayed until one is chosen.
Oh - and some references (after reading The PC Guide (http://www.pcguide.com/ref/hdd/file/struct.htm) of course!)
Multibooting Windows from an Extended Partition
http://www.goodells.net/multiboot/index.htm
Inside the Boot Process, Part 1
http://www.winntmag.com/Articles/Index.cfm?ArticleID=3952&pg=1&show=824
Boot INI Options Reference
http://www.sysinternals.com/ntw2k/info/bootini.shtml (no longer valid link)
http://technet.microsoft.com/en-us/sysinternals/bb963892.aspx (new location)
How to create a Windows NT 4.0, 2000 or XP boot floppy disk
http://www.nu2.nu/bootdisk/ntboot/
Track Your Boot Process
http://www.techtv.com/callforhelp/freefile/story/0,24330,3417054,00.html
And a utility for re-writing boot.ini if you are all NTFS and cant "get in".
Fixing Windows 2000/XP BOOT.INI Files
http://www.goodells.net/multiboot/editbini.htm
PS Have also discovered that Partition Magic and Drive Image (the latest versions anyway) will automatically update the boot.ini file after deleting or restoring a partition containing an OS.
rond36
11-13-2003, 02:32 PM
Here is another link that should be added to this thread MSKB 289022 how to edit boot.ini (http://support.microsoft.com/?kbid=289022)
rond36
07-10-2004, 10:36 PM
Here are some more:
How to multi-boot Windows XP (http://www.microsoft.com/windowsxp/pro/using/howto/gettingstarted/multiboot.asp) (no longer valid link)
Microsoft Expert Zone Multi-booting made easy (http://www.microsoft.com/windowsxp/expertzone/columns/russel/september10.asp)(no longer valid link)
MSKB How to multi-boot Windows XP (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q306559)
Microsoft's instructions on how to use Fdisk and Format (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q255867)
mrmomaz
10-31-2006, 11:34 PM
[QUOTE=Paul Komski;127562]
Boot INI Options Reference
http://www.sysinternals.com/ntw2k/info/bootini.shtml
this seems to be a bad link :(
Paul Komski
03-21-2007, 04:47 PM
Over three years ago I posted a thread http://pcguide.com/vb/showthread.php?t=22390 which mjc then assigned "temporarily" as a sticky. It is out of date now and the concepts involved are better understood now than at that time, when I used an empirical approach to generally get windows back to where it was wanted. I have thus unstuck the original and made this into a new sticky outlining some of the basics behind how boot.ini integrates itself with the partition tables and how its references can "misbehave". If the concepts are understood it is much easier to troubleshoot and make corrections.
The boot.ini file should be found in the root of the system partition and is what (in conjunction with the ntldr file) directs the boot processes to a relevant windows installation. Leaving Vista aside, this relates to the three NT-based OSes WinNT/2000/XP. Malconfiguration of the boot.ini file commonly leads to messages such as hal.dll or ntoskernel or ntldr "is missing or corrupt" or similar messages, when misleadingly these files may well be neither missing nor corrupt but rather that boot.ini is either absent or is misdirecting the boot processes so that these files are not found.
In MS parlance, the system partition is the partition that windows is booted FROM and the boot partition is the partition that is booted TO. On a single partition system they are one and the same. The system partition will, almost without exception have the drive letter C: and should have been marked as active in the partition tables of that hard drive. The boot partition contains a "Windows system folder" usually called WinNT under WinNT/2000 and Windows under WinXP. If this boot partition is on a different partition from the system partition then the boot partition will not have the C: drive-letter.
All that follows relates only to IDE/ATA drives and not to SCSI drives to which there are differences.
A typical entry in boot.ini would be:-
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect /NoExecute=OptIn
This could be simplified to multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="" and the system would still boot OK. The important values are the rdisk number, the partition number and the name of the System Folder. What goes inside the "" (quotation marks) is what should show-up in any boot menu made visible during start-up; this particular value has no effect on the boot process. The hard drives in a system are enumerated in boot.ini starting with rdisk(0) then rdisk(1) etc. The partitions in a hard drive are enumerated in boot.ini starting with partition(1). This is when understanding the linkage to the partition tables is essential if you want to really understand which partition boot.ini is referring-to and attempting to boot.
First off, there are four partition tables in a basic HDD's partition tables. A boot.ini reference to partition(1) DOES NOT REFER DIRECTLY TO the first physical partition on a drive. It does however refer to the first primary (non-extended) partition referenced in the partition tables. It is not generally understood that the partition tables themselves (1 to 4) do not refer, sequentially, to four physical primary partitions as outlined sequentially on a hard drive. That is to say that one could have four physical partitions on a hard drive but partition table 1 could refer to any of them. The tables do not have to be in order. Let us say that there are four primary partitions on a particular hard drive and that the second of these is a combined Windows boot and system partition marked as active. The system will attempt to boot this partition but if the boot.ini file on that partition does not correctly identify itself its own ntldr will not be found. One might expect the boot.ini reference, in that specific instance, to be unequivocally partition(2) but that is not necessarily the case!!! It is only the case if the first two partition tables refer to primary (non-extended) partitions and the second partition table then refers to a windows system partition residing on the second physical partition. It is partition(2) because it is the second partition table entry and not because it is the second partition on the drive. If the boot.ini file was edited to partition(1) the system would not boot up UNLESS the partition tables 1 and 2 were swapped around. If this was done then boot.ini's partition(1) reference would refer to the first partition table, which would refer, correctly, to the second physical partition and the system would still boot OK.
I hope this is making sense, even though it is a hard concept for most to grasp. The basic rules are that as far as boot.ini is concerned an extended partition is totally ignored. Partitions (1) thru (4) (or thru (3) if there is an extended partition) refer to the four (or three) primary partition tables. Logical partitions follow after all primary non-extended partitons have been enumerated. Thus if there is only one primary partition and two logical partitions the logicals will be partition(2) and partition(3) but if there are three primary partitions the first two logical partition will be partition(4) and partition(5) - and this is the case even if those two logicals are right at the start of the hard drive and regardless of which partition table references the extended partition that is holding them.
Once this makes sense one can usually edit boot.ini (or sometimes edit the partition tables equivalently) in order to get its references correct and the system to boot up again.
If boot.ini is on a FAT partition then one can edit it easily from an msdos floppy startup diskette or similar. If boot.ini is on an NTFS partiton then one needs to be able to access it some other way or to boot into windows and correct things once inside windows. A special floppy diskette containing an NT partition boot sector and the three files boot.ini, ntldr and ntdetect.com is capable of booting up windows without using the hard drive for the boot-up routine. One can make one oneself by formatting a floppy FROM Win2K/XP and then copying the three mandatory files onto it. Bootdisk.com keep an image file of the same sort of floppy called an XP Quick Boot Diskette from http://bootdisk.com/bootdisk.htm and the same floppy can be made from an EBCD from http://ebcd.pcministry.com/download_en.html
Boot.ini on NTFS can also be edited using EditBini from http://www.terabyteunlimited.com/utilities.html and placed on an msdos boot floppy or run from a DOS based version of Windows such as Win9x or by BiNG (BootIt-NG) from http://www.terabyteunlimited.com/bootitng.html One edits any file from BiNG by choosing a partition's properties entry and then the edit button. One can additionally use BiNG to edit or move the partition tables on the MBR around.
Finally, boot.ini in WinXP can be rebuilt by booting to the Recovery Conole on the installation CD and running bootcfg /rebuild
Paul Komski
03-22-2007, 06:09 AM
The opening post was long enough but it is perhaps also worth mentioning a bit about what goes on with Drive Letters under the NT-based OSes since this is another major source of confusion or non-comprehension. If only MS had followed the Linux conventions then a lot of this confusion could have been avoided. Under Linux /dev/hda1 is (almost unequivocally) the first partition on the first fixed IDE drive. It is almost unequivocal because in fact it refers (just as boot.ini does) to the first partition table entry. Most commonly partition table entries mirror the physical partitions on the drive so all seems straightforward - 95% of the time anyway. The other difference under Linux is that logical partitions always start at number 5. The first logical on an IDE drive being /dev/hda5. The extended partition is not ignored under Linux and has a partition table reference between 1 and 4. An extended partition is, after all, a specialised primary partition.
Why mention Linux at all you may ask. Well because the Linux notation can still be a very useful way or referring (almost unequivocally) to what is where. You see Drive Letters are even more "all over the place" than boot.ini references are.
The initial drive letter assignments follow these Win2K rules (http://support.microsoft.com/?kbid=234048). After that it is possible to reassign some drive letters (http://support.microsoft.com/?kbid=307844) if one wants to. Windows wont let you change the drive letters for the system or boot partitions (http://support.microsoft.com/?kbid=314470)- though there are tweaks and utils that can force this - but bear in mind that this can produce unpredictable results or a non-booting system.
The reason that one can change most drive letters is because the assignments are stored in the registry at HKLM\SYSTEM\MountedDevices. Windows knows which letter is mapped to which partition by an algorithm stored in that registry key; an algorithm that is based on that hard drive's disk signature and the size and position of the partition so it can then map the algorithm to a particular drive letter.
If you resize or move a partition or change its disk signature then Windows has to try to make sense of the drive letter assignments all over (because the algorithms for the partitions will have changed) and this may result in changed drive letters. If partitions are added or subtracted this tends to throw out the boot.ini references but the logical disk manager usually reassigns drive letters normally and without problems.
There are two ways of completely resetting the drive letters. One is to delete the whole mounted devices key from the registry and reboot. The other is to run fdisk /mbr from an msdos boot diskette (fixmbr doesn't work) or use another method to assign the hard drive a new disk signature. On rebooting MS will detect things "as new hardware", update itself and request another reboot.
Neither method of resetting the drive letters is without risk so if you decide to do either of them ensure you have a full Windows installation CD at hand and be prepared to do a repair installation (http://www.michaelstevenstech.com/XPrepairinstall.htm) and possibly have to reactivate Windows into the bargain. A repair installation is also a way or "mending" not only a corrupt/malconfigured boot.ini but also other boot files and relevant boot sectors if the recovery console cannot fix things with fixmbr and fixboot.
Paul Komski
06-08-2007, 03:42 PM
Its bcdedit and not boot.ini under Vista.
http://blogs.msdn.com/peterty/archive/2006/03/14/Where-is-my-BOOT.INI-under-Vista_3F00_.aspx
Vic 970
10-13-2007, 07:07 AM
Thanks paul. I understand it a bit better now, (although it still hasn't solved my problem)
I have set up w XP on a spare (6Gb) hdd set as single partition, with all my connections progs etc. on it. this works fine.
I then copied that over to a 40 Gb hdd with 7 partitions, (copied onto 1st partition) with windows 98se on 2nd partition. pc will not boot to Xp but if 2nd option is selected will boot to w98se.
I have compared all of the boot.ini files, & in w98se there is a reference (last) C:\ = Windows 98se
there is no similar reference in the other boot.ini files on w XP.
I added D:\= Windows XP Proffesional to the boot.ini file on the multi partitioned hdd, but this made no difference. I have also tried altering partion reference from 1 to both 3 & 4 but again no difference.
the pc gets to the stage of logging in as administrator but does not show the log in screen.
Paul Komski
10-13-2007, 09:50 AM
Using boot.ini to boot Win98 (and any DOS or DOS-based OSes) you use a drive letter (plus and an optional file that represents the original Win98 bootsector). The default file is bootsect.dos and if no file is defined boot.ini in fact looks for and loads that bootsect.dos file. Win9X is referenced by letter. You could rename the bootsect.dos file to hehehe.dat and this would stop Win98 from loading. However if the line in boot.ini was then changed to C:\hehehe.dat then Win98 should boot again without any problem. The other thing with the DOS-based OSes is that they always dynamically follow a convention for which drive letter each partition is to receive and this would exclude, for example, any NTFS, hidden or linux partitions.
With WinXP (and the NT based OSes) you use a partition reference such as partition(2). The first "trick" here is that the number (2) refers to the second primary partition table. The second "trick" is than any extended partition (if one exists) is completely ignored. Thus if the first partition table references an extended partition, partition(2) then refers to the third partition table and it in turn defines a partition somewhere on the drive - as located by its LBA address - as does every partition table entry.
I then copied that over to a 40 Gb hdd with 7 partitions, (copied onto 1st partition)I'm willing to hazard that although it was copied to the first physical partition that the partition table referencing this first physical partition is not partition(1) (viz partitionTable #1) but number #2 or #3 or #4. Boot.ini will let you see the order of the partition tables and also allow you to change the order of the tables themselves so that they can be made to be in order or out of order.
It's quite a hard one to get across. !
Vic 970
10-13-2007, 12:11 PM
I have also tried editing partion reference from 1 to both 3 & 4 but again no difference. (partition 2 is w98se which boots ok)
the pc gets to the stage of logging in as administrator but does not show the log in screen.
Paul Komski
10-13-2007, 12:59 PM
If you can load Win98 from the second physical partition then you should just need to add or edit the correct line to reference your new transferred partition, since if you are not altering the active partition, you would still be attempting to boot into the WinXP partition from the Win98 partition. And the second physical partition could be actually referenced from the first partition table - so it is quite possible that Win98 is referenced by partition(1) and WinXP by partition(2) !!
Are you sure that the new copied partition is a primary partition? If so then just ensure that the boot.ini that loads Win98 contains all four options (including partition(2)) and try them all: eg ...
[boot loader]
timeout=30
default=C:\
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional 1" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Professional 2" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft Windows XP Professional 3" /fastdetect /NoExecute=OptIn
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Microsoft Windows XP Professional 4" /fastdetect /NoExecute=OptIn
C:\="Windows 98"
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.