1

So I have an HP EliteBook that is using UEFI instead of BIOS, which I was not aware of before. This is my first encounter with UEFI.

This laptop already had Windows 10 installed, and I wanted to dual boot a linux distribution to access some software that is not available in Windows. I downloaded Linux Mint 17.3 because I wanted to try something different than the standard Ubuntu install. Made a live USB from www.pendrivelinux.com Yumi tool, and proceeded to install Linux Mint.

Installation went through no problem, but then I couldn't boot the computer without USB stick. I can use the USB stick and "start from first hard drive", but without USB stick it says there is no hard drive present or something similar. With the USB stick I tried to mount Windows partition, but it can't because it says Windows is in suspended mode or something such. I read about how you have to turn off something in Windows 10 before you try to dual-boot, but it's too late to change that now, damage is already done. I would prefer to keep my windows disk if at all possible, but I don't mind wiping the linux stuff and starting over.

So I tried downloading the Windows 10 iso from microsoft.com and dd that to a USB stick with the Linux live CD. Doesn't work, I can't get it to boot from any other USB stick than the Live CD I first created from Windows with Yumi, no matter how hard I try. Then I tried making a partition on the hard drive with the Windows 10 installation medium, but that only shows a screen that "installation medium is missing" when I manage to boot into it with syslinux from the Yumi USB stick. So it seems I can't use Windows installation disk to reset the system, because this laptop doesn't have a CD drive.

After reading a lot about UEFI and EFI installations of Linux, I thought maybe I can get it to work with a new installation of a different distribution. So I tried Xubuntu and Ubuntu standard desktop. Both of them install fine, but refuse to boot after some error that I don't remember. So finally I downloaded the Gentoo LiveDVD but that doesn't even start the LiveDVD because it hangs on something like Windows is sleeping please fix your hard drive (like Mint and Ubuntu should have done, if they had then I would have been a lot more aware of the problems facing me). Anyway, nothing I tried installing will fix the issue. All installation mediums I tried just installs some version of GRUB and I have to use the Live USB Yumi stick to select "start from first hard drive" in order to get to the GRUB menu. And even then, they don't include Windows 10 in the GRUB menu, and they don't start themselves.

Linux Mind 17.3 that I installed first is still intact and can be started through the USB stick. And I can get most live distributions to run through the syslinux Yumi USB stick. Gentoo is the only one that completely refuse to start, with reference to Windows sleeping.

Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up refind (0.10.3-0ppa1) ...
Installing rEFInd to the ESP...
Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
Try 'modprobe efivars' as root.

I also tried to install rEFInd because I saw some discussion that it might help, but I get the above error and running modprobe efivars doesn't appear to do anything at all.

The linux installs all try to use GRUB. None of the distributions I tried so far have identified the need to use EFI.

So my question is, how can I revert back to before I tried to install any linux distro? How can I let my machine just step back to use EFI again instead of GRUB through USB-stick? Like I said, booting from a different USB doesn't work for whatever reason, so I can't use the rescue files.

Can I edit the EFI partition manually? I tried mounting it, and it's just some files, looks like a normal partition. But I can't find any guide for this through my googling so far...

$ sudo blkid 
/dev/sda1: LABEL="Windows RE Tools" UUID="EE9AA08D9AA0543D" TYPE="ntfs" 
/dev/sda2: LABEL="SYSTEM" UUID="3EA1-5B19" TYPE="vfat" 
/dev/sda4: LABEL="Windows" UUID="FE120EA9120E674D" TYPE="ntfs" 
/dev/sda5: UUID="86F6385CF6384EA5" TYPE="ntfs" 
/dev/sda6: UUID="ee115c6d-6d07-415f-92af-56ddf14f99f3" TYPE="ext4" 
/dev/sda7: UUID="f01d733f-f665-485e-afa5-254ecfecc6ec" TYPE="swap" 
/dev/sda9: UUID="00acda3f-fcfe-408d-a6c6-d692e85d3ea7" TYPE="ext4" 
/dev/sda10: LABEL="Windows10install" UUID="019A3789077F6B20" TYPE="ntfs" 
/dev/sdb1: LABEL="MULTIBOOT" UUID="3696-FEFE" TYPE="vfat" 
/dev/sdc1: LABEL="UDF Volume" TYPE="udf" 

$ sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA TOSHIBA MQ01ACF0 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system     Name                          Flags
 1      1049kB  1070MB  1068MB  ntfs            Basic data partition          hidden, diag
 8      1070MB  1074MB  4194kB                  bios_grub                     hidden, bios_grub, legacy_boot
 2      1074MB  1451MB  377MB   fat32           EFI system partition          boot
 3      1451MB  1585MB  134MB                   Microsoft reserved partition  msftres
 4      1585MB  171GB   170GB   ntfs            Basic data partition          msftdata
 5      171GB   172GB   868MB   ntfs                                          hidden, diag
 6      172GB   457GB   285GB   ext4            Basic data partition          msftdata
 9      457GB   472GB   15.0GB  ext4
10      472GB   478GB   5555MB  ntfs            Windows10install              boot, legacy_boot
 7      492GB   500GB   8126MB  linux-swap(v1)
GaRyu
  • 113
  • 6
  • Might want to consider trimming this down, or at least put the main points on bullets. – You'reAGitForNotUsingGit Jun 08 '16 at 12:20
  • Usually, the comment is "more info please"... – GaRyu Jun 08 '16 at 12:39
  • @GaRyu Not when you've written 830 words. Also this is not about Ubuntu, this is about Linux. – Tim Jun 08 '16 at 13:30
  • Most HP modify UEFI to use description and only valid description of course is "Windows Boot Manager". That is not allowed per UEFI standard. There are work arounds. http://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 The rEFInd option should have worked. Windows ISO is not configured for dd type install to flash drive. Make sure fast start is off in Windows and always boot installers in UEFI boot mode. You show a bios_grub, so somewhere you installed in BIOS mode. – oldfred Jun 08 '16 at 14:25
  • Did you try the EFI menu (some function key at power-on to give you a choice of boot devices and oses)? Select Windows, and it boots directly, no grub involved. – ubfan1 Jun 08 '16 at 21:50
  • @ubfan1 I did try that, and it doesn't work. As it turns out, my HP has a hybrid mode that allows both EFI and MBR devices. The Linux install USB had MBR and once booted assumed everything to have MBR, so the hard drive EFI information was corrupted. I have mounted the win partition as read only and copied data, and am currently trying to restore by a clean install and copy files back. – GaRyu Jun 09 '16 at 14:52

2 Answers2

0

I guess you have some data on Windows. So my advice you to boot from live CD and access the Windows partitions. Copy the data from there to another external drive, e.g. hard drive or USB. Now you are safe to experiment with dual booting.

Next time while doing dual boot keep these things in mind:

  1. Unselect turn on fast startup (recommended) from power settings in Windows.
  2. While installing Linux don't touch Windows partitions!
  3. While installing Windows make a separate partition for Linux!
  4. Always create a recovery drive of Windows to recover Windows in such situations.
  5. First install Windows and then Linux.
  6. You can keep UEFI. It doesn't create any problems.
Paramjit
  • 143
  • Marking this as correct answer, because it is what I ended up doing. The actual answer is a lot more complicated. Turns out that my HP has a hybrid mode that allows both UEFI and legacy MBR somehow at once. But booting on one medium forbids switching to another. The linux install USB was on a MBR and therefore proceeded to overwrite EFI even though it was there to begin with. I couldn't find a way to restore it, but I could mount the windows drive in read-only mode and copy the drive contents to an external drive. – GaRyu Jun 09 '16 at 14:48
  • It is nice to know that atleast your data is safe. Softwares can be installed and reinstalled again. – Paramjit Jun 09 '16 at 15:07
0

It's a very long ... question. I will try to clarify just some parts of it.

  1. ...using UEFI instead of BIOS is an inaccurate statement. As far as i know, a motherboard can have either a UEFI or BIOS, not both. There have been some early hybrids (UEFI+BIOS) motherboards, but they were rapidly abandoned because of multiple problems. If your HP was UEFI, it will forever be UEFI, not BIOS. UEFI is an evolution of BIOS.
    UEFI = Unified Extensible Firmware Interface
    BIOS = Basic Input Output System

  2. The linux installs all try to use GRUB. This statement is accurate. GRUB = GRand Unified (linux) Bootloader. All linuxes use GRUB. Windows uses a bootloader too. It's called winboot (for W7+) or ntldr (for WinXP).
    No operating system can startup without a proper bootloader. The bootloader is like the middleman between the hardware and the operating system.

  3. None of the distributions ... need to use EFI. But they all do. On all EFI hardware systems, ALL installed operating systems NEED to use a special partition called the EFI partition. The EFI partition is the keeper of partition table data/records. If you delete the EFI partition ALL installed operating systems will be rendered inoperable.

  4. No need to edit the EFI partition really. But you can edit the partition table (add, delete, merge, resize partitions) by using GParted or other partitioning software.

  5. What the he*l is this partition table? Partition table keeps the records about all disk devices (hard drives, USB mass storage, external hdd, sd cards, all storage devices in general), like how many partitions, what size, type, label, order, etc.
    Partition table can be of two types: MBR (older style) or GPT (newer style).
    MBR = Master Boot Record
    GPT = GUID Partition Table (GUID = Globally Unique Identifier)
    Typically MBR style is traditionally associated with BIOS motherboards, but it can be used on UEFI mbs also.
    GPT style can only be used on UEFI systems, it is not supported by BIOS mbs.
    MBR partition table is always kept on the first partition.
    GPT partition table is always kept on the EFI partition, AND it also has a backup at the end of the disk.
    When MBR gets corrupted, they are usually gone for good. That means you have to reinstall EVERYTHING.
    When GPT gets corrupted, the PC will automatically load the backup and replace the corrupted.

  6. Getting back to Win10. Boot up a Live Ubuntu and open GParted. Delete all ext and swap partitions. Make sure you don't delete FAT and ntfs partitions, Windows might need those. Reboot and remove Live Ubuntu medium. Next GRUB menu might appear or some window telling you Windows is broken. In either case you need to repair Win bootloader. Insert Windows install disk, reboot into Win installer, choose Repair Windows option and let it do its' thing. When repair is complete reboot into your repaired Windows.

ipse lute
  • 2,584