Wednesday, July 27, 2016

Asus Reboot Loop after installing SSD

Just a note about a problem I had installing an SSD into my Asus Laptop.

The whole "AI Recovery" thing was a piece of work. First I used the "AI Recovery Burner" to create four recovery disks. Well, it claims 6 disks will be needed...

But in fact it creates only four. Anyway, it wouldn't work, saying there wasn't enough disk space - although it didn't say how much disk space it wanted or even which volume should have free space on it. It turns out that it demands about 50 GB of free space on C:, even though it only needs about 14 GB to write the DVDs (a single DVD holds 4.3 GB, and it uses a little over three DVDs).

After installing my new 480GB SSD and booting from the DVD, it takes about 40 minutes copying data from the disks to the SSD (I happen to know it places the data on a 25GB hidden volume, yes, 25GB to store 14 GB of data, and this will decrease your SSD's capacity.)

After that it rebooted and Windows did a bunch of first-time setup, and then rebooted a second time.

After that, it gets into a horrible reboot loop. Right after the Windows 7 splash screen it says "Setup is preparing your computer for first use" on a black background. Windows boots and shows a message telling you not to use the computer since it is setting itself up. Unfortunately, after a few seconds it will reboot, and this process repeats forever.

The first time this happened, I dealt with the problem as follows: I quickly pressed Alt+Shift+Esc as soon as the taskbar appeared, to show Windows Task Manager, then I found a process with "Asus" in the name (I don't remember what the process was called exactly) and I quickly clicked End Process to terminate it (Alt+E, Space). This terminated the reboot loop; unfortunately, the setup process was left incomplete and the computer had no drivers installed - no video driver, no WiFi support.

Although the computer was left with a 25GB recovery partition, it's useless because the recovery partition is hidden and Asus somehow made it inaccessible to mounting by Windows, and I couldn't find any way to invoke the recovery functionality. Therefore I went through the entire 40-minute copy-from-DVDs process again.

The second time, it occurred to me (because I'm a software engineer) that since the people who wrote the AI software were clearly idiots, they might have written the software with a race condition - maybe they ran two processes simultaneously, one of which is assumed to finish first and the other is assumed to finish second and forces a reboot. If the first process was CPU-bound and the second was IO-bound, then the second process would run much faster on an SSD than a normal hard drive, and therefore finish before the first process.

Based on this hypothesis I tried stressing the SSD in various ways as soon as humanly possible after the system booted. It took several attempts, but eventually the following strategy seemed to work:

  1. The instant the Taskbar appears, very quickly press the Windows Key (to show the Start Menu), then type C: and press Enter. The contents of the C: drive (your SSD) are shown instantly.
  2. As fast as humanly possible, click the Windows folder (one click only), then Ctrl+C (which means "copy"), then Ctrl+V (which means "paste"). This will cause Windows to start making a copy of the Windows folder, which is very large and therefore keeps your SSD busy. If you do it fast enough, some of the installation process will complete.
  3. If the computer hasn't restarted by the time copying is half-done, start making a second copy of the same Windows folder to keep the SSD busy.
  4. This will take several attempts, so you will end up with several folders like Windows - Copy (2), Windows - Copy (3), Windows - Copy (4). Be sure to delete old copies periodically, otherwise your SSD will fill up and copying will fail. Press Shift+Delete to delete permanently, which bypasses the Recycle Bin, but be sure NOT to delete the original Windows folder or any of the other folders that are not copies.
  5. As you keep trying, eventually all the drivers and software should be installed successfully. The computer will restart one last time and Windows will ask you what OS language to use (English, Chinese, Spanish, etc.) When this happens, it indicates all is well! The reboot loop should be over and all your drivers should be installed.
  6. Once the reboot loop is over, make sure you delete those copies (Windows - Copy (2), Windows - Copy (3), Windows - Copy (4), etc.) to avoid wasting SSD storage space.

I know this is a challenging solution, and I can't guarantee it'll work on your laptop, but it worked on mine, and it has the virtue of not needing a second computer or special software in order to escape the reboot loop. If I were a better hacker I could no doubt find a more reliable solution, so I apologize that I'm not a better hacker.