How to restore Onekey Recovery function after changing partition size. (Y580 and maybe others)

Discussion in 'Lenovo' started by link626, Sep 18, 2012.

Thread Status:
Not open for further replies.
  1. ntdatter@yahoo.com

    ntdatter@yahoo.com Newbie

    Reputations:
    0
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    5

    Thanks for all your help once again. I still have no success with this. I did make another bootable image of the OKR8 and tried it again, but the result was the same.

    I bought this machine as manufacture refurbished. Not sure how I managed to delete everything.

    But anyways, I'll get back to this once the final exams are done. It's that time of the semester again...
     
  2. keoanu

    keoanu Notebook Enthusiast

    Reputations:
    1
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    16
    You are welcome once again:)

    Is PRB_DRV partition still missing on your drive and LRS_ESP partition is visible in Windows after finishing OKR8 installation? Or is the disk structure the same as showed screenshot of disk manager?

    Was the OKR8 system working (with NOVO button) for you before that? I mean before deleting everything...

    Ok, don't worry, we will find a solution for you...Good luck in exams. Meantime I will try to find a some time to get familiar EFI system (also for NOVO button functionality)...
     
  3. miedzwin1

    miedzwin1 Newbie

    Reputations:
    0
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    5
    Hi guys,
    I had a very similar problem with my Lenovo Y510P. I bought it with no OS pre-installed, however I have my own Win8 OEM installation disk. First of all, I had removed all partitions and then did a clean Windows installation. After that I used OKR 8 bootable pendrive to install OKR and get Recovery button running. I ended up with the same result - recovery menu does not show up, furthermore - I damaged my windows installation (as I expected). Then, I used Gparted to remove all partitions ending with only one "partition" - unallocated disk space. I installed OKR 8 once again (according to the manual) and viola - OKR set all partitions correctly. Recovery menu is running. After a clean OS installation I ended up with working recovery button and installed OS. However, this is a half of success. OKR 8 bootable software is not able to do an initial backup of my system and I do not have it -for obvious reasons. I can use recovery menu only in one way: to recover previously stored backup file (by using OKR 8 software in windows).
    Does anyone know if there is a possibility to convert such ""regular backup" to "initial backup" and put it to hidden recovery partition?
    By the way, I have problem with using PTEdit32. It does show only one partition tagged with "EE" type, therefore I cannot unhide and edit the recovery partition. Anyone had such issue?
    Sorry for my English if any mistakes ;)
    Partition table from ptedit32 looks as below:
    partition_table.jpg
     
  4. keoanu

    keoanu Notebook Enthusiast

    Reputations:
    1
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    16
    Hi,

    First I would like to ask you for a one matter...If I understand, your NOVO button is working after the OKR8 installation as usual and I expect that you have EFI firmware mode in BIOS settings...Am I right? If so that's good news (I have tested the OKR8 system in virtual machine, so I wasn't able to test NOVO button's functionality)

    I don't know about the possibility to convert "regular backup" (backup made by user in windows as well) to "initial backup"...But you can do this manually and no conversion is needed.
    Please follow this mini-tutorial:) :
    1. Boot to OKR8 environment using NOVO/Recovery button
    2. Invoke the command prompt with "SHIFT+F10" (as soon as the OKR8 GUI will be visible)
    3. Find PBR_DRV partition letter (7.partition in order as default, you can use diskpart (type "diskpart" in cmd) with "list volume" command)
    4. Go to PBR_DRV (for instance "G:" if G is PBR_DRV letter) partition and then to "onekey\osimage" directory ("cd onekey\osimage")
    5. Run command "osimage /nopbr" and then "osimage /fb" (first set up that backup Windows8_OS partition is needed and second execute backup of system)
    6. After completion this process you can find initial backups that are used in Initial restoration process by OKR8 in "OKRBackup\Factory" directory:
    - Install.wim - Windows8_OS image - image of windows current windows installation with installed programs (located on that partition)
    - Winre.okr - WINRE image - image of 1.partition that stores Windows Recovery Environment
    - Boot.okr - EFI image - image of EFI boot partition (2.partition)
    - Lrs.okr - Lenovo OKR8 Boot image - image of 3.partition with Lenovo OKR8 boot environment (where to boot from NOVO button)
    - Info.ini - ini file with backup information, partition info
    - MBR.okr - MBR backup - this image is used for MBR disk (LegacyBios), for GPT/UEFI is no needed
    Note: After each use this manual backup Instrall.wim, Boot.okr, Lrs.okr, Winre.okr will be overwritten (PBR_DRV\OKRBackup\Factory directory). So don't forget backup previous versions if you want

    Regarding PTEdit32:
    I assume that PTEdit32 is usable for MBR/LegacyBios disks, not GPT/UEFI disks because of shows only 4 primary partitions (typically for MRB disks). GPT/UEFI disks uses up 128 primary partitions and the Lenovo OKR8 system uses 7 primary partitions specifically.
    To unhide LRS_ESP (Lenovo Recovery system/OKR8 boot partition) and PBR_DRV (Lenovo Backup partition for initial images) you can use diskpart in Windows:
    1. for LRS_ESP (default structure):
    -> "sel dis 0" (or another disk that stores Windows8_OS, 0 is default), "lis par" for list partition or/and "lis vol" to list volumes
    -> "sel par 3" to select LRS_ESP partition and "det par" for print info of partition that shows default id for that partition
    -> "set id=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7" to change partition id to basic partition (this unhide and mount LRS_ESP in Windows)
    -> after modification that you want to do you have to do revert process: "set id=BFBFAFE7-A34F-448A-9A5B-6213EB736C22" (set up partition id to default Lenovo partition id, thus unmount and hide partition) and optionally "gpt attributes=0x8000000000000001" if attributes was different from default state
    -> "exit" to exit diskpart
    2. for PBR_DRV (default structure):
    -> "sel dis 0" (or another disk that stores Windows8_OS, 0 is default), "lis par" for list partition or/and "lis vol" to list volumes
    -> "sel par 7" to select PBR_DRV partition and "det par" for print info of partition that shows default id for that partition
    -> "assign" or "assign letter=P" that mount PBR_DRV in Windows to first possible letter respectively to P letter
    -> after modification that you want to do you have to do revert process: "remove" that unmounts and hides PBR_DRV
    -> "exit" to exit diskpart

    I hope that this tutorial help you or direct you to right way:). Feel free to ask if any questions.

    P.S.: My english is not very good but I can understand you easily;)
     
  5. javierfh

    javierfh Newbie

    Reputations:
    0
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    5
    Hello,

    Before screwing up my system even more, please let me ask you a few questions to see if I understand this method.
    But first, here's an explanation of the status of my system at the moment.

    I have a Lenovo Ideapad u410. Using the OKR I created a recovery file to an external USB disk. After that, I installed Ubuntu as dual boot. Everything was fine and dandy until one day Linux wouldn't boot. To try to fix it I used boot-repair which made it even worse, because then neither windows nor linux would boot. And as everyone knows at this point, that recovery image I created is useless after the repartitioning.
    At the moment I have the following partitions, the 7 original ones, plus 3 for linux (I dont mind about those, its all backed up)

    Partition 1 Recovery 1000MB
    Partition 2 system 260MB
    Partition 3 Unknown 1000MB
    Partition 4 Reserved 128MB
    Partition 5 system 146GB
    Partition 6 Recovery 350MB
    Partition 7 Unknown 18GB
    Partition 8 Unknown 718GB
    Partition 9 Unknown 8B
    Partition 10 Primary 25GB
    Partition 11 Recovery 12GB


    And when I list volume I see the following:

    Volume 0 C LENOVO NTFS PARTITION 25GB Healthy
    Volume 1 D WINRE_DRV NTFS PARTITION 1000MB Healthy Hidden
    Volume 2 SYSTEM_DRV FAT32 PARTITION 260MB Healthy Hidden
    Volume 3 Windows8_OS NTFS PARTITION 146GB Healthy Hidden
    Volume 4 E NTFS PARTITION 350MB Healthy Hidden
    Volume 5 F PBR_DRV NTFS PARTITION 12GB Healthy Hidden

    So I have followed the instructions from asdryh in post #39 and created a bootable usb disk (seems to boot into some windows thing with a console) and I have also the Pbr_drv partition copied into an usb with the install.wim in it.
    At some point it says in the instructions: "I imagined you will install to c: so in that command I put c: but you can install to another drive too - but make sure it is formatted."

    In my case should that be C:? or the volume 3 which has no letter? and do you know what was supposed to be in C: (labeled LENOVO)?
    And when it is all done, will it look exactly as when I bought it? Will this method create the appropiate partitions and populate them with the content as when it came from the factory? Or will this only recover windows? (I wonder what is all the rest of the stuff in the factory folder)

    I hope you can bear with me and my questions, this is so confusing.

    Thanks in advance.
     
  6. keoanu

    keoanu Notebook Enthusiast

    Reputations:
    1
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    16
    Hi javierfh,

    I have no experience with dual-booting system on UEFI machine. But I am trying to answer to your questions...
    First, I would like to ask you for a some things. Do you want perform clean installation to factory state or make a functional dual-boot system again? Or anything else?

    I would backup an important data and files at first and then an entire partitions related the OKR system. Specifically partition 3, LRS_ESP partition with the OKR system (it should be back up on PBR_DRV partition as lrs.wim image, but for sure) and partition 11, PBR_DRV partition that contains initial images (install.wim, boot.okr, lrs.okr, etc).

    For a functional OKR system, partition layout should follow:
    1.partition - WinRE partition (maybe not mandatory I have not tested), Recovery partition type
    2.partition - EFI partition (EFI boot files), EFI partition type
    3.partition - LRS_ESP partition - Lenovo OKR system with required files and Lenovo partition type
    4.partition - MSR partition - Microsoft System Reserved, MSR partition type
    5.partition - WindowsOS partition - Windows partition, Base partition type
    before last partition - Lenovo partition for user's backup, Base partition type
    last partition - PBR_DRV partition, Recovery partition type

    Between WindowsOS partition (5.partition) and PBR_DRV partition (last partition) you can create a number of partitions (your linux system was creating accordingly, but I have no experience with UEFI dual-boot). Lenovo partition for user's backups you can join with your data partition or create another ones for data...

    So, if you want to return to factory state, you can follow this tutorial that performs a clean installation of the OKR8 system only (with default disk/partition layout). Windows has to be installed manually from Windows media or applied from install.wim image (a little tutorial I posted in previous answer).

    Relating to your questions:
    In my case should that be C:? or the volume 3 which has no letter? and do you know what was supposed to be in C: (labeled LENOVO)?
    -> You should apply Windows image (install.wim) to WindowsOS partition, 5.partition in your case with size 146GB, so yes it should be Volume 3. In command prompt you can run "diskpart" to assign letter to WindowsOS partition (just type "diskpart" to run diskpart, select a right volume, in your case "sel vol 3" and "assign" or "assign letter=W" to mount a first possible letter, resp. letter W and type "exit" to exit diskpart). After that you can use command "imagex /apply d:\install.wim 1 w:" if D: is usb drive that contains install.wim and W: is Volume 3 in your case. By the way, "1" is number of image, Windows 8 Core in case Windows 8 image (2 is Professional edition if install.wim is non-single version, you have to own Professional license key)

    And when it is all done, will it look exactly as when I bought it?
    -> NO, just a factory state will be applied. This means, that all partition except partition 5 (volume 3) will be as before.

    Will this method create the appropiate partitions and populate them with the content as when it came from the factory?
    -> NO. The factory state witt appropriate partitions and content will be done using tutorial above mentioned.

    Or will this only recover windows? (I wonder what is all the rest of the stuff in the factory folder)
    -> YES. It will recover only install.wim image (default factory state for you machine). Other images (winre.okr, boot.okr, lrs.okr won't be applied)
     
  7. javierfh

    javierfh Newbie

    Reputations:
    0
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    5
    Hi,

    First of all, thanks a lot for helping me here :)
    And let me also answer to your questions so you can also understand better what I am trying here.

    - "I would like to ask you for a some things. Do you want perform clean installation to factory state or make a functional dual-boot system again? Or anything else?"
    => I want to be able to perform a clean installation to have the laptop as when it came from factory, just in case I need to contact Lenovo, while on warranty (I am having some issues with the wifi). Once I am confident that I can do, and repeat it in the future again if needed, I will do the dual boot, but that part should be easy, I had it working before without problems.
    I would like also to be able to produce a USB disk, which will allow me to reinstall everything as when it comes from factory, in case someday my HDD breaks.

    --Will this method create the appropiate partitions and populate them with the content as when it came from the factory?
    --> NO. The factory state witt appropriate partitions and content will be done using tutorial above mentioned.

    => So following the other tutorial you linked here, you think then that you can restore everything as it was when it came from factory? That is what I really want, I will take a look to that tutorial too.

    Scary times :) I just wish there would be a method to have all in an usb stick, so you could boot from it, format the whole disk and back to clean table as when it came from factory.
    I'll chekc that other one link and thanks a lot for bear with me.
    I will come back to report success or ask more questions.

    Javier

    P.S. So can this all be tested in a virtual machine? can you simulate booting up from an USB stick and do that factory state installation in a Virtual Machine? it would be great to be able to test it before doing it for real.
     
  8. javierfh

    javierfh Newbie

    Reputations:
    0
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    5
    I am getting close but not just yet :(
    I followed the link you keoanu sent to create a USB stick with OKR.
    So for that what I did was:(in this order)
    -downloaded the image as instructed
    - then mount it, to change the two files containing the default language. So I changed that to en-US and
    - recreated the ISO ,
    - burn it to a USB.

    I double checked the content of the two files, in the USB stick and all seems to be correct again, both of them show default lang en-US. So far so good.
    So next thing I do, is to put the stick in the laptop, remove all other sticks, reboot, and bingo, something seems to happen, until I get the exactly same window in chinese as in the picture. Cant understand what is wrong, shouldnt it boot in english? and display the messages in english?
    Or am I supposed to do still something else? I dont dear to install it in chinese...or was that the point that you install it in chinese and then change it from the hard drive? makes no sense :)

    Any idea what I am doing wrong?
    Thanks in advance again.
     
  9. keoanu

    keoanu Notebook Enthusiast

    Reputations:
    1
    Messages:
    37
    Likes Received:
    2
    Trophy Points:
    16
    You are welcome :)
    Thank you for answers. Now I fully understand.

    A one note on Lenovo warranty. I guess that default factory state is not necessary while on warranty. There is no option to create a recovery media from Lenovo OKR anymore for Windows 8/8.1. For Windows 8/8.1 you can create a recovery media by Windows Recovery only.
    And there you can decide to remove the recovery partition from your machine, see official support from Lenovo [source]. According this information I assume that default factory state is not affecting on warranty (But you should contact Lenovo support to check this :) )

    But first...I have to correct my answer related to "The state with appropriate partitions and content...". By using mentioned tutorial, the appropriate partitions will be created but the content you have to add manually or yourself (just replace PBR_DRV images and Lenovo OKR files by yours).

    Back to your wishes :) I think that "default" factory state would be possible.
    According my observations you can create customized USB Recovery disk for your own use:

    1. Creation own OKR8 Factory/Recovery media (customized)

    • 1a. Download the ISO linked in this tutorial
    • 1b. Mount the downloaded ISO
    • 1c. Prepare USB (with size at least 8GB, it depends on images size), format it to NTFS, or FAT32
    • 1d. Copy directories from mounted ISO: "Boot, EFI, sources"; and files: "bootmgr, bootmgr.efi" to USB root
    • 1e. Create directory: "okr8" to USB root and copy entire directories: "LRS_ESP, PBR_DRV"; and files: "callcreate.cmd, create.cmd, create.ini, Q_LRS_ESP_COPY.cmd, R_PBR_DRV_COPY.cmd" from mounted okr8 directory
    • 1f. Copy and replace your OKRBackup\Factory directory from PBR_DRV partition to directory okr8\PBR_DRV\OKRBackup\Factory into USB drive (install.wim, lrs.okr, winre.okr, boot.okr, info.ini, mbr.okr)
    • 1g. Optional: Copy and replace your OneKey\MAIN and OneKey\OKR directories from LRS_ESP partition to directories okr8\LRS_ESP\OneKey\MAIN, resp. okr8\LRS_ESP\OneKey\OKR (MAKE SURE that "LRS-Config-Org.xml" file IS PRESENT in MAIN directory)
    • 1h. Optional: Change language (default is Chinese) in "LRS-Config-Org.xml": For English replace "zh-CN" to "en-US" in Default-Lang tag (in brackets)
    • 1i. Custom the size of partitions; for that you can edit "create.ini" in okr8 directory:
      - Default layout:
      -> 1.partition - 1000 MB, WINRE_DRV, Windows Recovery Environment (boot from winre.wim)
      -> 2.partition - 260 MB, System, EFI System Boot partition
      -> 3.partition - 1001 MB, LRS_ESP, Lenovo OKR Boot partition (OneKey\winpe\LRS.wim, OneKey\MAIN, OneKey\OKR, EFI\Microsoft\Boot\LrsBootmgr.efi)
      -> 4.partition - 128 MB, Microsoft System Reserved
      -> 5.partition - 100000 MB, Windows8_OS, Windows partition (C: drive in Windows)
      -> 6.partition - variable size depends on disk size, Lenovo, Lenovo user's backup partition (D: drive in Windows)
      -> 7.partition - variable size depends on disk size (14600-20000 MB), PBR_DRV, Lenovo Factory partition (contains initial images)
      - you can add partitions as many you want between 5.par and 7.par (regarding disk size)
      - but MAKE SURE the order of 1.,2.,3.,4.,5.par will be FOLLOW default layout
      - to get more size you can reduce size of 1.,3.,5.,6.,7.pars (regarding the size of occupied files), 2. and 4. par leave with default size​
    • 1j. Make bootable USB:
      - For EFI (EFI mode enabled in BIOS): no action is needed
      - For LegacyBIOS (Legacy USB booting or LegacyBIOS is enabled): type "diskpart" in command prompt -> "lis dis" to detect USB drive -> "sel dis 1" (if USB drive is disk 1 as detected) -> "sel par 1" -> "active" -> "exit" ​
    Note to 1g:
    You can replace entire content of okr8\LRS_ESP with your own LRS_ESP partition (entire content). I recommend check entire content and use your own files or newer files (using that you can update OKR system with the newest, e.g OKR for Windows 8.1 where you find directory Factory in extracted OKR8 for Win8.1 setup files).
    The most important files:
    -> LrsBootMgr.efi (EFI\Microsoft\Boot) - Lenovo EFI boot file (I guess that contains NOVO bootstrap)
    -> LRS.wim (OneKey\winpe) - Lenovo OKR Boot environment (after boot -> lrsboot.exe (i; check conditions and set partitions and variable in MAIN\Lrs-Config-Org.xml and call MAIN.exe) -> MAIN.exe i; read MAIN\Lrs-Config-Org.xml, set and call OKR.exe) -> OKR.exe (LRS_ESP partition; Lenovo OKR GUI - Initial and User Backup restoration))
    -> Lrs-Config-Org.xml (OneKey\MAIN) - variables and settings for OKR; to avoid Lenovo detection (for VM testing) add to the end DetectLenovo tag:
    HTML:
    </NB>
    <DetectLenovo>TRUE</DetectLenovo>
    </LRS-Boot-Config>
    I recommend replace LRS.wim, LrsBootMgr.efi with your own files.

    Note to 1i:
    "create.ini" - is diskpart configuration file (see diskpart utility help for use)
    Make sure that particular partition has respective types (and optional attributes):
    -> 1.par - type: DE94BBA4-06D1-4D40-A16A-BFD50179D6AC; attributes:0x8000000000000001
    -> 2.par - type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B;
    -> 3.par - type: BFBFAFE7-A34F-448A-9A5B-6213EB736C22; attributes:0x8000000000000001
    -> 4.par - type: E3C9E316-0B5C-4DB8-817D-F92DF00215AE;
    -> 5.par - type: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7;
    -> 6.par - type: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7;
    -> 7.par - type: DE94BBA4-06D1-4D40-A16A-BFD50179D6AC; attributes:0x8000000000000001
    Ex.: you can change Windows size from 100000 MB to 65000 MB. In "create.ini" edit line from "create partition primary size=100000" above line "format quick fs=ntfs label="Windows8_OS"" to "create partition primary size=65000"

    2. Restoration to factory state

    • 2a. Start machine and choose from EFI USB Drive from Boot list (or change boot order in BIOS to boot USB drive first)
    • 2b. Check the check-box and click on button (don't worry about chinese language, it's just this GUI language, for OKR language see section 1h)
    • 2c. When installation of the OKR system is completed (see All Done message-box), just click OK and machine is going to reboot
    • 2d. Remove USB drive (and change boot order to default if needed) and go to Lenovo OKR boot environment (by NOVO button)
    • 2e. When Lenovo OKR system is booted you should see Lenovo OKR GUI as usual
    • 2f. Select Restore from initial backup and start the restoration process and that's it :)
    3. Update your Windows image for initial restoration
    • 3a. Upgrade Windows 8 to Windows 8.1/Windows 8.1 Update, update drivers, install or uninstall desired apps, remove temporary files, etc.
    • 3b. Boot to Lenovo OKR environment by NOVO button
    • 3c. When the OKR GUI is started -> invoke the command prompt by shortcut "CTRL+SHIFT+O" -> find PBR_DRV partiton (f.e. using diskpart with "lis vol" command)
    • 3d. Go to PBR_DRV partition (f.e. PBR_DRV par is G: drive) -> "G:" -> run "backup.bat" if exist, otherwise type "cd onekey\osimage" and run "osimage /nopbr" and then "osimage /fb"
    • 3e. After that install.wim, boot.okr, lrs.okr, winre.okr will be updated
    • 3f. Initial restoration will restore updated install.wim thus updated Windows
    Note to 3d:
    Before the execution at this point I recommend backup images/files from PBR_DRV\OKRBackup\Factory directory (install.wim, lrs.wim, boot.okr, winre.okr)
    "backup.bat" or commands at this point will overwrite images/files in PBR_DRV\OKRBackup\Factory directory

    IMPORTANT NOTE:
    The steps in this tutorial I have tested in Virtual Machine (VM) because of I am not owner of Lenovo machine. So I am not able to test NOVO button functionality because of I have no access to Lenovo EFI firmware (cooperate with LrsBootmgr.efi).
    I have accessed to Lenovo OKR boot environment via EFI Boot Manager in VM as Boot from file or Add to EFI Boot Manager (navigate to LRS_ESP\EFI\Microsoft\Boot\LrsBootmgr.efi).

    My English is not very good. So I hope you will able to understand a main idea at least. Feel free to ask if any question. Or I forgot something.

    P.S.:
    Important note should be answer for testing this tutorial in VM :) So yes, you can test this tutorial in VM first, but NOVO button functionality will not working presumably (you can access via EFI Boot Manager as I mentioned above).
     
  10. Valued17

    Valued17 Notebook Geek

    Reputations:
    2
    Messages:
    88
    Likes Received:
    11
    Trophy Points:
    16

    Damn man, I can see the hard work you put into all this. Wonderful stuff, really appreciate it. I only have one question -

    What would be the most clean way to upgrade to "Windows 8.1 with update" without leaving any mess. Obviously If i upgrade from the store etc, I keep some old/unused files/mess with it ?? And if I use MSDN iso, I dont get lenovo branding. Whats the best way to go about this ??
     
Thread Status:
Not open for further replies.

Share This Page