I appologize for HORRENDOUSLY long post, but initially this post was about a bootloader issue with Artix and Windows. As I was writing the post and trying to recreate the environment, I ended up solving part of my issue. I'll be leaving the old post below as a reference because it is described the enviroment I am currently in.
TLDR: Initially I had Archlinux dual-booted with Windows 10. After installing Artix, both boot entries for Artix and Windows were gone, and the only way to boot to Artix was with the "Detect EFI bootloaders" option in the bootable USB, but no way to boot to Windows. After redoing the bootloader after using grub-install with the --removable flag (after the 2nd or 3rd time), the boot entry for Artix finally appeared.
Now, my current issue is getting UEFI to add Windows 10 as a boot entry, or at least getting it added a grub entry. I believe what I ought to do now is have os-prober, mount the Windows install partition, and rerun grub-mkconfig. This is the output:
[milky@art ~]$ pacman -Qs os-prober
local/os-prober 1.77-1
Utility to detect other OSes on a set of drives
[milky@art ~]$ sudo mount /dev/sdb2 /mnt
[milky@art ~]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
done
For some reason, os-prober is getting hung up on the bootable USB, and even removing the USB it still fails to find Windows.
Am I mounting the right partition? Is there any otherways to manually add or generate a .efi file for Windows? If I do set up the dual-boot for Windows, will it overwrite my grub bootloader since I added the --removable flag?
Thank you for your time in advance, I appreciate all the help I can get.
This is my first post, sorry if I don't follow proper formatting. My issue is similar to these posts on the Archlinux forums, however I can't seem to get it to fix my setup.
EFI GRUB not auto-detected, but can be manually loaded
"Reboot and Select proper Boot device" - UEFI Shell works fine
My mother board is the MSI Z170A GAMING PRO CARBON with fast and secure boot off, as well as booting in UEFI mode (as opposed to UEFI+Legacy). Originally I dual-booted Windows 10 and Archlinux, but after installing Artix from scratch and setting up the bootloader, both Windows and Artix boot entries were missing, and the only bootable option was the USB I used to install Artix. Booting to the USB, I was able to to find grub from using their "Detect EFI bootloaders" option, and from there I was able to boot to my Artix setup just fine.
Although both Windows 10 and Artix are gone as boot entries, I would be ok if we just focused on getting Artix as a boot entry, and I'll work on adding Windows 10 later.
To start, I'll show the output of commands I entered and try to recreate the environment.
Running fdisk -l:
[milky@art /]$ sudo fdisk -l
[sudo] password for milky:
Disk /dev/nvme0n1: 465.78 GiB, 500107862016 bytes, 976773168 sectors
Disk model: Samsung SSD 970 EVO 500GB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 54F74038-ACDA-E54E-A0DF-68F3BA20F81A
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 534527 532480 260M EFI System
/dev/nvme0n1p2 534528 67643391 67108864 32G Linux swap
/dev/nvme0n1p3 67643392 134752255 67108864 32G Linux root (x86-64)
/dev/nvme0n1p4 134752256 976773134 842020879 401.5G Linux home
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: BAF4061A-5108-4B24-908F-160E82C42849
Device Start End Sectors Size Type
/dev/sda1 2048 1953523711 1953521664 931.5G Microsoft basic data
Disk /dev/sdb: 223.58 GiB, 240057409536 bytes, 468862128 sectors
Disk model: SanDisk SD8SBBU2
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7C79CBC0-8756-03AB-F072-1E9FD5E1EA00
Device Start End Sectors Size Type
/dev/sdb1 2048 34815 32768 16M Microsoft reserved
/dev/sdb2 34816 467810288 467775473 223.1G Microsoft basic data
/dev/sdb3 467810304 468858879 1048576 512M Windows recovery environment
Disk /dev/sdc: 28.9 GiB, 31004295168 bytes, 60555264 sectors
Disk model: DataTraveler 3.0
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 64 1056543 1056480 515.9M 0 Empty
/dev/sdc2 1056544 1064735 8192 4M ef EFI (FAT-12/16/32)
To summarize:
/dev/nvme0n1 - Artix Install
/dev/sda - Extra Windows space
/dev/sdb - Windows install
/dev/sdc - Bootable Artix USB
Running lsblk:
[milky@art /]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 16M 0 part
├─sdb2 8:18 0 223.1G 0 part
└─sdb3 8:19 0 512M 0 part
sdc 8:32 1 28.9G 0 disk
├─sdc1 8:33 1 515.9M 0 part
└─sdc2 8:34 1 4M 0 part
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part /boot
├─nvme0n1p2 259:2 0 32G 0 part [SWAP]
├─nvme0n1p3 259:3 0 32G 0 part /
└─nvme0n1p4 259:4 0 401.5G 0 part /home
[milky@art /]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 16M 0 part
├─sdb2 8:18 0 223.1G 0 part
└─sdb3 8:19 0 512M 0 part
sdc 8:32 1 28.9G 0 disk
├─sdc1 8:33 1 515.9M 0 part
└─sdc2 8:34 1 4M 0 part
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part /boot
├─nvme0n1p2 259:2 0 32G 0 part [SWAP]
├─nvme0n1p3 259:3 0 32G 0 part /
└─nvme0n1p4 259:4 0 401.5G 0 part /home
[milky@art /]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
sdb 8:16 0 223.6G 0 disk
├─sdb1 8:17 0 16M 0 part
├─sdb2 8:18 0 223.1G 0 part
└─sdb3 8:19 0 512M 0 part
sdc 8:32 1 28.9G 0 disk
├─sdc1 8:33 1 515.9M 0 part
└─sdc2 8:34 1 4M 0 part
nvme0n1 259:0 0 465.8G 0 disk
├─nvme0n1p1 259:1 0 260M 0 part /boot
├─nvme0n1p2 259:2 0 32G 0 part [SWAP]
├─nvme0n1p3 259:3 0 32G 0 part /
└─nvme0n1p4 259:4 0 401.5G 0 part /home
Running grub-install:
[milky@art /]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported.
Running grub-mkconfig:
[milky@art /]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
done
The line "grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
done " is peculiar because /dev/sdc1 is the bootable drive. The error seems harmless, as I wouldn't want it to add a grub entry for the USB, but I don't remember getting this error when installing Archlinux a while back.
Now, checking efibootmgr -v:
[milky@art /]$ efibootmgr -v
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0000,0009,0006,0008
Boot0000* GRUB HD(1,GPT,46c7f9d2-ddc4-7c4c-9740-f6f96839b7f4,0x800,0x82000)/File(EFIGRUBgrubx64.efi)
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................,[email protected].=.X..........A...........................%8Q..n......H..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B........BO..NO..........T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .9. .4.6.G.3.X.Z.S.N........BO..NO..........S.a.n.D.i.s.k. .S.D.8.S.B.B.U.2.4.0.G.1.1.2.2....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L.6.1.1.3.2.9.6.4.5.8.0.1. . . . . . . . ........BO
Boot0008 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO..........K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................,[email protected].=.X..........A.......................F..Gd-.;.A..MQ..L.0.0.1.9.0.F.0.C.0.2.B.5.B.0.4.0.F.9.7.7.C.6.7.3........BO
Boot0009* UEFI: KingstonDataTraveler 3.0PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x101f20,0x2000)..BO
It would look like "Boot0000* GRUB" indicates that the entry was added, however when I actually go to reboot (I save this post as a draft and reboot)
The entry was no where to be seen, I had to boot the USB before booting to Artix. Also, running efibootmgr -v once more:
[milky@art ~]$ efibootmgr -v
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0009,0006,0008
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................,[email protected].=.X..........A...........................%8Q..n......H..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B........BO..NO..........T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .9. .4.6.G.3.X.Z.S.N........BO..NO..........S.a.n.D.i.s.k. .S.D.8.S.B.B.U.2.4.0.G.1.1.2.2....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L.6.1.1.3.2.9.6.4.5.8.0.1. . . . . . . . ........BO
Boot0008 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO..........K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................,[email protected].=.X..........A.......................F..Gd-.;.A..MQ..L.0.0.1.9.0.F.0.C.0.2.B.5.B.0.4.0.F.9.7.7.C.6.7.3........BO
Boot0009* UEFI: KingstonDataTraveler 3.0PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x101f20,0x2000)..BO
The "Boot0000* GRUB" was removed. Why is it not sticking, and how could I get it to stay there? Is this related to the Windows 10 boot entry disappearing as well? Why does "Detect EFI bootloader" find grub, but not UEFI?
Trying the solution in the post linked above, I'll try adding the --removable flag this time.
[milky@art ~]$ sudo grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable
Installing for x86_64-efi platform.
Installation finished. No error reported.
[milky@art ~]$ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
grub-probe: error: cannot find a GRUB drive for /dev/sdc1. Check your device.map.
done
[milky@art ~]$ efibootmgr -v
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0009,0006,0008
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................,[email protected].=.X..........A...........................%8Q..n......H..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B........BO..NO..........T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .9. .4.6.G.3.X.Z.S.N........BO..NO..........S.a.n.D.i.s.k. .S.D.8.S.B.B.U.2.4.0.G.1.1.2.2....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L.6.1.1.3.2.9.6.4.5.8.0.1. . . . . . . . ........BO
Boot0008 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO..........K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................,[email protected].=.X..........A.......................F..Gd-.;.A..MQ..L.0.0.1.9.0.F.0.C.0.2.B.5.B.0.4.0.F.9.7.7.C.6.7.3........BO
Boot0009* UEFI: KingstonDataTraveler 3.0PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x101f20,0x2000)..BO
[milky@art ~]$ efibootmgr -v
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0000,0009,0006,0008
Boot0000* GRUB HD(1,GPT,46c7f9d2-ddc4-7c4c-9740-f6f96839b7f4,0x800,0x82000)/File(EFIGRUBgrubx64.efi)
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................,[email protected].=.X..........A...........................%8Q..n......H..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B........BO..NO..........T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .9. .4.6.G.3.X.Z.S.N........BO..NO..........S.a.n.D.i.s.k. .S.D.8.S.B.B.U.2.4.0.G.1.1.2.2....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L.6.1.1.3.2.9.6.4.5.8.0.1. . . . . . . . ........BO
Boot0008 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO..........K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................,[email protected].=.X..........A.......................F..Gd-.;.A..MQ..L.0.0.1.9.0.F.0.C.0.2.B.5.B.0.4.0.F.9.7.7.C.6.7.3........BO
Boot0009* UEFI: KingstonDataTraveler 3.0PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x101f20,0x2000)..BO
And checking efibootmgr -v once more after rebooting:
[milky@art ~]$ efibootmgr -v
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,000A,0009,0006,0008
Boot0000* GRUB HD(1,GPT,46c7f9d2-ddc4-7c4c-9740-f6f96839b7f4,0x800,0x82000)/File(EFIGRUBGRUBX64.EFI)
Boot0006 Hard Drive BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0200)..GO..NO..........S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B....................,[email protected].=.X..........A...........................%8Q..n......H..Gd-.;.A..MQ..L.S.a.m.s.u.n.g. .S.S.D. .9.7.0. .E.V.O. .5.0.0.G.B........BO..NO..........T.O.S.H.I.B.A. .D.T.0.1.A.C.A.1.0.0....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . .9. .4.6.G.3.X.Z.S.N........BO..NO..........S.a.n.D.i.s.k. .S.D.8.S.B.B.U.2.4.0.G.1.1.2.2....................,[email protected].=.X..........A...........................>..Gd-.;.A..MQ..L.6.1.1.3.2.9.6.4.5.8.0.1. . . . . . . . ........BO
Boot0008 USB KEY BBS(HD,,0x0)/VenHw(5ce8128b-2cec-40f0-8372-80640e3dc858,0b00)..GO..NO..........K.i.n.g.s.t.o.n.D.a.t.a.T.r.a.v.e.l.e.r. .3...0.P.M.A.P....................,[email protected].=.X..........A.......................F..Gd-.;.A..MQ..L.0.0.1.9.0.F.0.C.0.2.B.5.B.0.4.0.F.9.7.7.C.6.7.3........BO
Boot0009* UEFI: KingstonDataTraveler 3.0PMAP, Partition 1 PciRoot(0x0)/Pci(0x14,0x0)/USB(16,0)/HD(1,MBR,0x0,0x101f20,0x2000)..BO
Boot000A* UEFI OS HD(1,GPT,46c7f9d2-ddc4-7c4c-9740-f6f96839b7f4,0x800,0x82000)/File(EFIBOOTBOOTX64.EFI)..BO
Well, as I write this post it looks like the boot entry is there, as I didn't need the USB to boot. I'm happy but I hate myself.