Restoring the boot of the windows partition from the command line. System recovery via command line

Restoring a hard disk or flash drive does not always require the use of special software; sometimes errors can be resolved using a built-in Windows utility called CHKDSK (check disk). This program will check the disk for errors and fix them if found. CHKDSK can be launched in several ways, but we will dwell on the command line option in detail.

Command line recovery

To perform hard disk recovery using the CHKDSK utility, run the command line:

  1. Press Win + R and execute "cmd".
  2. Enter a command like "chkdsk E: / F / R".

If the disk is in use by the system, the computer will restart to perform the check. Correcting errors on a USB flash drive using the CHKDSK utility does not require a reboot.

Let's analyze the command syntax:

  • "Chkdsk" - starts the verification utility.
  • "E:" is the letter of the hard disk or flash drive partition that needs to be checked using CHKDSK.
  • "/ F" - error correction.
  • "/ R" - recovery of bad sectors.

If you don't like working with the command line, run a disk check through the Windows interface:

Checking a partition of a hard drive or flash drive through the Windows interface is no different from this procedure in the command line. If the disk partition is in use, the system will reboot.

Windows won't boot

If the system constantly restarts or does not boot at all due to hard disk errors, then to restore the hard drive through the command line, you will have to use the tools of the installation flash drive. If you have Windows XP, then start the recovery console:


If the verification utility is able to detect and eliminate errors and bad sectors, then after rebooting you will get a normally functioning system.

On Windows 7, after the first screen of the installer appears, you need to go to the "System Restore" section. On Windows 8.1 and Windows 10, the section is called "Diagnostics", it has a subsection "Advanced options". Select Run Command Prompt from the list of available tools.

At this point, many users make the mistake of typing chkdsk without considering the drive letter of the Windows installed. The problem is that in the recovery environment, letters are assigned a little differently - "C" stands for a 100 (500) MB partition allocated for the needs of the system, and the volume with Windows files becomes "D", etc.

To find out the exact letter, type "notepad" in the command interpreter window and press Enter. Notepad will open: expand the File menu, click Open. In the Explorer window, go to "Computer" and see what letter is assigned to the partition with Windows files.

Having recognized the letter of the section, write it in the command syntax: for example, chkdsk D: / f. The disk check will start. If you need to scan your hard drive for bad sectors, then run chkdsk D: / f / r. When prompted for a failure to execute, type "Y" and press Enter.

The disk check and repair will start. If everything was done correctly, then after the completion of the procedure, the system will work correctly. Do not forget to remove the boot from the flash drive if you set it up in the BIOS, otherwise Windows will not start.

The Windows 10 operating system is very easy to use. Any user will be able to understand it and even cope with certain problems on their own. Unfortunately, sometimes there are too many errors, and they cause damage to system files or lead to other serious problems. The Windows restore option will help fix them.

Reasons to use Windows recovery

The main reason is the failure of the operating system to boot. But this malfunction itself can arise due to various factors. Let's analyze the most common ones:

  • Damage to files by viruses - if the OS files are damaged by a virus attack, the system may malfunction or not boot at all. Therefore, it is necessary to restore these files for normal operation, as there is no other way to solve the problem;
  • incorrectly installed update - if an error occurred during the update or some of the files were installed incorrectly for another reason, then instead of completely reinstalling the broken operating system, its restoration will also help;
  • damage to the hard drive - the main thing is to find out what the problem is. If the disk is physically damaged, then you cannot do without replacing it. If the hitch is in how it works with data or any OS boot settings, recovery can help;
  • other changes to the registry or system files - in general, almost any changes to the system can lead to errors in its operation, from minor to critical.

Recover directly from the Windows 10 system itself

Conditionally, you can divide the recovery methods into those used before the system is booted and those that are used already when the system is booted. Let's start with a situation where Windows boots correctly and you have the ability to use programs after it starts.

Using a restore point to roll back the system

First, you need to configure directly the system protection itself, so that it is possible to create and store restore points. To do this, follow these steps:

Now you can proceed to create a restore point:

When the point is created, you need to figure out how to return the system to the state at the time of its creation, that is, to roll back to the restore point:


Another way to access restore points is in the diagnostics menu, which opens through the "Settings" Windows 10 (Win I). This menu works in exactly the same way.

You can also use restore points through advanced system diagnostics options

Resetting the operating system to factory settings

There is another way to recover in Windows 10. Instead of a complete reinstallation, it is possible to simply reset the system to its original state. Some programs will become inoperative as all registry entries are updated. Save the required data and programs before resetting. The very process of returning the system to its original form is carried out as follows:


Video: Factory Reset Windows 10 Tablet

System data recovery through "File History"

"File history" - the ability to recover damaged or deleted files for some time. It can be very useful when you need to get back missing videos, music, photos or documents. As with restore points, you need to configure this option correctly before applying:


This way, you will be able to recover files, unless, of course, the disk has been subjected to complete data wiping. Now let's figure out how to recover a lost file:


Video: recover Windows 10 on your own

Non-login recovery methods

If the operating system does not boot, then it is more difficult to restore it. However, acting strictly according to the instructions, and here you can cope without problems.

Recovering the system via BIOS using a bootable media

Using a bootable drive, you can start system recovery through the BIOS, that is, before Windows 10 boots. But first, you need to create such a drive:


Nothing else is required of you. The boot drive will be created, and you can proceed directly to the system recovery. First you need to open the BIOS. This is done by pressing different keys when turning on the computer, which depend on the device model:

  • Acer - most often the buttons for entering the BIOS from this company are the F2 or Delete keys. Older models used entire keyboard shortcuts, such as Ctrl + Alt + Escape;
  • Asus - F2 almost always works, especially on laptops. Delete is used much less frequently;
  • Dell also uses the F2 key on modern devices. On older models, it is better to just look for instructions on the screen, since the combinations can be very different;
  • HP - laptops and computers of this company enter BIOS by pressing Escape and F10. Older models did this using the F1, F2, F6, F11 keys. On tablets, F10 or F12 are usually used;
  • Lenovo, Sony, Toshiba - like many other modern firms use the F2 key. This has become practically the standard for entering BIOS.

If you did not find your model and could not open the BIOS, carefully study the inscriptions that appear when you turn on the device. One of them will indicate the desired button.

Once you get into the BIOS, do the following:


Creating a bootable disk from an image

If you still need a bootable disc for system recovery, and not a flash drive, then you can create it using the ISO image obtained earlier, or use a ready-made installation disc with the same OS version. Creating a bootable disk is done as follows:


If recovery fails, you can always simply reinstall the operating system using the same disk.

System recovery via command line

The command line is an effective tool for solving the problem with loading the OS. You can also open it through the diagnostics menu, which was opened using the boot drive:


Another way will require you to define the name of the section:


In addition to these, there are a number of other commands that you may find useful:


Just try entering these commands one at a time: one of them will cope with your problem.

Video: Windows 10 Boot Repair via Command Prompt

Repair error recovery

When trying to restore the system, you may receive an error with the code 0x80070091. It is usually accompanied by information that the recovery has not been completed. This issue occurs due to an error with the WindowsApps folder. Please do the following.

Some users in their lives are faced with the need to restore the Windows system. In this article, we will look at what a system restore is, how to do it, and all the additional points of this issue.


Content:

What is it for? System Restore can help if your computer stops working properly. This condition is caused by the installation of virus software that makes changes to the PC registry or inept / harmful actions of the user himself.

When might a system restore be required?

  • The computer is hopelessly buggy, slows down, does not boot.
  • After installing a program, windows began to pop up, reporting errors at the RAM level.
  • The computer boots up to the windows welcome window, after which the computer restarts.

Windows System Restore- This is the restoration of the state of the OS, files and programs on the computer until the moment when the malfunction began. Sometimes the user misunderstands the meaning of System Restore and means returning to a previous version of Windows. For example, from windows 8 to windows 7. In fact, when the system is restored, its version does not change.

There are many ways to "breathe life" into your operating system, but we will look at 2 of the simplest Windows rollbacks:

  • System recovery using BIOS,
  • Recovery using the command line.


It is worth noting initially, windows 7 system recovery can only be performed if the recovery function (service) was launched earlier, before the problems appeared. If it was not enabled, then you can only rollback using the Windows boot disk.
To activate the Windows recovery service, you need to go to the "Control Panel", this can be done from the "Start" menu. Next, we are looking for an icon with the name "System Restore". Next, click on the tab with the name "Start recovery", the system will give us a message - the recovery service is disabled and will offer to activate it.

Typically, the first time you start Windows, a restore point is saved, even if the restore function has been disabled. To see the list of your restore points, you need to click the "View other restore points" button.

If this function has already been launched before, it means that we can immediately start starting the system recovery procedure. Click "start system recovery", select a restore point, click "next" and "done". The recovery process is launched, as soon as it is over, the computer will restart, after which you can start working.
What to do if System Restore doesn't work?

The most common problem is the not enabled recovery service. How to activate it is written above.

Of course, the option of its complete inoperability cannot be ruled out. Very often this can be found if a non-licensed version of windows is installed.

Is a system restore without a restore point possible?

Most likely, you have already entered the System Restore Center, activated the restore service and found that there is no backup point - it means that you cannot choose to which state you cannot roll back the system. Don't worry, your system can still be recovered!

System restore without a restore point can be done using the command line. It is recommended to strictly follow the instructions so as not to break anything. We will look at how to roll back the system using the command line below.

By the way, it is not necessary to use a disk, you can do a system recovery from an image by first re-encoding it and writing it to a USB flash drive.


Windows recovery software

If your operating system isn't quite dead, i.e. it is still loading and working somehow. Or, for example, the built-in Windows system recovery tools do not help - try using special programs for Windows recovery, such as:
1. - a program that will help you both restore the OS (registry, boot areas, access rights), and scan your PC for viruses and errors in files.
2. - this software is mainly focused on backing up files, logical disks (partitions), but Acronis can also restore Windows and even Mac OS.

How to restore the system via BIOS?

A huge advantage of this method is a successful system recovery even in the most difficult cases, the main thing is that the computer or laptop is turned on.
Make sure you have your Windows installation disc (bootable disc) handy and insert it into your floppy drive. Now we need to enter BIOS. When you start the computer, press the F12 key, go to the Boot -> BootDevicePriority menu - select the DVD drive in the first place, if you are using a disk, if the USB flash drive is USB HDD.

Restart the PC again, the Windows installer should now start. Often, when the PC boots up, an inscription in English pops up, which requires you to press any key to start booting from the disk. If this is not done, the computer will continue to boot in normal mode after 10 seconds from your HDD, and not from a bootable USB flash drive / disk as we need.

So, we booted from the disk and now in the installation menu, select the item "System Restore", click "Next". After that, you have to select a restore point, it is best to use the first successful launch, but the programs you need may not have been installed there yet. Those. you will lose programs (and data in them) that you installed after creating the restore point. Press "Next" again, now the system will be restored. When the process is completed, click "Yes, done." We reboot the system, after removing the disk / flash drive from the drive.

System recovery via command line

This method is recommended if a system restore point is missing. Again, we need a bootable Windows operating system disk. Exactly the one that is installed on the computer.
You can view the OS version by right-clicking on the "My Computer" icon and going to the "System" tab.
If you have a system restore point, then you just need to boot into the command line mode (for this you need to press the F8 key when loading the OS and select the item "Boot in safe mode with command line support"). Then enter the command "rstrui" and follow the instructions.


1. If the boot sector of your OS is damaged.
Enter “fixboot” on the command line, press “Enter”, then enter “fixmbr” and press “Enter”. Everything, the boot sector of your windows is restored, you can restart your computer in normal mode.

2. If the boot file boot.ini is missing.
Enter "bootcfg / rebuild" on the command line, press "Enter". We answer all possible questions of the system by entering "Y" and pressing the "Enter" button.

3. If you have a corrupted config in the system32 folder.
We insert the disc with your version of the operating system into the drive, enter in the command line "cd repair copy SYSTEM C: \ windows \ system32 \ config", press "Enter", it's done!

4. If files “ntldr” or “ntdetect.com” are missing and the system displays messages like: “NTLDR is missing at Windows startup”.
Enter in the command line "copy J: \ i386 \ ntldr C: \", press "Enter" (Where J is the letter of the important drive, and C is the letter of your system drive on which your OS is installed).

If you do not want to restart your computer, you can restore the system through the command line from windows. We insert the disc into the DVD-ROM, while the computer must be booted. Now you need to start the command line. To do this, in the Start menu, click Run or press the Windows + R keyboard shortcut.
We enter the following value there: "sfc / scannow", click "OK" After that, all broken distributions of the system will be copied from the boot disk automatically. System restore, rollback is pretty quick and hassle-free.

How is System Restore different for notebook brands: Asus, Acer, Lenovo, HP, Sony, Samsung, Toshiba, Bell, Dell, Vaio, etc.?

I want to note that there are no major differences here. It is possible that there are different versions of BIOS, but there the intuitive interface and the names of the tabs are saved. With this, there should be no problems.
The second point is the BIOS entry key, they differ for these manufacturers. But this is not a problem either, you can see what you need to click on the picture that appears when loading.

  • Acer - F2;
  • Dell - F2 or F1;
  • Toshiba - F1 or Esc;
  • Sony - F1, F2 or F3.


Sometimes after a system rollback, when you first start a laptop or computer, a message with this error pops up - this means that the recovery was not completed successfully and strongly recommends trying again with a different restore point.

Try to recover on a different, earlier recovery date. If after that such an error pops up, then the problem is much deeper. This means that the problem is with viruses on your system that have corrupted the information about the system restore points.

To restore the system with error 0 xc 0000022 - use the command line method. These restore points play no role in this method. After all the files have been restored, and you have checked the system for operability, you need to delete all existing restore points from the computer and make a new one, which you can count on in the future. You can perform such manipulations through the "System Restore" menu in the control panel.

3 more useful articles:

    Windows Repair is a rare type of software that can rid your personal computer of almost all ...

    Acronis is a pretty famous program. When developing this software, the developers focused on ...

    A program that checks the strength of passwords of system users. This utility is used by network administrators to calculate users with ...

The command line is a standard operating system tool that is used to enter commands. The specificity of the console allows you to launch the recovery tool, both from the user interface and in case of a damaged system.

Making a copy of the system

It is impossible to restore Windows 10 without a foundation, which is a user-created image (serviceable) or a system distribution kit.

Since the topic of the article is about rollback via the console, we will use the option of creating an OS image using the command line.

To enter the console, you can use the internal system search or the window that is invoked by pressing the WIN + R keys. Enter cmd:

In order to create a folder for storing Windows 10, enter mkdir c: \ Imagen-Restaurar. Where:

  • Drive C is the storage location for the copy folder. It is set manually by the user. The command allows you to write a copy not only to your hard drive, but also to an external device. To do this, it is enough to enter the letter designation of the flash drive / disk;
  • Imagen-Restaurar - the name of the folder that contains the image.

Comment. After entering this command, the console will not sound any signals, but the folder will be created. To be on the safe side, check the disk.

The recimg / createimage c: \ Imagen-Restaurar command creates the image itself and places it in the specified folder.

After entering the command, the Windows 10 backup procedure is initiated, which lasts an average of 20-25 minutes. It is recommended not to work with the computer during this time. At the end of the process, a characteristic inscription will appear in the console, stating the successful creation and registration of the image for recovery.

A few nuances when working with the command line in Windows:

  • Do not use a space to separate words, do it with a dash (-);
  • During copy recording, the process may hang for a long time at the value of 1%. This is fine;
  • It is strongly discouraged to change the name of the standard folder, since during the rollback of Windows 10, the image is searched for in specific places;
  • As soon as the copying process is over, go to the specified path and check the presence of the CustomRefresh.wim file in the folder. If not, then copying was unsuccessful.

Restoring Windows 10 using the command line

Despite the fact that the console is a manual recovery method, no special knowledge is needed to carry out the procedure, since the meaning of all commands is written in Russian.

Before starting a rollback, you should insert a disk or flash drive with a copy / distribution kit and boot from this device. A window for selecting an action will appear, in which you need to click on diagnostics and then go to the section of additional parameters:

In the additional settings section, select the command line launch:

After this action, a console will appear, into which you can enter bootrec.exe. The line will give a list of all possible commands with their detailed description:

The teams solve the following problems:

  • FixMbr (alternative to fixboot) - used when the boot sector of the system HDD is damaged by malware. By entering the command, the system will automatically fix these problems, and the user will be able to log into Windows 10 in normal mode;
  • Bootcfg is intended to solve the problem in the absence of the boot.ini file. To restore functionality, you must enter a command with the rebuild attribute. The result is Bootcfg / rebuild;
  • CD repair copy SYSTEM C: \ windows \ system32 \ config - used when the config file is damaged in the system. After entering the command, prompts will be displayed in the console. We answer all yes, by pressing the Y key ;
  • Copy J: \ i386 \ ntldr С :\ - fixes the error "NTLDR is missing", which is associated with the absence of system files. J is the letter of the drive containing the image or distribution. C- the disk where the system is stored on the computer.

Comment. Each system is individual to some extent, so the user must know exactly the drive letter of his computer.

For many years, Microsoft has been improving the Windows operating system recovery system, and in Windows 7 and Windows Vista it works almost automatically. If you boot from the Windows 7 installation disc and click " System Restore" ("Repair Computer"), the Windows recovery system will start and independently try to fix all the errors it finds. It can fix a large number of problems, however, it is quite possible that the bootloader is damaged, and the recovery system cannot cope with this problem. you can manually restore the bootloader using the Bootrec.exe utility.

The Bootrec.exe application is used to fix errors related to a damaged bootloader and, as a result, the inability to start operating systems Windows 7 and Windows Vista.

Sequencing

Description of startup keys for 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 troubleshoot a corrupted master boot record or if you want 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. Use this option in the following cases:

  1. The boot sector of Windows Vista or Windows 7 has been replaced with a non-standard one.
  2. The boot sector is corrupted.
  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 NT 6 boot loader code (Bootmgr) will be overwritten by the Windows XP setup program ...

It should be noted that this effect can be achieved using the bootsect.exe utility, also available on the Windows 7 bootable media. To do this, run bootsect.exe with the following parameters:

Bootsect / NT60 SYS

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

Bootrec.exe / ScanOs

Launched with the / ScanOs switch, the utility scans all disks for installed Windows Vista and Windows 7 operating systems. In addition, when using it, a list of found systems is displayed that are not currently registered in the Windows Boot Configuration Data (BCD ) Store).

Bootrec.exe / RebuildBcd

Launched with this key, the utility scans all disks for installed operating systems Windows Vista or Windows 7. Found operating systems are displayed in a list from which they can be added to the Windows Boot Configuration Data Store. Also use this option if you want to completely rebuild the boot configuration data store. Before that, you need to delete the previous store. In this case, the set of commands can 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 repository is exported to the 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 bootrec / RebuildBcd command.


Enlarge drawing

Of course the utility Bootrec.exe very functional, however, it will not help if, for example, the Windows bootloader file bootmgr damaged or physically missing. In this case, you can use another utility that is 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.

The command line in this case may look like this:

Bcdboot.exe e: \ windows

Replace e: \ windows with the correct path for your system.
This operation will repair the damaged Windows boot environment, including the Boot Configuration Data Store (BCD) files, including the bootmgr file mentioned above.

Bcdboot command line parameter syntax

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

BCDBOOT source]

source

Specifies the location of the Windows directory to use as the source when copying boot environment files.

Optional parameter. Specifies the language of the boot environment. The default is US English.

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

Optional parameter. Turns on the mode of verbose logging of the utility operation.

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

Summary

The article discussed the principles of working with the bootrec.exe and bcdboot.exe utilities, which are used to resolve problems associated with the inability to start the Windows 7 operating system due to a damaged or missing bootloader.