Custom Search
Join the PC homebuilding revolution! Read the all-new, FREE 200-page online guide: How to Build Your Own PC!
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
Results 1 to 11 of 11

Thread: boot.ini and related stuff

  1. #1
    Join Date
    Oct 2001
    Location
    N of the S of Ireland
    Posts
    20,503

    boot.ini and related stuff

    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="Micro soft 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
    Take nice care of yourselves - Paul - ♪ -
    Help to start using BiNG. Some stuff about Boot CDs & Data Recovery Basics & Back-up using Knoppix.

  2. #2
    Join Date
    Oct 2001
    Location
    N of the S of Ireland
    Posts
    20,503

    A bit more about Drive Letters

    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. After that it is possible to reassign some drive letters if one wants to. Windows wont let you change the drive letters for the system or boot partitions - 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 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.
    Take nice care of yourselves - Paul - ♪ -
    Help to start using BiNG. Some stuff about Boot CDs & Data Recovery Basics & Back-up using Knoppix.

  3. #3
    Join Date
    Oct 2001
    Location
    Derby, England
    Posts
    2,282
    Thanks for putting these together Paul, i`ve read the first post (got to reread) and now theirs more.

  4. #4
    hello, I'm sorry to enter the forum for the first time here in a sticky, but I've a problem that's maybe relevant to many people and it's quite inherent to system boots.

    I need to boot from the win XP disc, wich needs boot.ini, in a notebook wich has win vista preinstalled, so vista have another method for the boot and doesn't recognize the XP disc as a 'bootable' one.
    what should I do, maybe making a partition and trying installing there XP from the setup routine could work (I really don't know, I'm quite an inept on partitions) ?

    thank you and obviously feel free to move this post where you think it belongs.

  5. #5
    Join Date
    Oct 2001
    Location
    N of the S of Ireland
    Posts
    20,503
    Its bcdedit and not boot.ini under Vista.

    http://blogs.msdn.com/peterty/archiv...sta_3F00_.aspx
    Take nice care of yourselves - Paul - ♪ -
    Help to start using BiNG. Some stuff about Boot CDs & Data Recovery Basics & Back-up using Knoppix.

  6. #6
    exactly, that's my problem. I don't want Vista, it's slow and lacks compatibility, but I see XP needs boot.ini to start the installation process and my notebook has got only Vista's bcdedit.
    so how can I install win XP in this conditions? I have to put a boot.ini file somewhere in the file system?
    every way I could think of doing the job, it lacks in this point: XP needs boot.ini , there's no way out, right?

  7. #7
    Join Date
    Oct 2000
    Location
    Crewe, Cheshire, England
    Posts
    1,668
    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.
    for every question there's an answer. Then a load more questions.

    Definition of Upgrade "A means of introducing new bugs to a program to replace the ones that you have eventually found fixes for"

    Regards..,
    Vic.



  8. #8
    Join Date
    Oct 2001
    Location
    N of the S of Ireland
    Posts
    20,503
    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. !
    Take nice care of yourselves - Paul - ♪ -
    Help to start using BiNG. Some stuff about Boot CDs & Data Recovery Basics & Back-up using Knoppix.

  9. #9
    Join Date
    Oct 2000
    Location
    Crewe, Cheshire, England
    Posts
    1,668
    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.
    Last edited by Vic 970; 10-13-2007 at 12:12 PM. Reason: word change
    for every question there's an answer. Then a load more questions.

    Definition of Upgrade "A means of introducing new bugs to a program to replace the ones that you have eventually found fixes for"

    Regards..,
    Vic.



  10. #10
    Join Date
    Oct 2001
    Location
    N of the S of Ireland
    Posts
    20,503
    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 ...

    Code:
    [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"
    Take nice care of yourselves - Paul - ♪ -
    Help to start using BiNG. Some stuff about Boot CDs & Data Recovery Basics & Back-up using Knoppix.

  11. #11
    Great sharing,,,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •