Saturday, September 8, 2018

dual boot - Dualbooting Windows 8.1 with Ubuntu 14.04(Current OS)




I have a Dell Inspiron 15R 64-bit laptop. I had Windows 8.1 on it. While installing Ubuntu 13.04, I accidentally selected the option to erase everything on the disk and install Ubuntu, and as a result, my entire hard-disk was formatted as one partition on which Ubuntu was installed(Thus, no Windows now).



After booting up the laptop, an error comes as "No boot device found. Press any key to reboot." This probably happens because Windows is no longer there, and it's bootloader is still there(?). To boot to Ubuntu, I have to either select it manually in the boot options menu during startup by pressing the F12 key, or by setting up the boot option in my BIOS settings to UEFI instead of Legacy. If I select the UEFI boot option, then it directly boots up into Ubuntu, and this is what I'm currently using. I recently upgraded my Ubuntu to 14.04, and the situation is still the same.



Now, I want to install Windows 8.1 over my current system(along with Ubuntu 14.04). The problem is I already have a Windows bootloader(?) that's somehow left because of formatting of the hard-disk previously. I don't want to take any chances, so I'm posting this question.



I have the image file(iso) of Windows 8.1. How do I go about installing Windows 8.1 along side with Ubuntu 14.04(Already present)?



Thanks!

This is the output of df-h in terminal:



Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2 451G 163G 265G 38% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 3.9G 4.0K 3.9G 1% /dev
tmpfs 786M 1.3M 785M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 3.9G 788K 3.9G 1% /run/shm
none 100M 52K 100M 1% /run/user

/dev/sda1 487M 7.3M 479M 2% /boot/efi


-EDIT- Added information in response to Rod Smith's answer.
Here's the output for sudo parted /dev/sda print :



Model: ATA WDC WD5000LPVT-7 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt


Number Start End Size File system Name Flags
1 1049kB 512MB 511MB fat32 boot
2 512MB 492GB 491GB ext4
3 492GB 500GB 8453MB linux-swap(v1)


From your description, it sounds like you've installed Linux in EFI mode, but you've somehow set your firmware to boot in BIOS/CSM/legacy mode by default. This results in the "No boot device found" error message, because there's no BIOS/CSM/legacy boot loader. (Windows 8 and later are almost always installed in EFI mode on new hardware, so there would be no BIOS-mode boot loader when you bought the computer.) Adjusting your boot options to boot in EFI/UEFI mode by default (or equivalently, to disable BIOS/CSM/legacy support; the phrasing varies from one EFI to another) would probably get rid of the issue.



Moving forward, if I'm right about this, it's critical that you install Windows in EFI/UEFI mode. If you attempt to install in BIOS/CSM/legacy mode, Windows will complain about your GUID Partition Table (GPT) and refuse to install. Leaving BIOS-mode boot options active in your firmware might cause this to happen.




If I'm right, your computer already has the EFI System Partition (ESP) to which oldfred alluded. Windows and Ubuntu can share a single ESP. You will need to have either unallocated space or a ready-made NTFS partition for Windows' use, so you'll probably have to use GParted, as mrsud suggests, to prepare your disk. You'll need to do this from an Ubuntu live disk, since GParted can't modify any partition that's currently in use. Rather than use Boot Repair to restore GRUB, I recommend using bcdedit in Windows, since this is a more minimal option that's less likely to cause follow-on problems.



As a precaution, back up your ESP (/boot/efi from Ubuntu) to a USB flash drive or some other removable medium. That way, you can restore it in case the Windows installer trashes it. For that matter, backing up all your important user data is also advisable.



Before proceeding, you may want to check your boot mode and partition table type. When you boot Ubuntu in EFI mode, a directory called /sys/firmware/efi should be present. Look for it to verify that you're in EFI mode. To check your partition table, type sudo parted /dev/sda print. You should see output resembling the following:



$ sudo parted /dev/sda print
Model: ATA ST3000DM001-1CH1 (scsi)
Disk /dev/sda: 3001GB

Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 20.5kB 577MB 577MB fat32 EFI System boot
2 578MB 1102MB 524MB ext2 Ubuntu /boot
3 1102MB 1626MB 524MB Unused /boot
4 1626MB 3001GB 2999GB Linux LVM lvm



Yours will be different in many details from mine, but note the Partition Table line, which identifies the partition table as GPT or MBR (which shows as msdos, IIRC). Note also the FAT32 partition with the boot flag set -- that's the ESP. (Its entry in the Name column is descriptive for humans, and might not read EFI System, as mine does.)



If you don't have a /sys/firmware/efi directory and/or if your disk does not use GPT, then my interpretation of what you've written is wrong, and you should post back with details. (Edit your original question.) In this case, ignore everything I've written here -- or file it away for future reference -- since it doesn't apply if you've actually installed Linux in BIOS/CSM/legacy mode.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...