Friday, March 31, 2017

Backup unbootable Windows 7 to another partition


Windows 7 Home Premium won't boot on my Vaio laptop even in safe mode (stuck at classpnp.sys, then it goes to a BSOD and I'm forced to restart). I tried many solutions but none of them worked.


After that I decided to boot from an USB with Ultimate Boot CD installed and ran every hardware test with positive results. Then I booted Parted Magic and it was able to mount the hard drive (even the system and recovery partition). From there I could just copy the files that I wish to keep to my external USB flash drive and make a clean Windows 7 install. The problem is that the transfer rate is painfully slow and I have a lot of pictures.


I read that Windows creates a 'windows.old' folder when doing a custom install containing the old installation Program Files and Users folders. I don't trust that since Windows can't even boot in safe mode. Are my suspicions right?


The other option is to create a new partition with Parted Magic and dump all the files there, but if I do that the Windows installation program won't create a separate System partition (around 100 mb) and I read that it's convenient to do that instead of having Windows in only one for security reasons (it didn't work for me since I already have a separate System partition).


So my question is: is it worth taking a long time transferring files to my other laptop for the sake of having Windows in two partitions? or should I just save time and use a new partition for backup? even better, is it possible to install Windows System in a separate partition when the hard drive already has an existing partition that I wish to keep?


EDIT: The VAIO recovery partition seems to be corrupted so I discarded that alternative. I also forgot to mention that I am able to run the Windows command prompt in the recovery environment but I don't know if there are any tools there that could be useful.


Answer



Ok, so I was finally able to create the backup partition AND install windows with System in a separate partition. The only thing you need is to be able to access the Windows command prompt in the recovery environment (press F8 during booting and choose Fix Startup or something like that).
The steps I took are as follows (I used multiple sources that are listed below):



  1. Access said command prompt.

  2. Type 'Diskpart'


    DISKPART> list disk             (output isn't shown)
    DISKPART> select disk 0 (assuming it's disk 0)
    DISKPART> list partition (output isn't shown)
    DISKPART> select partition 1 (assuming partition 1 is the Windows **boot** partition. It should be the bigger one, not the System one)
    DISKPART> shrink QUERYMAX (this will return the maximum number of bytes that the volume can be reduced)
    DISKPART> shrink DESIRED=204800 (which is 200 gb in mb. It is the desired space that will be used for backup)
    DISKPART> create partition primary size=204800 (this will create the backup partition)
    DISKPART> format fs=ntfs quick (having quick added at the end of the command will do a quick format instead of a full format on the partition created previously)
    DISKPART> exit diskpart

  3. Now I exited the command prompt and restarted. I had an USB flash drive with UBCD installed (here for instructions). Change the BIOS boot order so the USB device option is listed first. Once in the UBCD menu choose the option called 'Parted Magic ....' and then choose the first option. This will launch the Linux-based distro Parted Magic.


  4. Once there click on the File Manager icon. This will allow us to transfer files from an external flash drive and between the different partitions. In my case I transferred a lot of pictures from the Windows boot partition to the backup one I created in step 2. I also stored the most important files on another flash drive just in case something went wrong. Once we are done restart the computer and change back the BIOS so we can go to the command prompt again.


  5. Again we type 'Diskpart'


    DISKPART> list disk
    DISKPART> select disk 0 (same as before)
    DISKPART> list partition
    DISKPART> select partition 2 (corrupted VAIO recovery partition in my case)
    DISKPART> delete partition override
    DISKPART> select partition 1 (Windows boot partition from which I already extracted what I wanted, should be the same as the one selected in step 2)
    DISKPART> delete partition
    DISKPART> select partition 3 (System partition, should be about 200 mb)
    DISKPART> delete partition
    DISKPART> create partition primary size=200 (new Windows System partition that will be used to install Windows again)
    DISKPART> format fs=ntfs label="System Reserved"
    DISKPART> active
    DISKPART> create partition primary size=102400 (new Windows boot partition that will be used to install Windows again)
    DISKPART> format fs=ntfs label="Windows 7"
    DISKPART> exit

    So now we should have 3 primary partitions: The backup one, the soon to be Windows System one and the soon to be Windows Boot one. The only one active is the Windows System one. You can check that by selecting it in DISKPART and typing 'detail partition'. Next we restart the computer.


  6. Now insert the Windows install media into the Optical Disk Drive and restart the PC to set the first boot device as the ODD in the BIOS and install Windows 7 to the created "Windows 7" partition. You will want to do a clean install choosing the "Custom (advanced)" not the "Upgrade" option, when you are presented with this "Where do you want ... " dialog box click to choose the created "Windows 7" partition and click next; do not use the installer to format anything.



When we are able to finally access Windows we can move our backed up files to our new Windows boot partition and then delete the backup partition. We can now extend the boot partition to use the newly unallocated space. For that you can use the Disk Management tool that comes with Windows.


That's all, hope it helps.


Sources:
How to Optimize an SSD / HDD When You're Ready to Reinstall the Operating System


The other sources in comments, I'm sorry, I can't post more than 2 links with this reputation. Hopefully someone edits it.


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...