install dual boot on notebook HP 250 G6. Aug18
Forums / error reporting
- case hp ==> keine Hilfe
- case mint community ==> die lange Anleitung
single boot
(a) live boot usb
- create live boot usb as described in https://linuxmint.com/ installation instruction
(b) prepare BIOS etc.
Bios-Key on HP250: F10
- BIOS boot: legacy boot off
- BIOS boot: secure boot off
- BIOS boot bootsequence: put your live media (USB Stick for me) before harddisk/SSD
- Window: Fast Boot off (beim drücken des Netzschalters: herunterfahren)
(c) Live Session and install
- boot die Live USB and use the Live Session to test - change keyboard
- run the installation
- something else for repartitioning ....
- however, installation fails when setting up grub
- thus, install again from a terminal
sudo ubiquity -b
- does the same, without grub
(d) install grub (from the live session)
- find the EFI partition (small partition dos formatted, in my case sda1
-
sudo mkdir /boot/efi
-
sudo mount /dev/sda1 /boot/efi
- 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.
- sudo grub-install or grub-mkconfig didn't work
(e) boot manually from grub command line
- grub uses an american keyboard. I didn't bother to configure my swiss keyboard, but just looked at the american keyboard layout
-
ls
to see all partitions grub knows about. In my case (hd0,gpt1) etc. ls (hd0, gpt1)/
try through all partitions until you find the new linux partition - in my case (hd0,gpt2)set root=(hd0,gpt2)
– this specifies the partition from which to load the images.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)initrd /boot/initrd.img
– load this Initial RAM disk. this is normally alink to the img of the last installed kernelboot
– tell grub to boot with the above specs
(f) configure grub from the new linux
- efi should be mounted in /boot/efi, and grub ist in /boot/efi/EFI/ubuntu
sudo grub-mkconfig -o /boot/grub/grub.cfg
create a new config for the currently available OS imagessudo 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
- Solution see mint post
(a) prepare BIOS etc.
- BIOS boot: legacy boot off
- BIOS boot: secure boot off
- BIOS boot bootsequence: put your live media (USB Stick for me) before harddisk/SSD
- Window: Fast Boot off (beim drücken des Netzschalters: herunterfahren)
- 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
- boot from live usb, configure correct keyboard, prepare/delete partitions etc.
- in a terminal enter:
ubiquity -b
. This starts mint installation with the usual panels but without boot installation
(c) install grub
- find the EFI partition (small partition dos formatted, in my case sda1
-
sudo mkdir /boot/efi
-
sudo mount /dev/sda1 /boot/efi
- 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 )
- 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 )
-
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 -
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 - find the window loader in the EFI partition, in my case EFI/Microsoft/Boot/bootmgfw.efi
-
cd /boot/efi/EFI; sudo cp ubuntu/grubx64.efi Microsoft/Boot
copy grub to folder with windows loader -
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) - 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
- grub uses an american keyboard. I didn't bother to configure my swiss keyboard, but just looked at the american keyboard layout
-
ls
to see all partitions grub knows about. In my case (hd0,gpt1) etc. 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)set root=(hd0,gpt5)
– this specifies the partition from which to load the images.linux /vmlinuz ro root=/dev/sda5
– Load this Linux kernel, with arguments - /vmlinuz is normally a link to the last installed kernelinitrd /initrd.img
– load this Initial RAM disk. this is normally alink to the img of the last installed kernelboot
– tell grub to boot with the above specs
(f) configure grub - to linux
This configuration is done running the new linux the SSD.
- install grub-efi as explained in a paragraph (c)
- To do this from the live USB you must tell the installer to work for a different linux installation.
- This is done by
apt-get -o root=/dev/sda5 install grub-efi
- I'm not sure about the exact syntax, I havn't used it yet
- 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
-
cd /boot/grub; sudo mv grub.cfg.new grub.cfg
- rename the partly built config file to be active 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
- 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
- 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
- if the notebook comes back from hibernation, grub uses the timeout after error (30 secs), which I also change
GRUB_RECORDFAIL_TIMEOUT=3
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
- 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) 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
sudo dpkg -r grub-efi
removes the packagesudo 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
- 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.
- 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
- case hp ==> keine dual boot
- case mint community
- digitec mail ==> kein support
Vorschlag von administrollaattori
- install mint without grub:
ubiquity -b
- mit rEFInd
- bios secureBoot off, legacy off
- window fastBoot off
- Boot using liveDVD or USB
- Open Terminal and find EFI-partition
sudo blkid | grep vfat | grep EFI
- Mount EFI-partition under /boot (change sda? to actual EFI partition)
sudo mount /dev/sda? /boot
- Download rEFInd deb-package https://www.rodsbooks.com/refind/getting.html
- install with gdebi
- result boots to windows
- [TUTORIAL] Installing Mint on a Windows 8/8.1/10 Computer
- as suggested by answer from pensioner77 https://forums.linuxmint.com/viewtopic.php?f=46&t=275913#p1516490
- check efi boot
ls /sys/firmware
- prepare partition with e.g. gpparted
- 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
- sudo mkdir /boot/efi
- sudo mount /dev/sda1 /boot/efi
- cd /boot/efi/EFI; sudo cp -a Microsoft MicrosoftOrig
- cp ubuntu/grubx64.efi Microsoft/Boot
- cd /boot/efi/EFI/Microsoft/Boot; mv bootmgfw.efi bootmgfw.efi.orig; mv grubx64.efi bootmgfw.efi
- I removed live USB and boot now, grub shell comes up, to boot into linux use (according to Terminal Inflection: Instigating a Manual Boot from the GRUB Prompt
- attention american keyboard
ls
to find the partition to boot to linux (assume hd0,gpt5) * -l gab einmal schönes summary aber geht nicht mehrset root=(hd0,gpt5)
– this specifies the partition from which to load the images.linux /vmlinuz ro root=/dev/sda5
– Load this Linux kernel, with argumentsinitrd /initrd.img
– load this Initial RAM diskboot
– Fire it up.
- and finally I landed in linux on the SSD
- install grub-efi (with synaptic) ==> hangs forever
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
- switch off hidden timeout /etc/default/grub (prepend a # to make it comment):
#GRUB_HIDDEN_TIMEOUT=0
- to get a menu entry for windows
- 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 moresudo 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
sudo dpkg -r grub-efi
removes the packagesudo 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.
- install mint without grub: