We fix problems with the bootloader using the command line. Restoring Windows XP through the console How to find all installed systems

Home > Operating systems > Windows

Installing Windows 2000. Installation problems

The system boot process can be divided into several stages:

Before the bootloader screen appears (menu for selecting the system you want to boot):

  • Immediately after completing the self-test (POST) phase, the computer freezes
  • The bootloader screen does not appear.
  • Error messages of the following types appear on the screen:
    • A disk read error occurred.
    • Insert a system diskette and restart the system.
    • Hard Disk Error.
    • Hard Disk Absent/Failed.

It is quite possible that in this situation the computer will not be able to start at all. If you have previously formatted all partitions to use the NTFS file system, you will not be able to use MS-DOS utilities to solve these problems. I advise you to keep Windows 2000 boot diskettes handy. This type of problem can be caused by the following things:

  1. Lack of system partition on the hard drive. It usually occurs when a newly purchased hard drive is configured incorrectly or is formatted incorrectly. You can fix this problem using the FDISK utility.
  2. The master boot record is corrupted. What is it for?
    • Reads the partition table located in this disk sector.
    • Determines the location of the partition's boot sector.
    • Loads and executes code located in the partition's boot sector.
    If the master boot record code is unable to perform these tasks, one of the following messages appears:
    • Missing operating system.
    • Invalid partition table.

To repair a damaged master boot record, you can use the Windows 2000 Recovery Console. This is done using the Fixmbr command:

fixmbr [device_name]

Parameter device_name: the device (disk) on which you want to write the new master boot record. To get the name you can use the map command. The device name might look like this:

\Device\HardDisk0.

The following example writes a new master boot record to the above device.

fixmbr\Device\HardDisk0

If a device name is not specified, the new master boot record will be written to the boot device, which is the disk from which the master system was booted. If an incorrect or non-standard partition table signature is detected, a message is displayed asking for confirmation to write. If the disks are accessed without failure, the confirmation should be answered in the negative. Writing a new master boot record to the system partition may corrupt partition tables, causing partitions to become inaccessible. Damage to the boot sector of a partition is usually characterized by a “blue screen” and a STOP error with the following content:

INACCESSIBLE_BOOT_DEVICE.

Or the machine freezes during the boot process and the screen remains blank. Even if there is no obvious gross damage, the boot sector of the partition may not work properly. The problem may be that the NTLDR file is corrupted/damaged, or the boot sector is damaged. To diagnose the problem, we proceed in the following way: We try to rename the NTLDR file and start Windows 2000 from this hard drive. If the boot sector is normal, and the problem is a damaged bootloader file, the following message will appear:

Couldn't find NTLDR- if the bootloader file is located on an NTFS partition

A kernel file is missing from the disk- if the NTLDR bootloader file is located on a FAT partition.

Accordingly, you need to replace the damaged NTLDR file with a working one (either from the boot floppy disk or from the working machine).

I warn you right away that the NTLDR file by default has the attributes “hidden”, “system” and “read-only”. If it is on a FAT partition, you can change the attributes from DOS using the command attrib -s -h -r ntldr. If after replacing the NTLDR file you do not receive such error messages and the machine still does not want to boot, then the boot partition itself is damaged. To eliminate this problem, you need to download the recovery console (that is, start installing Windows 2000 again and after the procedure for copying the installation files to the hard drive is completed, select NOT installation, BUT SYSTEM RESTORE). After the console is loaded, use the following command:

Writes a new boot sector to the system partition. The fixboot command is available only in the Windows 2000 Recovery Console, which is launched from Windows 2000 Setup.

fixboot [disk]

Parameter: the disk to which you want to write the boot sector. By default, the system partition from which the system was booted is used. The following example will write a new boot sector to the system partition of drive D:

Problems that occur after the boot loader is launched, but before the user logs in to the system

The Windows 2000 Resource Kit contains a debug version of Ntdetect.com called Ntdetect.chk. If Ntdetect.com can't detect all the hardware devices you think it should, you can use the debug version to help isolate the problem. The debug version is installed using the Installd.cmd file, which does the following:

  • Renames the default Ntdetect.com.
  • Copies Ntdetect.chk to Ntdetect.com.

After completing these operations, you need to restart your computer. When you start the system with a debug version of Ntdetect, information about all detected hardware will appear on the screen. You must press the Enter key after completing each information screen. When the debug option is no longer needed, run the installd /not command.

SOS parameter in the Boot.ini file.

You can add the /sos parameter to the Boot.ini file, which will cause NTLDR to display the names of the kernel (Ntoskrnl.exe) and drivers as they load. This will help diagnose problems with a missing or corrupt device driver.

This article will describe a not-so-standard method for restoring the Windows 7 boot loader for a not-so-standard situation when Windows 7 simply stops loading and does not show any errors.

First a little background

In general, it turned out that the mount on the northbridge heatsink fell off and the computer froze after 10 seconds (the northbridge overheated). It was heard that something had fallen, but it was not clear what, so the computer was restarted several times and each time it froze, then reaching the OS loading, then already on the OS welcome screen, and only after that it was discovered that the radiator was hanging on one mount...

After the repair, the computer was started again, but Windows booted to the welcome window, after which the computer spontaneously rebooted and the OS no longer booted, but the message “insert boot media in selected boot device and press any key” appeared, and I have RAID 0 and I thought it was out of order...

Later it turned out that the RAID was in order and further attempts were made to restore the OS boot area, but the standard (for Windows 7) commands bootrec / fixboot and bootrec / fixmbr did not help, and for fixmbr a message came out that everything was fixed, but with fixboot the message "element not found" was displayed.

By the way, the standard OS recovery program did not find my OS and it could only be seen from the command line by entering the command bootrec /scanos.

It turned out that the partition where Windows 7 was installed became inactive...

Solution

We will need an installation disk with Windows 7 OS.

1. Boot from the Windows 7 installation disk;

2. After selecting the language settings, select system recovery;

4. Launch the command line;

5. Enter the command bootrec /scanos, in order to make sure that everything is in order with Windows and it is in place;

6. Launch the disk utility using the command diskpart;

7. Enter the command list disk;

8. Search and select the disk where the OS is installed using the command select disk 0(you may have a different drive);

9. Enter the command list partition;

10. Search and select the partition where our OS is installed using the command select partition 1(again, you may have a different section);

11. Make the section active using the command active;

12. Exit the diskpart utility using the command exit;

After doing this, I got an error when loading " bootmgr is missing", so you shouldn’t immediately restart your computer after making the disk active.

13. Restore the boot area using the command bcdboot c:\windows(you may have a different drive or folder with the OS);

14. Exit the command line using the command exit and restart the computer.

That's it, after these steps Windows boots up :)

You can read more about OS recovery commands, and about working with disk

© Filimoshin V. Yu., 2013

Need good advice on how to produce Windows 7 Boot Loader Recovery, if restoring the startup using the 7 installation disk did not help. I’ll briefly explain what’s going on: Windows 7 was first installed on the computer, then the second system needed Windows XP, after installation it naturally started alone, to boot two operating systems I used the EasyBCD program. Later, XP was no longer needed and I formatted the partition on which it was located from Windows 7. Now, when loading, there is nothing except a black screen. What can be done in this case? More details if possible. Sergey.

Restoring the Windows 7 bootloader

Hello friends! The most important thing is not to worry, your problem is not complicated and, in principle, the simple “Windows 7 Startup Recovery” tool described in our article should help, but! If this article does not help you, then two others should help:

These articles describe several more good ways to restore the boot of your operating system, besides them there is one more, so try it and don’t just give up.

Let me remind you that you cannot install an older operating system after a younger one; Windows 7 will under no circumstances boot after installing Windows XP on a computer, since the latter overwrites the master boot record (MBR) during installation. Therefore, you installed an additional boot manager, which is used to configure the boot of several operating systems and, in turn, has its own bootloader.

  1. I also want to say that file system errors are often to blame for unsuccessful loading of Windows 7; they can be corrected even if the operating system does not boot; all the details are in our other article." "
  2. Friends, in this article we will work with the Windows 7 recovery environment, or more precisely with the recovery environment command line. I will give you the necessary commands, but if it is difficult for you to remember them, you can. This will make your work much easier.
  • The master boot record (MBR) is the first sector on the hard drive, which contains a partition table and a small bootloader program that reads from this table the data from which partition of the hard drive to boot the OS, and then the information is transferred to the partition with the installed operating system, to download it. If the master boot record contains incorrect information about the location of the system, then we will receive various errors during boot, here is one of them “BOOTMGR is missing press CTR-Alt-Del for restart” or we will see a black screen. The problem is being fixed restoring the Windows 7 bootloader.

When you uninstalled old XP along with EasyBCD, you left your computer to the mercy of fate with an incomprehensible boot record, and it gives you a black screen as a sign of gratitude. To rectify the situation, we will carry out boot recovery Windows 7, namely, we will overwrite the master boot record using the Bootrec.exe utility located on the recovery disk or on the Windows 7 installation disk (friends, if you have a netbook and you want to use the recovery environment located on a flash drive, then read the comments first). We will also use this utility to record a new boot sector, understandable to Windows 7.

Recovering Windows 7 bootloader automatically

We boot from a recovery disk or installation disk with Windows 7, in the initial phase of booting the computer, when prompted to boot from the disk “Press any key to boot from CD...”, press any key on the keyboard for 5 seconds, otherwise you will not boot from the disk

There is a short search for installed Windows systems and analysis of problems that prevent them from loading

Usually problems are quickly found and the recovery environment offers to fix them automatically. Click on the "Fix and restart" button, after which the computer will restart and boot Windows 7 will be restored.

If problems with loading the system continue or you are not prompted to fix the problems automatically, then in this window you need to select the operating system that you need to restore, you most likely have one and Next.

First of all, choose a productLaunch Recovery, it can also solve Windows 7 boot problems

Restoring the Windows 7 bootloader manually

If this remedy does not help, choose a remedy Command line

Enter the commands:

diskpart

lis vol (we display a list of hard drive partitions and see that “Volume 1” is a hidden System Reserved partition, volume 100 MB, it should contain Windows 7 boot files and it is this that needs to be made active). We also see a partition with Windows 7 installed, it has the letter D:, the volume is 60 GB.

sel vol 1 (select Volume 1)

activ (make it active)

exit (exit diskpart)

bcdboot D:\Windows (where D: the partition with Windows 7 installed), this command restores the Windows 7 boot files (bootmgr file and boot storage configuration files (BCD))!

"Download files created successfully"

Restoring the Windows 7 bootloader manually (method No. 2)

In the command line window, enter the command Bootrec and Enter

full information about the capabilities of the utility is displayed. Select the master boot record entry Bootrec.exe /FixMbr.

Operation completed successfully. A new boot record is written to the first sector of the boot partition.
The second command, Bootrec.exe /FixBoot, writes a new boot sector.

Operation completed successfully. Exit. Next, we try to load our Windows 7.


Friends, if the Bootrec.exe /FixMbr and Bootrec.exe /Fixboot commands do not help you, do not despair, there is another remedy.

Method number 3

Enter the command Bootrec/ScanOs, it will scan all your hard drives and partitions for the presence of operating systems and if any are found, an appropriate warning will be issued. Then you need to enter the command Bootrec.exe /RebuildBcd, this utility will offer to add the found Windows to the boot menu, we agree and enter Y and press Enter, all the found Windows are added to the boot menu.

In my case, two operating systems were found. Everything can be seen on the screenshot.

In addition to the above method, there is another one, enter bootsect /NT60 SYS on the command line, the main boot code, it will also be updated.

exit

So, the error is that on both hard drives the first hidden System Reserved partitions should be marked with a red flag. On Windows 7, the volume of such a partition is 100 MB, and on Windows 8, 350 MB, these sections have the attributes: System. Active and it is on these partitions that the boot store configuration files (BCD) and the system boot manager file (bootmgr file) are located. And it turns out that these attributes are carried by other sections. Because of this, Windows 7 and Windows 8 will not boot.

Select the first hard drive 1, right-click on the first System Reserved partition and select “Mark as active”

The System Reserved volume will be marked as active. Click OK.

We do the same with Disk 2. Acronis Disk Director works in pending operation mode; for the changes to take effect, click the “Apply pending operations” button

Continue.

As you can see, after our changes, those sections that were needed became active.

We exit the program and reboot. The result of the work is positive - both operating systems are loaded one by one.

For many years, Microsoft has been improving the recovery system for the Windows operating system, and in Windows 7 and Windows Vista it works almost automatically. If you boot from the Windows 7 installation disc and click Repair Computer, Windows Repair will launch and attempt to fix any errors it finds. It can fix a large number of problems, however, it is quite likely that the bootloader is damaged, and the recovery system cannot cope with this problem. In this case, you can restore the bootloader manually using the Bootrec.exe utility.

Application Bootrec.exe serves to correct errors associated with bootloader corruption and, as a result, the inability to start the Windows 7 and Windows Vista operating systems.

Sequencing

The utility will display help on the available command line switches.

Description of keys for launching the Bootrec.exe utility

Bootrec.exe /FixMbr- Launched with the /FixMbr switch, the utility writes a Windows 7 and Windows Vista-compatible Master Boot Record (MBR) to the system partition. Use this option to resolve problems with the master boot record being corrupted, or if you wish to remove non-standard code from it. The existing partition table is not overwritten in this case

Bootrec.exe /FixBoot- Launched with the /FixBoot switch, the utility writes a new boot sector compatible with Windows 7 and Windows Vista to the system partition. This option should be used in the following cases:

  1. The Windows Vista or Windows 7 boot sector has been replaced with a non-standard boot sector.
  2. The boot sector is damaged.
  3. A previous version of the Windows operating system was installed after installing Windows Vista or Windows 7. For example, if Windows XP was installed, NTLDR (Windows NT Loader, Windows NT loader) will be used, the code of the standard NT 6 loader (Bootmgr) will be overwritten by the Windows XP installer .

It should be noted that a similar effect can be achieved using the bootsect.exe utility, also located on the Windows 7 bootable media. To do this, you need to run bootsect.exe with the following options:

bootsect /NT60 SYS- The boot sector of the system partition will be overwritten with code compatible with BOOTMGR. You can learn more about using the bootsect.exe utility by running it with the /help parameter.

Bootrec.exe /ScanOs- Launched with the key / ScanOs, the utility scans all disks for installed Windows Vista and Windows 7 operating systems. In addition, when used, it displays a list of found systems that are not currently registered in the Windows boot configuration data store (Boot Configuration Data (BCD) Store)

Bootrec.exe /RebuildBcd- Launched with this key, the utility scans all disks for the presence of installed Windows Vista or Windows 7 operating systems. Found operating systems are displayed in a list from which they can be added to the Windows boot configuration data store (Boot Configuration Data Store). Also use this option if you want to completely rebuild the boot configuration data store. Before doing this, you must delete the previous storage. The set of commands could be as follows:

bcdedit /export C:\BCDcfg.bak
attrib -s -h -r c:\boot\bcd
del c:\boot\bcd
bootrec /RebuildBcd

In the above example, the current boot configuration store is exported to a file C:\BCDcfg.bak, the “system”, “hidden” and “read-only” attributes are removed from it, after which it is deleted with the DEL command and rebuilt with the command bootrec /RebuildBcd.

Of course the utility Bootrec.exe is very functional, however, it will not help if, for example, the Windows bootmgr file is damaged or physically missing. In this case, you can use another utility, also included in the Windows 7 distribution media - bcdboot.exe.

Restoring the boot environment using BCDboot.exe

BCDboot.exe is a tool that is used to create or restore a boot environment located on the active system partition. The utility can also be used to transfer download files from one hard drive or partition to another.

The command line in this case might look like this:

bcdboot.exe e:\windows

Replace e:\windows to the path appropriate for your system. This operation will repair a corrupted Windows boot environment, including the Boot Configuration Data (BCD) store files, including the file mentioned above bootmgr.

Syntax of bcdboot command line parameters

The bcdboot.exe utility uses the following command line parameters:

BCDBOOT source ]

source- Specifies the location of the Windows directory used as the source when copying boot environment files.

/l- Optional parameter. Sets the boot environment language. The default is English (US).

/s- Optional parameter. Specifies the drive letter of the system partition where the boot environment files will be installed. By default, the system partition specified by the BIOS firmware is used.

/v- Optional parameter. Enables detailed logging mode of the utility operation.

/m- Optional parameter. Combines the parameters of the newly created and existing boot storage record and writes them to the new boot record. If an operating system boot loader GUID is specified, combines the boot loader object with the system template to create a boot entry.

Summary. The article discussed the principles of working with utilities bootrec.exe And bcdboot.exe, which are used to resolve problems related to the inability to start the Windows 7 operating system due to a damaged or missing boot loader

Share with friends or save for yourself:

Loading...