How to install windows alongside Ubuntu?
I have 2 partitions (c: and d:) and on my D: partition is Ubuntu... how can I install new Windows on my C: partition...?
I think I have to change pre-install task of creating a partition so it doesn't delete entire disk but only use my C: partition... Any suggestions?
Answers (2)
installation is not the problem. You are right, you need to simply format the C partition.
the diskpart script should look like:
select disk 0
select partition 1
active
assign letter=c
FORMAT FS=NTFS LABEL="Windows Volume" QUICK
exit
The main issue will be:
Windows will overwrite the MBR so your GRUB is not starting anymore which means, you can start Windows but not Linux anymore but Linux still resides on your hard disk!
Solution would be:
1. you restore grub (boot live linux, change to the kernel on your "d"-Partition and restore grub
2. you update the windows bootloader with bcdedit to enable the Linux boot from here:
http://www.icpug.org.uk/national/linnwin/step2-7.htm should be able to help you to create the correct post install task
Microsoft said in former times:
Multiboot? First install the outdated OS then the modern OS (they meant: at first Win98 then XP in that time I read this suggestion)
So simply install Windows first, Linux second ;)
Comments:
-
Thank you for your answer, and yes, im aware that the new windows installation will overwrite MBR so I won't be able to access Linux any more...
but can you please help with some script as an post-installation task which will automatically correct this issue? The thing is, i have to do it for a dozen computers and it's too time-consuming if doing it for each separately... - dlistar 10 years ago-
did you read my link, where you have nearly 100% the post install script?
The only two things you need to make on your own is: read out the ID and use it in the step later. As I am on a trip I am not able to verify that it works correctly so I don't write the code for you (which would be 5 lines) - Nico_K 10 years ago-
Hi, I just wanna thank you again, I've made commands like said in the post you gave me but it didn't work because of missing grldr.mbr file... I have downloaded it and put it in C: drive but I still got error "Error: Cannot find grldr in all drives. Press Ctrl+Alt+Del to restart."
I'm guessing maybe somewhere is named differently... - dlistar 10 years ago
You are on the right track. You just need to make sure you're not using any preinstall tasks that will wipe existing partitions. Just one that formats the "C" drive as NTFS. You also need to be careful about any tasks that replace the MBR. If you install the Windows MBR it may or may not pick up on your Ubuntu installation. Personally, I would leave the MBR as is and just add Windows to whatever bootloader you're using with Ubuntu (probably GRUB)
Comments:
-
Thank you too for your answer. So, if I understand correctly regarding MBR, in pre-installation tasks part, it is not necessary to use "install mbr for 2008/vista/7/8/2012" task because then will computer use boot load menu of Linux ? - dlistar 10 years ago