Running Optimize/Trim for SSD damages MBR

Discussion in 'backup, imaging & disk mgmt' started by Victek, Feb 14, 2016.

  1. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    I have a laptop with an SSD running Windows 10. On the C:\ Properties Tools tab there is the standard Optimize button which opens another window with the option to Trim the SSD. If I run it the Trim completes without error, however when I reboot the computer I get an "operating system not found" error. This is reproducible (in other words I did it more than once until I saw the connection). Fortunately I was able to recover the OS and now I'm wondering if there's a way to get the Trim to work properly. TIA for any ideas.

    By the way, the commands for fixing this problem are set out on these two pages:

    http://www.kapilarya.com/fix-the-boot-configuration-data-file-is-missing-some-required-information

    http://www.kapilarya.com/fix-windows-10-master-boot-record-corrupted
     
  2. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Well, I've optimized more Win10 System SSDs than I can count (UEFI and Legacy-MBR on many different hardware configurations) and have never seen this error. I don't believe it's a Windows issue, it may be a configuration issue on some strange machine configurations.

    The MBR (Master BOOT Record) isn't even in the realm of FileSystem manipulation when it comes to OPTIMIZATION of an SSD... it's NOT in the FileSystem. The BCD Store is located in the ACTIVE Windows System partition (the one being optimized) only if your System BOOTs in Legacy-MBR BOOT mode... on UEFI systems it's located on the EFI (System) partition which isn't touched in any way by optimization..

    I think something's strange about your system configuration. Can you tell us a little about that system's configuration... disk structures, any funny SSD-type caches running around, is it UEFI or Legacy-MBR BOOTing? Maybe we can get to the bottom of the anomaly.
     
    Last edited: Feb 14, 2016
  3. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Victek, if it really is a BCD-type error after an OPTIMIZATION run... if the BCD data is on your ACTIVE Windows partition, something is wrong with the logical block addressing of your SSD. During the optimization run, Windows is only issuing TRIM commands for any unallocated free space it finds during the task. The BCD data, if on that volume, is clearly not free space... it is fully allocated. If a TRIM command issued to an unallocated SSD disk block is ZEROing out your BCD data... I would think there's an error in your SSD (that's where that translation is done).

    If you're running an UEFI BOOT system, the BCD data is located in the EFI System partition which Windows doesn't even mess with as far as optimization is concerned.
     
  4. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    Thanks for the replies. I agree that there must be some anomaly in the system. It's an old dual core laptop with BIOS, not UEFI. I will take some screenshots of "disk management" and the volumes listed in the "Optimize Drives" window; perhaps that will shed some light :)
     
  5. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    Here are a couple of screens. The ( E: ) drive appeared after the most recent recovery. Does this shed any light on things?

    Disk Management.jpg Disk Optimization.jpg
     
  6. Triple Helix

    Triple Helix Specialist

    Joined:
    Nov 20, 2004
    Posts:
    13,269
    Location:
    Ontario, Canada
  7. hjlbx

    hjlbx Guest

    @TheRollbackFrog

    Do you know if there is a threshold value (minimum) of deleted data on an SSD before the scheduled Optimize Drives will execute ?

    On my W8.1 system, Optimize Drives is scheduled for weekly - but it never executes until 28 days have passed.

    I have a 256 GB SSD with only 45 GB installed. It is a test system - to some extent - so there is a fair amount of active installs\uninstalls. I also clean my system with CCleaner on a weekly basis.

    Perplexed as to why Optimize Drives does not execute as scheduled on a weekly basis.

    I have even tried keeping the system plugged for over a week so as to meet the trigger requirements for scheduled SSD TRIM.
     
  8. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Hjlbx, there are a few things you need to understand. The OPTIMIZE function within Windows for SSDs is not there to clean up deleted DATA. The function of cleaning up deleted data, while running under a LIVE Windows System, is done automatically by Windows itself on a DELETE by DELETE operation. It occurs at that time when Windows de-allocates its storage blocks following a file delete function... that's when the TRIM function for SSDs is actually activated... its a normal dynamic thing.

    The real purpose of the separate OPTIMIZE function is to insure that the SSD remains in sync with your LIVE Windows System (as far as deleted DATA is concerned) just in case there was some data manipulation done on the device while not running under Windows. Examples of this are possible non-TRIMming versions of Linux running on the same disk, non-TRIMming versions of WinPE (the Windows pre-Installation environment) running on that same disk, and probably the biggest offender of this out of sync type of DATA mgmt. are imaging programs during their restoration operations (Macrium REFLECT is the only one I know of that does proper TRIMming of a volume being restored).

    Under normal operations, Windows should take very good care of the SSD and its DATA synching needs. I'm not sure about thresholds while OPTIMIZING but since Windows can never know how much out of syncing is going on in the SSD (it's only known by private SSD internal space mgmt.), I don't know what criteria it could use to make a threshold decision. It shouldn't be made by normal DEFRAG % decisions... they really have no relevance to an SSD. There are some basic defrag type of operations that Windows needs to perform as they relate to a fractured FileSystem but they are done automatically to my knowledge (they are very minor in the world of real DEFRAG operations).

    So I guess my answer is I don't know what type of criteria Windows would use to "not do" a scheduled OPTIMIZATION run... but I also don't think scheduled optimization runs on a detected SSD are really needed in the long run, and if they are, an occasional MANUAL run is more than enough.

    PS- can you stretch out that DISK MGMT screen so I can see all the attributes of your E:\ partition? It looks as though E:\ was created during your W10 v1511 update (November 2015) and is the new Windows Recovery partition. The 1.5gB unallocated space, I haven't a clue as to what that was before it became unallocated... just blank space at the moment, maybe the previous MicroSloth RECOVERY partition.
     
  9. hjlbx

    hjlbx Guest

    I have insufficient knowledge to understand some of the details - but I understand the jist. Thanks @TheRollbackFrog .

    OptimizeDrives.PNG

    DiskMgmt.PNG
     
  10. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Hjlbx, those pics are from a different machine than the one you showed in Post #5... the ones above are from an UEFI system, your original reference was to a BiOS-MBR system (and that one is in worse shape than the original :D... looks like lots of old leftover RECOVERY partitions).

    Edit: My bad... different poster :confused:, not enough coffee yet.
     
  11. hjlbx

    hjlbx Guest

    Heh, heh... post # 5 is from @Victek.
     
  12. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    <Ooooops!> Sorry 'bout that (need much more coffee :isay: )
     
  13. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    No problem :cool: Do you need for me to take another screenshot to show the disk management better?
     
  14. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Yes, pls... the STATUS field needs to be expanded to see all the attributes (either in the list or the graphic)
     
  15. hjlbx

    hjlbx Guest

  16. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    Here's another screen. Let me know if this shows everything needed:
    Disk Management 2.jpg

    Viewing the contents of E: using Windows Commander I see ReAgent.xml, Winre.wim, and boot.sdi. Presumably these are important (!) I wonder if the drive letter assignment is necessary?
     
    Last edited: Feb 16, 2016
  17. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    The Windows RECOVERY partition usually does not have a letter assigned to it... it is found and used automatically when needed.

    Let's check a few things... start out by unHiding hidden files (Folder Options/View in your Control Panel). Once unHidden, see if there is a "Boot" folder located in the ROOT of your C:\. If there is, check the contents and see if the BCD file is there. This is what's supposed to be used by BOOTmgr (which should also be located in the ROOT of C:\) when your System is being BOOTed from your ACTIVE System partition in a BiOS-MBR system. Since, in your case, that's your Windows (C:\) partition... that where the BCD should be located. If it's there, that space is fully allocated and won't be affected by any OPTIMIZE function. If it's not there, it needs to be there (we can do that, if necessary).

    Lemme know what you find...
     
  18. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    What you found in the RECOVERY partition is normal if you have a Recovery partition (which you do). Some systems do not, and when they don't, that Recovery info (the WIM and its associated stuff) is located on the ACTIVE Windows System partition under another hidden folder called "Recovery."
     
  19. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    Interestingly when I check to show "hidden items" in File Explorer I do not see the boot folder, however I do see it using Windows Commander (which is also set to view hidden items). In C:\boot there are a number of sub folders implying language options and also BCD, BCD.LOG, BOOTSTAT.DAT, bootvhd.dll and memtest.exe.
     
  20. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    That's exactly what's supposed to be in the /Boot folder if the BOOT is set up for BiOS-MBR and there's no MicroSloth SRP (System Reserved Partition).

    Does that System have an UEFI option in the BiOS or is it MBR only? Possibly you have a non-Standard MBR on that system for use with BiOS-MBR BOOTing. If you think you do, you should use one of many tools (Minitool Partition Wizard, BOOTice, etc.) that can restore a Standard MBR to that system. But don't do it if your using anything like BIBM (BootIt Bare Metal) or Rollback RX... each using private MBR configurations.
     
  21. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    It's an old machine that originally came with Vista, so it's definitely BIOS/MBR only. I don't use BIBM, Rollback RX, or anything similar. I just boot a single OS. It's possible that the latest repair I did fixed the underlying problem. The two previous times the system failed the list of volumes in the Optimize window included a couple of strange entries in addition to C:\ This is the first time there is an E:\ and no strange entries. I found an example on the internet where someone was seeing the same problem; note the last entry in the screenshot.

    Windows Optimize Volumes.png

    Do you think removing the drive letter from the E:\ volume (recovery partition) is likely to cause a problem? I would prefer to hide the volume if possible.
     
  22. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    Windows does not need a drive letter to invoke its own Recovery Environment... that's done during the BOOT process when a repair operation is selected. You should be fine without one.

    Sometimes you will see a Recovery partition (with a letter) that is way larger than the 450mB you see in the Windows Recovery partition. That usually is the OEM manufacturer's recovery partition... usually offering some special tools/diagnostics and a method to restore that system to its out-of-the-box state. Sometimes those partitions usually need to remain lettered... yours is not one of those.
     
  23. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    That original RECOVERY partition in your view above looks like it may have been the manufacturer's out-of-the-box recovery partition... it now appears gone from your system (maybe you dumped it). The partition marked E: is definitely the 450mb Windows Recovery partition (not the OEM's RECOVERY partition) generated during a Win10 upgrade (or CLEAN INSTALL) to an entire disk.

    The unallocated 1.5gB may easily be added to your Windows partition should you need it using one of many BOOTable partitioning tools available... I wouldn't do it unless you really needed that space.
     
  24. TheRollbackFrog

    TheRollbackFrog Imaging Specialist

    Joined:
    Mar 1, 2011
    Posts:
    4,945
    Location:
    The Pond - USA
    <Oooops!> Just realized they were two completely different disks (HDD vs SSD)... sorry 'bout that.

    Did you do some sort of image restoration when you built that SSD mentioned in the lead post?
     
  25. Victek

    Victek Registered Member

    Joined:
    Nov 30, 2007
    Posts:
    6,219
    Location:
    USA
    Sorry for the confusion. In message #21 I posted an example I found on the internet of a weirdly labeled partition showing in the optimization window. I had a couple of similarly labeled partitions showing in the optimization window before my most recent crash and repair like this one:

    \\?\Volume{d2fb7183-38da-40f7-b746-a1187288...

    Any idea what this means and why it would appear in the optimization screen?

    Regarding the C:\boot folder would it be beneficial to backed it up? If I experienced the missing operating system error again would copying the C:\boot folder back to the drive fix it?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.