dual boot - How can I install Windows after I've installed Ubuntu? - Ask Ubuntu


i have ubuntu on laptop. want install windows 7 in dual-boot. how can this?

i can't lose ubuntu files, , i'm afraid might break grub.

here's general outline:

  1. make space windows
  2. install windows
  3. mount /boot direcory or partition
  4. install bootloader (grub)

step 1 – make space windows

open gparted, , make sure have @ least 20 gb available windows 7, either partition can remove, or unpartitioned space. if it's partition, remove grub make sure doesn't break ubuntu install — gparted complain if bad happen.

make note of current /boot device. if doesn't show there, make note of / device. device name sda5.

step 2 – install windows

install windows 7 space made

step 3 – mount /boot

note: instead of mounting boot directory or partition installation in live media environment can specify path --boot-directory parameter grub-install, more information on manpage.

load ubuntu live cd, , run these commands.

  • if not have separate /boot partition:

    sudo mount /dev/devicename_from_step_one /mnt sudo rm -rf /boot    # careful here, make sure using live cd. tried it, works. sudo ln -s /mnt/boot /boot 
  • if have separate /boot partition:

    sudo mount /dev/devicename_from_step_one /boot 

step 4 – install bootloader

note: these instructions written windows 7 , bios booting computers. if have uefi , windows 8 , above need replace grub-pc grub-efi-amd64 in sudo apt-get install grub-pc.

then continue commands:

sudo apt-get update sudo apt-get install grub-pc sudo grub-install /dev/sda     # note there no digit sudo umount /boot 

and restart. should work fine , boot both systems.


Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User