Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Dual boot debian + windows: debian default boot

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
solitone
Posts: 24
Joined: 2015-12-13 08:17

[SOLVED] Dual boot debian + windows: debian default boot

#1 Post by solitone »

I have a computer with UEFI firmware (an HP Pavilion 15-n234sl). I installed debian alongside my original windows several months ago. Everything was fine, but one annoying thing was I had to press F9 key at startup, in order to enter EFI boot menu and select debian loader. That would start grub, and there I could choose debian (default) or windows. Otherwise, if I did not press F9, windows boot loader would start by default. Since I use debian almost all the time, I wanted to change that.

I fiddled with efibootmgr, and tried to change boot order, but everytime I restarted the computer, something would reset my boot settings, and windows boot manager would start again (it seems a buggy EFI implementation in HP Pavilion's firmware).

I found the solution reading suggestion #3 in this post: https://bbs.archlinux.org/viewtopic.php ... 6#p1317716. As suggested, I set the default boot loader in windows via its bcdedit command. Here's what I did:
  1. Opened a command prompt with administrator privileges. I used the diskpart command to view the disk partitions. I selected my only disk (disk 0), and listed the details of the volumes on that disk, including the drive letter. Since the drive letter was not assigned to my ESP partition, used the assign command to assign a volume letter to the ESP (the following is just an example, it doesn't correspond to my actual partitions; see https://technet.microsoft.com/en-gb/lib ... s.10).aspx for further details):

    Code: Select all

    Diskpart
    DISKPART> select disk 0
    DISKPART> list volume
      Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
      ----------  ---  -----------  -----  ----------  -------  ---------  ------
      Volume 0     D                NTFS   Partition    103 GB  Healthy
      Volume 1     C                NTFS   Partition     49 GB  Healthy    Boot
      Volume 2                      FAT32  Partition   2000 MB  Healthy    System
    DISKPART> select volume 2
    DISKPART> assign letter=U
  2. With bcdedit, I set the device to the drive letter for the EFI System Partition (ESP). I had to do this from CMD.exe rather than PowerShell, otherwise it didn't work:

    Code: Select all

    bcdedit /set {bootmgr} device partition=U:
  3. Finally, I set grub as the default boot loader (double check the path is correct):

    Code: Select all

    bcdedit /set {bootmgr} path \EFI\debian\grubx64.efi
Now grub starts by default (no more need to press F9), and if I will I can boot windows from there. Otherwise, it defaults to debian. :wink:

Post Reply