install dual boot on notebook HP 250 G6. Aug18

Forums / error reporting

single boot

(a) live boot usb

(b) prepare BIOS etc.

Bios-Key on HP250: F10

  1. BIOS boot: legacy boot off
  2. BIOS boot: secure boot off
  3. BIOS boot bootsequence: put your live media (USB Stick for me) before harddisk/SSD
  4. Window: Fast Boot off (beim drücken des Netzschalters: herunterfahren)

(c) Live Session and install

  1. boot die Live USB and use the Live Session to test - change keyboard
  2. run the installation
    • something else for repartitioning ....
  3. however, installation fails when setting up grub
  4. thus, install again from a terminal sudo ubiquity -b - does the same, without grub

(d) install grub (from the live session)

  1. find the EFI partition (small partition dos formatted, in my case sda1
  2. sudo mkdir /boot/efi
  3. sudo mount /dev/sda1 /boot/efi
  4. install grub-efi (e.g. using synaptic). Because we mounted the EFI partition, it will try an EFI installation and gets stuck, just kill it.
  5. sudo grub-install or grub-mkconfig didn't work

(e) boot manually from grub command line

  1. grub uses an american keyboard. I didn't bother to configure my swiss keyboard, but just looked at the american keyboard layout
  2. ls to see all partitions grub knows about. In my case (hd0,gpt1) etc.
  3. ls (hd0, gpt1)/ try through all partitions until you find the new linux partition - in my case (hd0,gpt2)
  4. set root=(hd0,gpt2) – this specifies the partition from which to load the images.
  5. linux /boot/vmlinuz ro root=/dev/sda2 – Load this Linux kernel, with arguments - /boot/vmlinuz is normally a link to the last installed kernel (in the new linux partition)
  6. initrd /boot/initrd.img – load this Initial RAM disk. this is normally alink to the img of the last installed kernel
  7. boot – tell grub to boot with the above specs

(f) configure grub from the new linux

  1. efi should be mounted in /boot/efi, and grub ist in /boot/efi/EFI/ubuntu
  2. sudo grub-mkconfig -o /boot/grub/grub.cfg create a new config for the currently available OS images
  3. sudo update-grub (I am not sure, whether this is really necessary.
  • update-grub etc. create the new /boot/grub/grup.cfg (on the linux parition). The /boot/efi/EFI/ubuntu/grup.cfg (on the efi partition) is only 3 lines and tells grub to use /boot/grub/grup.cfg.

dual boot on notebook hp 250 g6: the solution step by step

(a) prepare BIOS etc.

  1. BIOS boot: legacy boot off
  2. BIOS boot: secure boot off
  3. BIOS boot bootsequence: put your live media (USB Stick for me) before harddisk/SSD
  4. Window: Fast Boot off (beim drücken des Netzschalters: herunterfahren)
  5. shut down completely

(b) install linux

here I faced the problem, that the normal installation got stuck installing grub2 and/or general protection fault. Thus I need to install without grub

  1. boot from live usb, configure correct keyboard, prepare/delete partitions etc.
  2. in a terminal enter: ubiquity -b . This starts mint installation with the usual panels but without boot installation

(c) install grub

  1. find the EFI partition (small partition dos formatted, in my case sda1
  2. sudo mkdir /boot/efi
  3. sudo mount /dev/sda1 /boot/efi
  4. install grub-efi (e.g. using synaptic). Because we mounted the EFI partition, it will try an EFI installation and gets stuck, just kill it.

(d) activate grub

if you boot now, you land in windows. Because we havn't found anything that works, we will use a dirty trick: overwrite the windows loader by grub in the efi partition. Everything here is done in Linux on the live USB (adapted from UEFI Dual boot in HP computer )

  1. running linux from live USB install grub as described above. As described it does not finisch, but now we find grub on the EFI ( EFI/ubuntu/grubx64.efi )
  2. sudo cp -1 /boot/efi/EFI external; this is for anxious guys like me: copy the whole EFI partition to an external media (like USB or other PC in the network), soi I have a backup in case I destroyed too much
  3. cd /boot/efi/EFI; sudo cp -a Microsoft MicrosoftOrig because we do our dirty trick in the folder Microsoft, we need a copy of it to boot Windows later on
  4. find the window loader in the EFI partition, in my case EFI/Microsoft/Boot/bootmgfw.efi
  5. cd /boot/efi/EFI; sudo cp ubuntu/grubx64.efi Microsoft/Boot copy grub to folder with windows loader
  6. cd /boot/efi/EFI/Microsoft/Boot; mv bootmgfw.efi bootmgfw.efi.orig; mv grubx64.efi bootmgfw.efi copy grub over windows boot loader (anxious as ever, I renamed it beforehand)
  7. its a good idea to rename/remove also EFI/Microsoft/Boot/bootmgr.efi, otherwise it will confuse later grub-mkconfig

(e) boot linux from grub shell

if you remove the live USB and boot now, you land in the grub shell (no longer windows <> ! )

I booted from grub to linux, because I wanted to know as soon as possible, if my linux installed on SSD is running correctly. Alternatively, you could do the next paragraph (f) from the live USB.

I used Terminal Inflection: Instigating a Manual Boot from the GRUB Prompt where you find further details

  1. grub uses an american keyboard. I didn't bother to configure my swiss keyboard, but just looked at the american keyboard layout
  2. ls to see all partitions grub knows about. In my case (hd0,gpt1) etc.
  3. ls (hd0, gpt1)/ try through all partitions until you find the EFI partition and the linux partition - in my case (hd0,gpt1) and (hd0,gpt5)
  4. set root=(hd0,gpt5) – this specifies the partition from which to load the images.
  5. linux /vmlinuz ro root=/dev/sda5 – Load this Linux kernel, with arguments - /vmlinuz is normally a link to the last installed kernel
  6. initrd /initrd.img – load this Initial RAM disk. this is normally alink to the img of the last installed kernel
  7. boot – tell grub to boot with the above specs

(f) configure grub - to linux

This configuration is done running the new linux the SSD.

  1. install grub-efi as explained in a paragraph (c)
    1. To do this from the live USB you must tell the installer to work for a different linux installation.
    2. This is done by apt-get -o root=/dev/sda5 install grub-efi
    3. I'm not sure about the exact syntax, I havn't used it yet
  2. as explained this will not finish, but it started to build a config file /boot/grub/grub.cfg.new - if you don't find the file try update-grub or grub mkconfig
  3. cd /boot/grub; sudo mv grub.cfg.new grub.cfg - rename the partly built config file to be active
  4. sudo grub-update

Now the system boots directly to the new linux on the SSD <> - at least it did for me

(g) configure grub - show menu

  1. switch off hidden timeout in /etc/default/grub by prepending a # to the pertinent line. Then it's only a comment and looks like #GRUB_HIDDEN_TIMEOUT=0
  2. I also changed in the same file a set the timeout (how many seconds to show menu before booting to default) to a shorter delay GRUB_TIMEOUT=3
  3. if the notebook comes back from hibernation, grub uses the timeout after error (30 secs), which I also change GRUB_RECORDFAIL_TIMEOUT=3
  4. sudo grub-update

Now, booting shows the grub menu and gives me 3 seconds to choose something, before it boots the new linux

(h) configure grub - add windows

  1. edit /etc/grub.d/40_custom to yield
        exec tail -n +3 $0
        # This file provides an easy way to add custom menu entries.  Simply type the
        # menu entries you want to add after this comment.  Be careful not to change
        # the 'exec tail' line above.
        menuentry 'Windows 10' {
        	insmod part_gpt
        	insmod fat
        	set root='hd0,gpt1'
        	chainloader /EFI/MicrosoftOrig/Boot/bootmgfw.efi
        } 
    remember, (hd0,gpt1) is my EFI partition and /EFI/MicrosoftOrig/Boot/bootmgfw.efi the windows loader copied to a new location in paragraph (d3)
  2. sudo grub-update

Booting shows the grub menu and me choose between windows and linux. Everything runs ok, until .....

(h) cleanup packages

Software update or Synaptic no longer worked. They complained about broken packages and told me to fix it by sudo dpkg --configure -a. However, dpkg tries to finish installation of grub-efi and, of course, gets stuck forever. I had to manually remove several packages

  1. sudo dpkg -r grub-efi removes the package
  2. sudo dpkg --configure -a if it finishes ok we are done. If it gets stuck again, it mentioned a (dependent) package (e.g. grub-efi-amd64) ==> restart by step 1 above for this package.

<> suprise <> ! Mint update, package manager etc. work, Grub boots with the menu I wish. Even a new linux kernel is automatically integrated.

(i) warning - conclusion

I do not expect an update of grub itself or of the windows loader to work automatically - probably manual steps from this script are necessary. Thus

  1. carefully, document what you had to do, you might need it again, probably when you already forgot some crucial details. Also, if necessary, please document for the community. e.g. in this post.
  2. once the system runs, backup everything

If you know what to do, type fast and everything works ok, you can do this script in an hour. However, neither was true, when i unpacked my new notebook - 10 days ago.

Journal

Vorschlag von administrollaattori

  • install mint without grub: ubiquity -b
  • mit rEFInd
    1. bios secureBoot off, legacy off
    2. window fastBoot off
    3. Boot using liveDVD or USB
    4. Open Terminal and find EFI-partition sudo blkid | grep vfat | grep EFI
    5. Mount EFI-partition under /boot (change sda? to actual EFI partition) sudo mount /dev/sda? /boot
    6. Download rEFInd deb-package https://www.rodsbooks.com/refind/getting.html
    7. install with gdebi
    • result boots to windows
  • [TUTORIAL] Installing Mint on a Windows 8/8.1/10 Computer
    1. check efi boot ls /sys/firmware
    2. prepare partition with e.g. gpparted
    3. install ... something else - specify rootpartition, swap and efi Plus select efi at bottom
    • however it again gets stuck in installing grub2 and in syslog https://drive.google.com/open?id=1XHE_Lgr6XZ4kO4RwdowoE6oXaNs-1UQY you find again general protection fault: 0000 [#1] SMP and the backtrace is very similair to the one generated by the easy installation (install alongside windows), it is even identical another trace I produced with another an easy installation
    • thus, my conclusion: the easy installation and something else installation do the same thing until the error occurs
    • furthermore, the installed system had a lot of IO Errors, most functions did not work, (probablably) because of this
  • answer from administrollaattori https://forums.linuxmint.com/viewtopic.php?viewtopic.php?f=46&t=275913#p1516475 ==> The fix goes like UEFI Dual boot in HP computer -> https://forums.linuxmint.com/viewtopic.php?viewtopic.php?f=42&t=243338&p=1300722#p1300722
    • this means copying aroung grub stuff, however grub hasn't installed properly
    • from liveUSB
    1. sudo mkdir /boot/efi
    2. sudo mount /dev/sda1 /boot/efi
    3. cd /boot/efi/EFI; sudo cp -a Microsoft MicrosoftOrig
    4. cp ubuntu/grubx64.efi Microsoft/Boot
    5. cd /boot/efi/EFI/Microsoft/Boot; mv bootmgfw.efi bootmgfw.efi.orig; mv grubx64.efi bootmgfw.efi
    1. attention american keyboard
    2. ls to find the partition to boot to linux (assume hd0,gpt5) * -l gab einmal schönes summary aber geht nicht mehr
    3. set root=(hd0,gpt5) – this specifies the partition from which to load the images.
    4. linux /vmlinuz ro root=/dev/sda5 – Load this Linux kernel, with arguments
    5. initrd /initrd.img – load this Initial RAM disk
    6. boot – Fire it up.
    • and finally I landed in linux on the SSD
    1. install grub-efi (with synaptic) ==> hangs forever
    2. cd /boot/grub; mv grub.cfg.new grub.cfg - ??? if cfg.new is not there, try grub-mkconfig
    • after sudo grub-update the system boots directly to linux
    • however, the grup menu does not show up
    1. switch off hidden timeout /etc/default/grub (prepend a # to make it comment): #GRUB_HIDDEN_TIMEOUT=0
    • to get a menu entry for windows
    1. edit /etc/grub.d/40_custom
      exec tail -n +3 $0
      # This file provides an easy way to add custom menu entries.  Simply type the
      # menu entries you want to add after this comment.  Be careful not to change
      # the 'exec tail' line above.
      menuentry 'Windows 10' {
      	insmod part_gpt
      	insmod fat
      	set root='hd0,gpt1'
      	chainloader /EFI/MicrosoftOrig/Boot/bootmgfw.efi
      }
      gpt1 should be the efi partition! and once more sudo grub-update
    • now boot brings up grub menu, which let me choose between windows and linux
    • everything was ok, until I started software update which complained about broken packages and told me to fix it by sudo dpkg --configure -a
    • however, this command tries to finish installation of grub-efi and gets stuck forever
    1. sudo dpkg -r grub-efi removes the package
    2. sudo dpkg --configure -a gets stuck again, at a dependen package (e.g. grub-efi-amd64) ==> remove this package as above and try again, until this command finishes ok
    • suprise! mint update, package manager etc. word now and even boot starts grub menu as I wish. Even installing a new linux kernen works
    • the only thing, that i expect not to work automatically in future is an update of grub itself or of the windows boot.