Thinkpad recovery partition win 8. How to return the laptop to factory settings if hidden partitions on the laptop are deleted

Lenovo laptops have a wonderful button. Thanks to this button, you can restore the system to its original state. All this is provided by the Lenovo OneKey Rescue program, which is built into the system, and in the event of a crash, Windows will start, and you will receive a laptop with a clean system, just like from the factory. But what to do if this system is broken and you really want to restore it? For example, when replacing a hard drive, this emergency recovery system crashes, how can I restore everything back into place?

Let's understand the concepts: OneKey Rescue is a disaster recovery system after a complete crash, installing Windows from scratch. And the OneKeyRecovery system will allow you to return to a previously created system image (possibly with installed programs and documents).

We will restore both of these systems.

1. Download the OneyKey Rescue program. Please note that this program is classified as engineering. Be careful and careful. We burn the program to disk. Since not all devices are equipped with disk drives, we need the UltraISO Premium Edition program to write the image to a flash drive.

How to use it:

1) Launch the program
2) On the File tab, select Open
3) Open the OKR7.iso file
4) Next, in the Bootstrap tab, select the option: Burn hard disk image
5) Make sure that the letter of your flash drive is in the Disk Drive item.
6) Format in FAT format

Let's write it down. Accordingly, in the BIOS settings, select boot from a flash drive or disk.

2. Clean installation. All partitions will be deleted and formatted. The first section is intended directly for the operating system, the second section is for your personal files, documents, music, etc. And the third section is systemic, hidden. It is just necessary for the program to work.

After launching the engineering disk, the system will ask you to select an installation option. Select 1st (Clean installation, recommended). But you can try other options. Next, partition drive C, select the language (18.RU-RU)

Further installation will take place without our participation. Just waiting for the installation to complete. Now install any system on drive C. If you wish, an original disk from Lenovo with automatic activation of Windows via BIOS.

If desired, install essential programs and drivers (all this will be included in the emergency image).

The last step is setting up a clean system image. Turn off the laptop and start it with the NOVO button (if that doesn’t work, load the OS and press the NOVO button, but in this case the correct creation of a system image is not guaranteed).

In the window that appears, click OneKey Recovery.

Press Ctrl + Left Shift + O to open a command line window. Now you need to find out what letter OKR is under. Typically, the OKR letter should be G or F.

But it's better to check. We check this way: in the open command line, type DIR G: - a list of folders should appear, the ONEKEY folder should be present in it. If it doesn’t work, try another letter, and so on until the result is achieved. Once it works, on the command line we type:
G: DIR - press enter
CD ONEKEY\OSIMAGE - enter
OSIMAGE.EXE /FB - enter

Wait 10-15 minutes and you're done. Now you can restore the system from scratch. The advantages of this method are obvious. After all, reinstalling the system will take only 15-20 minutes! Still have questions? Write in the comments.

The development of technology, the emergence of new generations of components that work much faster and are more economical, makes it possible to extend the life of computers and delay the need to purchase a new, more productive model. One option for such an upgrade would be to replace a traditional hard drive with its solid-state counterpart.

Considering the excellent speed characteristics of such disks, using them as system disks is the best solution. We will tell you about possible problems that may arise when transferring a system partition from a classic hard drive to an SSD. We will talk about the Windows 8 system installed on a Lenovo laptop, and similar issues of modernization, repair, and computer setup Apple We'll leave it for another time.

Wim image binding

Windows 8 has a factory reset mode when problems occur that cannot be fixed by any other means. This will entail the loss of all installed programs, settings, personal data, etc., but all defects in operation will disappear, and the system will return to its original form.

When replacing a disk and after the accompanying procedure of transferring the system from an old disk to a new one, it happens that the binding to the Windows 8 system recovery environment of the OS wim image with factory settings is broken. It is contained in the hidden Recovery partition. The result of violating this binding is the impossibility of rolling back the system to factory settings.

Next, we will describe the process of how to restore the wim image binding. For example, we used a Lenovo laptop with a UEFI BIOS. The algorithm of action will be similar for devices from other manufacturers. The difference may lie in the names of menu items and some other little things.


If you don’t have confidence in your abilities, and what is described below looks too complicated, then it would be best to go to the launch.rf workshop computer repair in Otradnoye and find out when they can help you with this problem.

You need to go to the Disk Management utility. There we will see that all partitions, including the hidden Recovery, on the system disk are intact.


First of all, make sure that the recovery environment is enabled by entering “reagentc /info” in the command line.

In response, we will receive a message that the recovery environment is disabled. This happened after migrating the system from an old hard drive to an SSD. You need to turn it on. The command “reagentc /Enable” is intended for this.

The REAgentC program will report that the recovery environment (Winre.wim file) is enabled, and its standard location is in the hidden first partition of the disk - \\?\GLOBALROOT\device\harddisk0\partition1\Recovery\WindowsRE. The problem is that the location of the recovery image is unknown. This means that if you use Push-Button Reset Overview, the Windows installation DVD will be used as the image.


Previously, we established that we have all the necessary partitions, including the hidden Recovery with the wim image, and the problem is the missing connection between this image and the system recovery environment. Let's start restoring the connection. You will need a command line where you need to enter several commands in sequence:

  1. "Diskpart".
  2. “lis vol” – a list of all disk partitions is displayed.
  3. “sel vol 4” – select the partition containing the desired recovery image.
  4. “assign letter M” – assign the letter “M” to section 4.
  5. “exit” – exits the Diskpart utility.


Now you should open “Explorer”, in which the “M” drive will appear. To control, you can check that the “install.wim” file containing the factory image of the system is located on this drive.


Let's return to the command line and continue working. “M:” – with this command we go to the “M” drive.

The next directive is “attrib /s /d”. With its help, the full paths of files located in the directory and subdirectories on a given disk and their attributes are displayed on the screen. We see that the “Factory” subdirectory we are interested in has attributes S “system”, H “hidden”, R “read only”, which we do not need and need to be cleared.


To do this, enter the commands:

  1. “cd OKRBackup\Factory” – change the current directory to L:\OKRBackup\Factory.
  2. “attrib -s -h -r /s” – remove the listed attributes from all files in this directory.
  3. “attrib /s /d” – control that attributes have been removed.


“C:” – goes to the system drive.

Now we bind the wim image with the command “reagentc /setosimage /path M:\OKRBackup\Factory /index 1”. If everything went well, then when you roll back to the original settings, information from the desired disk partition (from the wim image) will be used. To verify this, you can run the command "reagentc /INFO".


Push-Button Reset Overview (one-button system reset)

Just in case, we will briefly describe the procedure for returning to factory settings. You need to go to “Options”.



Click the “Start” button in the “Remove all data and reinstall Windows” item.


A warning window will appear telling you what action will be taken. You need to click the “Next” button.


The system rollback procedure to factory settings will begin.

If the OS does not start

You need to boot from the Windows 8 installation media, click “Next”.


Click "System Restore".


In the “Select Action” window that opens, click “Diagnostics”.


Select the “Return the computer to its original state” mode.



Then select “Windows 8.1”.


The last window will open, in which you can click the “Return to original state” button.


The process of restoring the system to factory settings will begin.


Reading reviews from owners of a Dell 7720 laptop with pre-installed Windows 8 about the difficulties in deploying this same Windows 8 from the Recovery partition of the laptop hard drive onto SSD drives, or more precisely, the inability of the Dell Backup and Recovery utility to deploy the factory image on an SSD, I set out to do a recovery system to an SSD disk from an image file manually. It turns out to be an interesting situation - people, having bought a laptop, paid for pre-installed Windows 8, but they cannot transfer it to an SSD, they cannot update it from there to Windows 8.1 for free.

The recovery image file on the Recovery partition is divided into 4 parts: Install.swm, Install2.swm, Install3.swm, Install4.swm.

Let’s conditionally divide the whole process into stages:

  • Building a factory image file Install.wim of four parts into which it is divided: Install.swm, Install2.swm, Install3.swm, Install4.swm.
  • Preparing an SSD disk, creating partitions for system deployment.
  • Install.wim to the prepared section.
  • ESP(EFI System Partition) partition.

Building the factory image file Install.wim

To compile the file, it is perhaps most convenient to use the installed OS: this can be an additional system on a laptop or a system on a home desktop computer. I won’t describe how to put the Install.swm, Install2.swm, Install3.swm, Install4.swm files there.

The most troublesome thing will be for Windows 7 owners, because... To merge the file, they will have to download and install a package on the system Windows AIK for Windows 7 weighing approximately 1.2 GB: download (the package is installed entirely and its main weight consists of wim images for building WinPE), or the package Windows ADK for Windows 8 weighing 2.5 GB: download. This is an on-line installer. Here is the complete set on the torrent tracker. It has a custom installation and you can install only 40 MB by checking only the second item from the top. I gave links to the download as an example, you can search for them on the Internet and download them yourself.

Place the files Install.swm, Install2.swm, Install3.swm, Install4.swm. to the root of drive C. Why exactly to the root of the disk? Yes, it’s just that the commands entered will be shorter, specifically to the root of the C drive, because some have only one C partition and others don’t.

Windows AIK for Windows 7, then run the deployment tools command line as administrator and use imagex collect the file by entering the command imagex /export c:install.swm 1 c:install.wim /ref c:install*.swm

As you can see from the screenshot, assembling the file took more than 2 minutes when the final file size was more than 13 GB (the image was assembled on another SSD).

If you have Windows 7 and have installed Windows ADK for Windows 8, then run the command line of the deployment and imaging tools environment as an administrator, and using DISM collect the file by entering the command


If you have Windows 8, then you are the luckiest: there DISM already built into the system, you don’t need to download anything additional, just run the command line as administrator and run the previous command to build the file dism /Export-Image /SourceImagefile:C:install.swm /SWMFile:C:Install*.swm /SourceIndex:1 /DestinationImageFile:C:Install.wim

That's it, the file is collected. This is Install.wim in the root of drive C. Which of the three proposed methods you will proceed with is up to you to decide. Surely there are other ways.

Preparing an SSD disk, creating partitions for system deployment

Preparing an SSD disk includes creating ESP(EFI System Partition) partition where the download files will be located and the creation of a partition for the future system. Because There is always not enough space on the SSD, so we will not make any recovery partitions, MSR We will also not create a (MicroSoft Reserved) section as it is unnecessary - we only need the system. By the way, the 128 MB MSR partition is present on the vast majority of GPT disks, and their owners do not even know that they have 1 more partition than they think: it is not visible in disk management, and, for example, Acronis Disk does not see it either Director.

Launch the command line. To do this, we boot from the WinPE4 disk. You can connect the SSD to a running Windows 8 system and call the command line from it.

I booted from a WinPE4 disk, i.e. based on Windows 8.

Next I will write the commands, briefly explaining each one. Commands can be written in capital letters, and not like mine. I will also write commands without abbreviating words (sel, lis, dis, part, vol), i.e. completely, to make it more meaningful (select, list, disk, partition, volume).

diskpart(called the partition manager)
list disk(a list of disks will be shown, you need to remember the number of the SSD disk: 0, 1, etc. Let our SSD be disk 0)
select disk 0(select SSD disk)
clean(clear it completely)
convert GPT(convert it to GPT)
create partition EFI size=100 offset=1024(creating a 100 MB ESP partition with 1 MB offset)
format quick fs=FAT32(quick format it to FAT32)
assign letter=R(we temporarily assign any letter to the ESP section, for example, R)
create partition primary(creating a partition for all remaining space)
format quick fs=NTFS(quickly format it to NTFS)
assign letter=S(we assign any letter to the created NTFS partition, for example, S. I don’t know, maybe the letters C, D, E, etc. are already taken by you, so I took a letter from the middle of the alphabet. Don’t worry, the deployed system will be on drive C , as intended by the manufacturer, and these letters: R and S are given to partitions temporarily to copy download files (in this case from S to R).
exit(left diskpart)

Deploying a system from a factory image Install.wim to the prepared section.

  • Select tab Application(Apply).
  • As Source(Source) select the merged file Install.wim.
  • As Recipient(Destination) indicate the section we created with the letter S.
  • Press the button Apply(Apply).


Copying system boot files to ESP(EFI System Partition) partition

The command written below is executed on the command line: either a WinPE boot disk based on Windows 8, or on a Windows 8 system (this is if you have attached an SSD to it). Do not try to run this command from the Windows 7 installation disk and bootable WinPE made on its basis! Launch the command line of the WinPE4 disk and enter the command bcdboot S:Windows /l ru-Ru /s R: /f UEFI(let me remind you that the letters S and R were assigned by us earlier)
exit (exit command line)

The whole process, all 4 stages, took about 15 minutes. That's all, you can boot from the SSD disk, accept the license agreement, choose names for yourself and your computer, and now we are greeted with pre-installed Windows 8.

I'll add an important note

If at step 2 you chose to boot from a WinPE4 disk, then perform all the remaining steps from it without rebooting. Otherwise, all assigned letters will be lost. If you connected an SSD drive to a computer with Windows 8 installed, then also perform steps from two to four without rebooting.

Added a video to this article.

I hope it will be clearer this way. The video shows all stages except the first (gluing the system image file).

Note: You can buy an inexpensive branded ahd DVR at any time convenient for you by simply visiting the online store https://www.arax-cctv.ru/vregistrators/videoregistratory-ahd/". We recommend this company for cooperation!

That's all! Thank you for your attention and see you again on the pages of the site site

Introduction

So, you have finished installing the operating system, drivers, updates and programs, checked its performance and stability, were satisfied with the result obtained and want to be able to “roll back” to this system state in case of unforeseen circumstances.

Windows 7 is equipped with fairly powerful backup tools that can reduce the time it takes to restore the system.

Those who have bought new computers with Windows 7 pre-installed are familiar with the restore function, after which the operating system, and sometimes the contents of the entire hard drive, is returned to its factory state. In this case, user files located on the hard drive may be lost.

If you have an installation disk with the operating system, you are spared from such losses (How to reinstall Windows 7, saving settings and installed programs), but subsequent installation of drivers and updates is inevitable.

I offer you a method that will significantly reduce the time spent setting up the system after reinstallation; moreover, it does not require an installation disk.

The article uses materials from Vadim Sterkin's blog and Valery Volobuev's video report Setting up the Windows Recovery Environment in Windows 7.

The algorithm described below does not require specific knowledge and is relatively easy to implement for a home user. We will perform the task in the following order:

  • prepare a partition for the future recovery partition;
  • create a system image in the Windows RE environment;
  • configure the recovery environment;
  • Let's reinstall and reconfigure the recovery environment.

Preparing the recovery partition

First of all, we need to create a partition on which we will subsequently place the operating system image file, as well as the file for deploying the recovery environment.

There are many ways to perform this operation, I will use standard tools: Disk Management and the command line utility DISKPART. You can read about this in the article.

We will determine the partition size based on the current occupancy of the partition with the operating system and the availability of free space. For example, if the system takes up about 20 gigabytes, the optimal size would be from 5 to 10 gigabytes.

In my example, the section D:\ was first compressed

Figure 1 - compression of partition D:\

then in the resulting unmarked area

Figure 2 - Unallocated disk space after compression

using the utility DISKPART a primary partition was created, formatted, and a label was assigned to it Recovery and letter R. (DISKPART was used because the fourth partition created by Disk Management will be an additional partition. You can experiment with placing the recovery partition on an additional partition.)

Run sequentially:

::Start DISKPART Diskpart::Select a disk. If there are several of them, then the number of the required disk is determined by the command LIST DISK Sel disk 0:: Creates a primary partition on the entire unallocated area of ​​the disk. If necessary, specify the partition number using the LIST PART Create partition primary::Quick formatting of the created partition and assigning it the “Recovery” label Format LABEL=”Recovery” quick::Assigning the letter R to the partition Assign letter=R::Completing work in DISKPART Exit

Figure 3 - working in DISKPART

Here and in what follows we will work on the command line.

Before moving on to capturing an operating system image, create a R:\ folder WinRE for storing it.

Figure 4 - WinRE folder in the root of the future recovery partition.

Creating an operating system image

Once downloaded, launch the command line and text editor:

Using the "Open" menu (keyboard shortcut Ctrl + O) define the partition letters.

In my example, as can be seen from Figure 7, the system section received the letter D:\, utility imagex.exe is in the folder E:\WAIK Tools\, and the section Recovery- letter F:\.

Figure 7 - partition letters in the WindowsRE environment.

One note: since we will not need to transfer the customized image to another computer, we will use the command given in the “Boot to Windows PE and save the image using the ImageX utility” section of the above article. Run the command:

"E:\WAIK Tools\amd64\imagex.exe" /capture D: F:\WinRE\install.wim "Windows 7 Ultimate SP1 Custom"

Necessary clarifications:

  • "E:\WAIK Tools\amd64\imagex.exe"- Path to the imagex.exe utility. Quotes are used to avoid problems with spaces in the folder name.
  • /capture D:- The key indicates the capture of the system image located on the D: partition (as seen in WindowsRE).
  • F:\WinRE\install.wim "Windows 7 Ultimate SP1 Custom"- Saving the captured image to the install.wim file (this is important, since in this case only this name is valid) in the F:\WinRE folder. A file comment is specified and the default compression method is used. For more information, see the TechNet knowledge base article ImageX Command Line Options

Figure 8 - creating an operating system image in the Windows RE environment

Quit WindowsRE and reboot. Let's move on to the final stage of creating a recovery partition.

Setting up the recovery environment.

In addition to the operating system image file, I decided to place a file on the new partition that would boot into the recovery environment. With this arrangement, it will not depend on the partition with the operating system.

As you know, the recovery environment is deployed from an image file WinRE.wim located in the folder Recovery at the root of the system partition. Access to this folder is blocked through Windows Explorer. The file attribute is hidden system. How to place the file in the location we choose? Let's use command line utilities.

First, disable the recovery environment. Please note that Any actions with the recovery environment must be preceded by disabling it! To do this, on the command line run

Reagentc /disable

After running this command the file WinRE.wim will move to the folder c:\Windows\System32\Recovery . From it we will copy the file to the folder R:\WinRE. Use the command xcopy with key /h:

Xcopy /h c:\Windows\System32\Recovery\winre.wim r:\WinRE

Figure 9 - copying the WinRE.wim file

And finally, a few final chords:

::Set custom path (key /path) to the system image file located in the folder specified by the key /target Reagentc /setosimage /path R:\WinRE /target c:\Windows::Setting a custom path (key /path) to the system recovery environment deployment file located in the folder specified by the key /target Reagentc /setreimage /path R:\WinRE /target c:\Windows::Enable the recovery environment Reagentc /enable::Check the recovery environment settings Reagentc /info

As can be seen from Figure 10, the setup was successful. Do not close the window - the command line will still be needed.

Figure 10 - Setting up a custom recovery environment.

It will be interesting to see what changes have taken place in the section Recovery. To do this, enable the display of hidden and system files.

Figure 11 - changing the contents of the R section.

As you can see, the file WinRE.wim in folder WinRE no, but a folder appeared Recovery at the root of the section. Believe me, the file is now in it. I will not dwell on the structure of the Recovery folder - if you wish, you can study its contents and also compare it with the BCD parameters (using the bcdedit / enum all command).

All that remains is to protect the section from accidental impact from users. To do this, you need to hide it from Explorer and exclude the ability to work with it in Disk Management. The utility will help us with this again Diskpart. On the command line, run sequentially (the disk and partition numbers correspond to the configuration given in the article):

::Start DISKPART Diskpart::Select a disk. If there are several of them, then the number of the required disk is determined by the command LIST DISK Sel disk 0:: Select a partition. If necessary, specify the partition number with the command LIST PART Sel part 4::Removing a letter - the partition will be hidden in Windows Explorer Remove::Setting the partition identifier ID=27. This ID is set specifically for recovery partitions. It becomes impossible to work with such a partition in Disk Management, which provides additional protection for it Set id=27

Figure 12 - working with the recovery partition in DISKPART

Changes that have occurred in the system

Firstly, the partition is not visible in Windows Explorer, and it does not have a context menu in Disk Management.

Figure 13 - Explorer and Disk Management Manager.

Secondly, in the Advanced Recovery Methods window in the description of reinstalling Windows, there is no requirement to have an installation disk.

Figure 14 - Windows advanced recovery methods menu.

Thirdly, the recovery environment menu has changed:

Figure 15 - additional menu item in Windows recovery options in the recovery environment

This could have been the end of it. But there is a need to dwell on several nuances that arise after reinstalling the system in this manner. I will reinstall the system from the recovery environment.

Setting up a recovery environment after reinstalling the system

For the purity of the experiment, I will format the partition with the system and the partition with the download files. Moreover, I strongly recommend formatting the “System Reserved” section to avoid confusion with loading in the future.

Figure 16 - formatting partitions in the WindowsRE environment.

No user participation is required during the reinstallation process. You will receive a system identical to the one you had at the time you took the image.

Figure 17 - beginning of system reinstallation.

The only thing is that after reinstalling you need to make a few changes:

  1. Due to a complete rebuild of the BCD, the recovery environment must be reconfigured.
  2. hide section in explorer Recovery.

Disable the recovery environment with the command

Reagentc /disable

Turn on display of hidden and system files, open the folder WinRE on the section R:\ and make sure the file exists Winre.wim. If necessary, copy it from the folder Windows\System32\Recovery or from a folder R:\Recovery \xxxxxxxx -xxxx -xxxx -xxxx -xxxxxxxxxxxx.

After this delete the folder Recovery on the section R:\.

Figure 18- deleting the Recovery folder

Then enable the recovery environment:

Reagentc /enable

Make sure the settings are correct (note that the name of the folder in which the WinRE.wim file is located in the Recovery folder is different. Therefore, before connecting the recovery environment, you can safely delete the old one.):

Reagentc/info

Figure 19 - connecting the recovery environment after reinstallation.

Remove the letter from the partition R:\

Diskpart Sel disk 0 Sel part 4 Remove Exit

Your computer is ready for a fresh reinstallation.

One final note. While performing numerous reinstallations while preparing this article, I noticed the appearance of an incomprehensible folder in the list of available drives on the “System Protection” tab. This may be due to the missing folder in the system image System Volume Information or changing section IDs.

Figure 20 - phantom partition in the list of available disks on the “System Protection” tab.

To get rid of the strange folder, disable system protection on this phantom partition and enable it on the partition with the current system.

Conclusion

There are probably easier ways to make reservations, especially using different programs. I don’t pretend that you will definitely use the method described above, but I think it’s convenient and practical.

Of course, the system will be updated over time. To keep the image up to date, periodically rewrite the file in Windows RE Install.wim.