You are not logged in.

#1 2016-03-07 05:22:10

atczaja
Member
Registered: 2015-01-05
Posts: 6

Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

I installed Fedora several months ago for school work, but I've used Arch for much longer and am trying to replace my Fedora installation with Arch. My laptop is a Lenovo U430p.

My main hard drive is /dev/sdb. My efi system partition is /dev/sdb2 and is already FAT32. I have not formatted this partition for fear of losing crucial efi data. I created /dev/sdb8 for /boot and formatted it as ext4, /dev/sdb9 as swap, and /dev/sdb10 for / and formatted it as btrfs. I mounted /dev/sdb2 as /boot/efi "mount /dev/sdb2 /mnt/boot/efi" at install time.

I installed grub with "grub-install /dev/sdb --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub" and created the grub config with "grub-mkconfig -o /boot/grub/grub.cfg"

Upon first reboot, the I saw the Arch grub screen with an entry for Arch, but not for Windows. I booted into Arch, opened a terminal, reinstalled os-prober, reran grub-mkconfig where it said it found Windows, and rebooted. When I rebooted, grub had entries for Arch and Windows, so I selected Windows to make sure it worked, and it did. Windows booted successfully. Then, when I rebooted to finish installing packages in Arch, I saw the old Fedora grub screen with entries for Fedora and Windows. Now, I can't get the Arch grub menu back. Windows still boots when I select the Windows entry from Fedora's grub menu.

How do I get my computer to use Arch's grub and not to revert to Fedora's when I choose Windows?

I'm glad to reboot into the live environment on the installation USB, remount my partitions and arch-chroot into them and run any commands to acquire more information on my setup.

Thank you!

Offline

#2 2016-03-07 05:33:28

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

What is the output of

efibootmgr -v

Moving to NC.

Offline

#3 2016-03-07 06:10:03

atczaja
Member
Registered: 2015-01-05
Posts: 6

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

Here's the output of efibootmgr -v

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0005,0004,2001,2003,0001,2002
Boot0000* EFI USB Device (USB Blash Memory)        PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(3x0)/HD(1,MBR,0x4294967285,0x800,0xe88580)RC
Boot0001* Lenovo Recovery System        HD(3,GPT,09820979-cf40-4385-a1e8-b677cc587d1e,0x276800,0x1f4000)/File(\EFI\Microsoft\Boot\LrsBootMgr.efi)RC
Boot0002* EFI Network 0 for IPv4 (C4-54-44-80-D8-6A)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(c4544480d86a,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)RC
Boot0003* EFI Network 0 for IPv6 (C4-54-44-80-D8-6A)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(c4544480d86a,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0004* Windows Boot Manager    HD(2,GPT,5cf64833-7cd1-4462-a38a-0a7c6b40587e,0x1f4800,0x1f480,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0005* Fedora    HD(2,GPT,5cf64833-7cd1-4462-a38a-0a7c6b40587e,0x1f4800,0x82000)/File(\EFI\fedora\shim.efi)
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM    RC
Boot2003* EFI Network    RC

Offline

#4 2016-03-07 11:13:30

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

I don't see any entry for Arch Linux in that output.

I recommend that you boot from Arch Live media, then remove the fedora entry from efibootmgr and reinstall grub.

Also, please use code tags for posting output.

Offline

#5 2016-03-07 15:21:27

atczaja
Member
Registered: 2015-01-05
Posts: 6

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

Just to check before I do this:
I would reboot into the live media, mount my partitions again

mount /dev/sdb10 /mnt
mount /dev/sdb8 /mnt/boot
mount /dev/sdb2 /mnt/boot/efi
arch-chroot /mnt

and run the command

efibootmgr -b 5 -B

to delete  the fifth boot entry according to the last output.
And then reinstall grub to /dev/sdb and regenerate the config?

Offline

#6 2016-03-07 18:23:27

atczaja
Member
Registered: 2015-01-05
Posts: 6

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

Since the Fedora entry was the fifth efi boot entry, I ran the command mentioned in my last post. Now, I just get the Windows boot manager with no grub.

Here's what I did.

Booted into live media and ran

 fdisk -l /dev/sdb 

to verify partition numbers. Here's that output.

DIsk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
I/O size (minumum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifies: 5FFC5693-5D9E-4A20-B014-F0167426B190

Device			Start   End   Sectors   Size   	Type
/dev/sdb1   									Windows recovery environment
/dev/sdb2										EFI System
/dev/sdb3										Lenovo boot partition
/dev/sdb4										Microsoft reserved
/dev/sdb5										Microsoft basic data
/dev/sdb6										Microsoft basic data
/dev/sdb7										Windows recovery environment
/dev/sdb8										Linux filesystem
/dev/sdb9										Linux swap
/dev/sdb10									Linux filesystem

(Please forgive the missing numbers in the middle. I took pictures of the output and retyped it after booting Windows to paste here. I have not yet figured out how to save text files to the installation USB.)

Then I mounted with

mount /dev/sdb10 /mnt
mount /dev/sdb8 /mnt/boot
mount /dev/sdb2 /mnt/boot/efi

and

 arch-chroot /mnt 

into the system.

I ran

 efibootmgr -v 

to check it was the same as my last post, and it was. Then, I ran

 efibootmgr -b 0005 -B 

. The new output for

 efibootmgr -v 

output was this:

BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0004,2001,2003,0001,2002
Boot0000* EFI USB Device (USB Blash Memory)		PciRoot(0x0)/Pci(0x1d,0x0)/USB(0,0)/USB(3x0)/HD(1,MBR,0x4294967285,0x800,0xe88580)RC
Boot0001* Lenovo Recovery System		HD(3,GPT,09820979-cf40-4385-a1e8-b677cc587d1e,0x276800,0x1f4000)/File(\EFI\Microsoft\Boot\LrsBootMgr.efi)RC
Boot0002* EFI Network 0 for IPv4 (C4-54-44-80-D8-6A)	PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(c4544480d86a,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)RC
Boot0003* EFI Network 0 for IPv6 (C4-54-44-80-D8-6A)	PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(c4544480d86a,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0004* Windows Boot Manager	HD(2,GPT,5cf64833-7cd1-4462-a38a-0a7c6b40587e,0x1f4800,0x1f480,0x82000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

I then ran

 grub-install /dev/sdb --target=x86_64-efi --boot-directory=/boot/efi --bootloader-id=grub 

, and the output was:

Installing for x86_64-efi platform.
[  321.659959] FAT-fs (sdb2): Corrupted directory (i_pos 131210)
grub-install: error: cannot open '/boot/efi/EFI/grub/grubx64.efi': Input/output error.

I then ran

 grub-mkconfig -o /boot/grub/grub.cfg 

, and the output was:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
found fallback initramfs image: /boot/initramfs-linux-fallback.img
	/run/lvm/lvmetad.socket: connect failed: No such file or directory
	WARNING: Failed to connect to lvmetad. Falling back to internal scanning.
[  361.489131] FAT-fs (sda1): bogus number of reserved sectors
[  361.491390] squashfs: SQUASHFS error: Can't find a SQUASHFS superblock on sda1
[  361.492426] EXT4-fs (sda1): VFS: Can't find ext4 filesystem
[  361.495282] EXT4-fs (sda1): VFS: Can't find ext4 filesystem
[  361.497051] EXT4-fs (sda1): VFS: Can't find ext4 filesystem
[  363.054089] FAT-fs (sdb4): bogus number of reserved sectors
[  363.056308] squashfs: SQUASHFS error: Can't find a SQUASHFS superblock on sdb4
[  363.058376] EXT4-fs (sdb4): VFS: Can't find ext4 filesystem
[  363.060294] EXT4-fs (sdb4): VFS: Can't find ext4 filesystem
[  363.062165] EXT4-fs (sdb4): VFS: Can't find ext4 filesystem
done

I then reran

 efibootmgr -v 

to see if a new boot entry appeared since running it earlier, and there wasn't. The output was the same as written earlier in this post.

Please let me know what you think may be causing there to not be a boot entry for Arch, and how I could fix it.

Thank you very much!

Offline

#7 2016-03-07 20:09:42

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: Dual Booting Linux with Windows 10, but Changing from Fedora to Arch

atczaja wrote:
Installing for x86_64-efi platform.
[  321.659959] FAT-fs (sdb2): Corrupted directory (i_pos 131210)
grub-install: error: cannot open '/boot/efi/EFI/grub/grubx64.efi': Input/output error.

Looks like the GRUB .efi loader is corrupted, perhaps along with some other files on the ESP.

Try re-installing GRUB to get new copies of the files.

If your motherboard NVRAM isn't accepting new entries, you can try the "--removable" flag with `grub-install` to copy the GRUB .efi loader to the default loader location.

# grub-install --target=x86_64-efi --boot-directory=/boot/efi --bootloader-id=grub --removable

EDIT: "/dev/sdb" is not needed for the UEFI `grub-install` command.

Alternatively, copy the .efi loader across manually:
https://wiki.archlinux.org/index.php/GR … workaround

It's a shame that you decided to mount the ESP to /boot/efi as otherwise we could try systemd-boot instead.

Last edited by Head_on_a_Stick (2016-03-07 20:11:39)


Jin, Jîyan, Azadî

Offline

Board footer

Powered by FluxBB