Sunday 28 July 2013

Installing Windows After Linux!

Hello, this time I am gonna try a different type of post. I am not gonna give any in-depth-details about the commands and stuff but rather share my experience to dual boot as installing Linux first and Windows after. First of all let me give you the configuration I have so you could judge it if you should try below steps in such operation if it suits you anyhow...

I had a single hard disk in my laptop as single partitioned (ext4) 500GB for Kali with latest updates, everything is working right, no problem in anyway. It is a very healthy system, but I will never ever never trust my NTFS formatted archive external disks with any version of Linux or Mac or anyother OS if that matters. I will never use those disk under any circumstances on other operating systems except Microsoft ones as their content is invaluable, years of backups, works, codes, datas, you know my digital life. I lost my other machine to a hardware failure and so I also wanted to have a Windows 8.1 preview version as my second OS on this machine. I downloaded from the official Microsoft site and the risky operation series has begun. I strongly suggest you to take backups before try anything. In fact don't try this at all, these are only my experiences I decided to share.

I will try to write the steps I followed in bullets, give commands or links if necessary along the way;

  • Downloaded the Windows 8.1 preview iso from the official site. Just do a Bing search for it you'll quickly find it. Or click "w", I am annoying =P
  • Made the iso a bootable flash drive. There are innumerable guides out there, just Bing it, or Google it.
  • After that I booted my system with Kali live usb stick, and used gparted to shrink my single partition's size by 190GB, that is how much space I wanted for my Windows 8.1 Preview. Decide and shrink your partition with your live Linux USB, I believe any modern live stick will do job. {I somehow couldn't manage without this second live Linux usb stick there are guides to shrink a partition but I couldn't do it.}
  • Then I booted into Windows install stick (I think you can use any version but for the sake of my experience I will assume you are using also 8.1 preview) and installed my 8.1 preview to that newly emptied free unallocated space. after installation it looked like this =>here sda1 is my Kali, sda2 (the small area between sda1 and sda3) Windows boot partition, sda3 is Win8.1Pre, last part is linux swap.
  • But at this point I was cut off of from my Linux. No way to boot into. Stuck with Windows, I followed this guide I found. I know it is in Italian, I don't know any Italian. You could simply follow the commands or have Bing translate the page for you.
  • And now I am stuck with only Kali, but now I had Windows installed over my disk somewhere. I just cannot boot into it. That's I figured pretty good, and thought can be a very manageable situation. But once again for the sake of the completeness of my whole experience I am gonna write the misssteps I took. In italic don't do them, just read them and go to the next bullet.
      1. I booted into my Windows Install USB stick and try to recover MBR there. I succeeded with some commands from the prompt like bootsect and stuff, but that got me stuck with only Windows once again.
      2. Then I re-recovered my grub from the guide above I linked, then again I was stuck with only Kali, with Windows over there unreachable.
      3. I tried old distros' with the option "boot the first partition" live CDs. Nothing worked, for a time I had a very healthy Kali and an unreachable Windows.
      4. Then I try some other guides I found, involving bunch of grub config file editing and grub-updates etc... those only worsen the situation. I decided the safest way to achieve my goal is to have Kali and making the whatever it is going to take manually
  • Then I started to play with /boot/grub/grub.cfg file.
  • After some trial and error, these below lines worked for me.
    • menuentry 'win'{
      set root=(hd0,2)
      chainloader +1
      }
  • I added above entry to the file mentioned above completely manually to the appropriate place. If you are following this then take a look at the file, examine it carefully and edit it accordingly.
      1. using grub.d/xx_win stuff (I mention this because chances are good you are gonna find such guides involving that online pretty easily, they didn't work for me) messes my configuration and makes me to start to recover the grub process all over again and again.
  • That's it; now I have dual boot.

I am guessing I took a very rocky and long way to have a dual boot system, but you may be in my shoes and need some light. Therefore my post may help to your cause. Have a nice journey and dual boot.

Remember don't follow this post to have dual boot. It may only help if you are nearly exactly in my situation to begin with. There are, I believe, tons of easier and safer ways to have dual boot in the first place.

No comments:

Post a Comment