1

I'm having trouble setting up a dual boot with Windows 10 and Ubuntu 16.04 (Game-pack) on an HP Pavilion Gaming Laptop (15 -cx0049nr).

I realize that many, many questions have been asked on this, but I have read dozens of threads and tried all sorts of solutions with no luck.

So far, I cleared space with the disk management tool, disabled fast boot, hibernation and secure boot and installed Ubuntu with a live USB successfully. Right after installation, I found that if I hit F9 right away while restarting, I get the boot device list, and can choose Ubuntu. But if I don't hit F9, it goes straight to Windows. At the next reboot, if I hit F9, the Ubuntu folder and all related .EFI files are gone.

Going back into Windows, the disk management utility shows the Ubuntu partition as unallocated space. Diskpart can't find it either. Exploring the EFI partition after mounting it with Diskpart confirms that the Ubuntu folder and all grub files are gone. It's like Windows has rewritten the EFI partition and refuses to acknowledge the Ubuntu partition.

So far, I have tried:

  • Loading the liveUSB and running boot repair. This allows me to get in with F9 at start as before, until the first time that Windows boots. (At this point, fdisk -l indicates that there is a discrepancy between primary and backup GPT partition tables. Gdisk can fix it, but it comes back every time.)
  • Installing rEFInd, which can't find any Ubuntu EFI files.
  • Installing EasyUEFI, which also can't find any Ubuntu EFI files.
  • Creating a boot entry for Ubuntu with bcdedit, which persists through multiple boots, but points to nothing (Error code 0xc00000076).

I'm at a loss as to where to go next.

In the live environment, with the Ubuntu install inaccessible, sudo parted -l indicates that the backup GPT table is corrupt, but the primary is OK, and shows:

Model: ATA ST1000LM049-2GH1 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                                      Flags
 1      1049kB  274MB   273MB   fat32           EFI system partition              boot, esp
 2      274MB   290MB   16.8MB                  Microsoft reserved partition  msftres
 3      290MB   551GB   550GB   ntfs            Basic data partition          msftdata
 6      551GB   969GB   419GB   ext4
 7      969GB   982GB   12.8GB  linux-swap(v1)
 4      982GB   983GB   1028MB  ntfs            Basic data partition          hidden, diag
 5      983GB   1000GB  16.9GB  ntfs            Basic data partition            hidden, msftdata


efibootmgr
BootCurrent: 0001
      Timeout: 0 seconds
      BootOrder: 2001,0000,3000,2002,2004
      Boot0000* Windows Boot Manager
      Boot0001* USB Hard Drive (UEFI) - KingstonDataTraveler 2.0           (KingstonDataTraveler 2.0)
      Boot0002* Internal EFI Shell
      Boot0004* Internal EFI Shell
      Boot0005* Default hard drive Boot
      Boot0006* Internal EFI Shell
      Boot0007* Windows Boot Manager
      Boot0008* Default hard drive Boot
      Boot2001* EFI USB Device
      Boot3000* Internal Hard Disk or Solid State Disk
Eliah Kagan
  • 117,780
  • 1
    Hi brian, I won't set this as a duplicate of https://askubuntu.com/questions/221835/how-do-i-install-ubuntu-alongside-a-pre-installed-windows-with-uefi/228069 because I can see a couple of different issues but can you check that answer and see if it helps. – Luis Alvarado Apr 16 '19 at 23:41
  • One interesting idea I found in that thread is to create a partition in Windows, then reformat it in the liveUSB. Trying this, I found that my newly created Windows partitions were not visible in linux- Gparted showed them as unallocated, just like disk management in windows couldn't see linux partitions – brianjskier Apr 17 '19 at 00:22
  • Thank you. Please check since I can't confirm this is a duplicate unless you confirm the other answer working for you. This is because of the type of issue. – Luis Alvarado Apr 17 '19 at 00:53
  • You should not touch bcdedit unless you know what you are doing. Go back to Live Ubuntu and post up output to sudo parted -l and efibootmgr. – Paul Benson Apr 17 '19 at 01:00
  • Have you updated UEFI? Some with HP say it now works and it seems to be those who updated to latest UEFI from HP. – oldfred Apr 17 '19 at 02:50
  • I have thoroughly read previously mentioned post 221835, those solutions don't seem to solve the problem. – brianjskier Apr 17 '19 at 04:49
  • I did update the BIOS on my machine, with no change in this problem. – brianjskier Apr 17 '19 at 04:50

2 Answers2

2

Finally resolved: Disable Optane memory from BIOS menu. This issue (and many others in my system) stemmed from Intel's new Optane technology. Apparently the optane memory is just a 16gb SSD with a special driver that allows it to store an image of the current Windows state that is not visible or modifiable by the user. The driver also renders the drive as invisible to both Windows and Linux. Thanks, Intel. See Intel's FAQ for more info (https://www.intel.com/content/www/us/en/support/articles/000024018/memory-and-storage/intel-optane-memory.html) I finally got past this issue by disabling the optane memory in my BIOS options, after which point my system started to behave as expected. It seems that the bootloader looked at the Optane first, so nothing I did to my regular SATA drive had any visible effect on the bootloader, or Windows. Wiser users than I can probably figure some way to use this extra SSD to advantage. If you're a basic user like me with a new HP laptop with Optane memory facing similar issues, try disabling the optane drive in BIOS.

  • Kuai Yu, thanks for your answer. I did follow your instructions, which was also helpful to some degree. But imagine my surprise when I completely razed my hard drive using dd, then restarted and saw Windows boot without a hitch! – brianjskier Apr 26 '19 at 01:04
  • I literally can't thank you enough. I couldn't get the ubuntu installation to go to Grub no matter how hard I tried. I must have installed and reinstalled Ubuntu at least 20 times. Turns out when I accidentally selected the optane drive for boot loader installation(/dev/nvme1n1) I was able to get something into BIOS, but that kept failing. Finally, because of you, I disabled Optane via Intel RST, and boom! Grub! – cst1992 Mar 03 '20 at 05:52
  • You'll be astonished to know that Optane has another significant downside - it slows down the main NVMe drive. When optane was enabled, the speed(as per Qwikmark) of file transfer on the C: drive was barely 330 MB/s; whereas with Optane disabled it was 997 MB/s. With newer 970 Evo SSDs the speed can go all the way to 2500 MB/s! Look what we're being given. – cst1992 Mar 03 '20 at 16:48
0

This answer may not help, or may be your last resort ...I have more or less the same problem when I first bought my new Lenovo laptop 2 weeks ago, I used to use Asus for a long time in windows, and I did do a clean install some years ago before I start using Ubuntu, so I didn't have any problem with dual boot. With the new one after trying many ways, I thought that the windows from laptop manufacturer may have some mechanism to stop you using other OS, so I finally decided formatting the entire drive and re install a clean windows, and then install ubuntu alongside windows, this works for me, plus I don't need those stupid extra build-in apps come with manufacturer, so now both my ubuntu and windows are clean. Almost every day I use both, ubuntu for work and windows for gaming, no problem.

Negrito
  • 794
  • 1
  • 11
  • 25
  • I've considered that. But wouldn't I have to purchase another copy of Windows? – brianjskier Apr 17 '19 at 04:53
  • No, for windows these days ( even from my Asus bought 7 years ago) , the MS windows recognizes the motherboard, so as long as you don't change your motherboard, you can clean install Windows as many times as you want. – Negrito Apr 17 '19 at 04:57
  • How did you format the hard drive? With the recovery tool? Windows 10 has crashed beyond repair twice since I got this computer, which is what makes me so keen to get ubuntu going. But fresh reinstalls don't seem to help – brianjskier Apr 17 '19 at 05:06
  • No, just insert your windows live USB/DVD, choose the install instead of repair, then it will lead you to disk partition, I just choose to format everything, if you have some issue with MBR format look at this video https://youtu.be/mNT0GWeGBTw – Negrito Apr 17 '19 at 05:10
  • This way you should have a clean windows installed – Negrito Apr 17 '19 at 05:10
  • Thank you, I'll try it. Do you think installing a second hard drive would be a good option to try before wiping everything? – brianjskier Apr 17 '19 at 07:22
  • There is a similar answer here https://askubuntu.com/questions/1134258/dual-boot-ubuntu-windows-ssd-in-caddy/1134262?noredirect=1#comment1880101_1134262 hope it helps – Negrito Apr 17 '19 at 08:59
  • You don't need to reinstall Windows as you're booting up fine into it. Efibootmgr is showing curious results with Windows as 1st boot which is part of the problem and no Ubuntu showing. Note the boot order. To start with, you could try experimenting eg, making 0005, 0002 or 3000 as 1st boot. If you find you cannot boot into either OS go back to original boot order from Live USB. – Paul Benson Apr 17 '19 at 12:05
  • That's exactly the problem- windows is deleting the ubuntu folder and all grub files. Every time windows boots, the efi partition is restored to factory condition. Those boot options point to windows boot loader, windows boot manager and the hp recovery tools. – brianjskier Apr 17 '19 at 16:46
  • I think what I need is a way to make a copy of grub persist in that partition that can't be wiped out by windows. Or could I create a second EFI partition with gparted that my bios would recognize? – brianjskier Apr 17 '19 at 16:47
  • l doubt that Windows is deleting anything. sudo parted -l shows an Ubuntu partition, sda6 exists. What you need to do is mount it from U. Live,sudo mount /dev/sda6 /mnt, then use Nautilus to explore /mnt/boot and check for grub folder within and its subfolders as well as EFI folder and subfolders. – Paul Benson Apr 17 '19 at 17:04
  • OK, I've done that. the efi folder in sda6 is empty, grub appears to contain the usual grub files. But I believe that my computer looks at /dev/sda1 as its ESP. There, I can see that the ubuntu folder and grub files are indeed still present. So why doesn't the boot loader see them after windows loads? – brianjskier Apr 17 '19 at 19:35
  • The efi folder in sda6 should not be empty. It should contain an EFI folder, which includes all the subfolders and files found in the EFI folder in sda1, ie Ubuntu, Microsoft and Boot folders and their contained subfolders and files. You need to copy these 3 folders over from sda1 to sda6 to EFI in sda6. Does sda6 show all the other usual system folders, ie usr, var, dev, sys, etc? – Paul Benson Apr 17 '19 at 23:51
  • Yes, all system folders are there. I have copied the contents of EFI from sda1 to sda6, without any noticeable effect. I continue to find that repairing the primary GPT partition table and rewriting efibootmgr will allow me to access ubuntu once, by pressing F9 at startup. But still, as soon as windows boots successfully, the ubuntu option disappears from the computer's boot loader menu. – brianjskier Apr 18 '19 at 17:18
  • Maybe the boot loader menu is being copied from a backup folder somewhere. In that case, I'd need to get the ubuntu efi folder copied to there. But why can't I see any ubuntu files, folders or partitions from windows at all? – brianjskier Apr 18 '19 at 17:20
  • Live Ub. is showing nothing wrong with the gpt. If there was you would not be able to boot to Windows. Probably the best thing you can do is open gparted in Live Ub., delete sda6, then make a new ext4 partition and reinstall Ubuntu. Alternatively, before you do that have a look at this, especially steps 3 and 4. – Paul Benson Apr 22 '19 at 13:33