You are not logged in.

#1 2017-09-03 04:45:24

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Grub does not find Arch [SOLVED]

I was having trouble with Windows 10 updating so I reformatted all of the partitions except for sda6, where Arch is, and sda5, which is the swap partition. Windows installed fine. I used an Arch live USB drive to reinstall Grub. I did arch-chroot and  re-installed Grub. Grub appears to work fine except that it does not find Arch. I installed os-prober from another usb drive. It gives me an error mentioned in the Arch wiki, "Warning: failed to connect to lvmetad. Falling back to device scanning." and another error about no grub on sdb1, which I'm guessing is the live USB drive I'm using to chroot on.

The system is UEFI. My partitions are sda1: Windows Recovery, sda2: UEFI bootloaders, sda3: Windows reserved partition, sda4: Windows 10, sda5: Arch swap, sda6: Arch

Thank you for any help!

Last edited by paulbarbee (2017-09-04 02:30:52)

Offline

#2 2017-09-03 05:05:54

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

Paste your partition table and grub config.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-09-03 05:50:52

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

fdisk -l>file.txt
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
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: 1DCFBB15-B3FA-4794-90DE-C4C5B9FD1255

Device         Start        End    Sectors   Size Type
/dev/sda1       2048     923647     921600   450M Windows recovery environment
/dev/sda2     923648    1128447     204800   100M EFI System
/dev/sda3    1128448    1161215      32768    16M Microsoft reserved
/dev/sda4    1161216  413331455  412170240 196.6G Microsoft basic data
/dev/sda5  413331456  413396991      65536    32M Linux swap
/dev/sda6  413396992 1953525134 1540128143 734.4G Linux filesystem




Disk /dev/sdb: 29.8 GiB, 31935430656 bytes, 62373888 sectors
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: 0x2870ac4c

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1  *        0 1060863 1060864  518M  0 Empty
/dev/sdb2         164  131235  131072   64M ef EFI (FAT-12/16/32)


Disk /dev/loop0: 404.1 MiB, 423747584 bytes, 827632 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

/boot/grub/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt6'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  72282b9e-4371-4ed2-a484-c19612a645b4
else
  search --no-floppy --fs-uuid --set=root 72282b9e-4371-4ed2-a484-c19612a645b4
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=30
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=30
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 "Firmware setup" {
    fwsetup
}

if [ "${grub_platform}" == "efi" ]; then
    menuentry "Microsoft Windows 10" {
        insmod part_gpt
        insmod fat
        insmod search_fs_uuid
        insmod chain
        search --fs-uuid --set=root $hints_string $fs_uuid
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
fi
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Last edited by paulbarbee (2017-09-03 05:57:10)

Offline

#4 2017-09-03 05:51:31

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2017-09-03 05:57:32

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

Edited with code tags. Thank you!

Offline

#6 2017-09-03 06:01:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

I don't use grub, but there doesn't appear to be an entry for Arch there...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2017-09-03 06:12:07

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

Right, and I'm not sure why there isn't one. According to the wiki it should happen automatically when the command

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

is run.

By default the generation scripts automatically add menu entries for Arch Linux to any generated configuration.

From https://wiki.archlinux.org/index.php/GRUB

Offline

#8 2017-09-03 06:19:43

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

https://wiki.archlinux.org/index.php/GRUB#Dual-booting it says the best way is to add them manually...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2017-09-03 06:27:18

Fixxer
Member
From: Poland
Registered: 2011-08-29
Posts: 210

Re: Grub does not find Arch [SOLVED]

Post output of bootinfoscript:
https://sourceforge.net/projects/bootinfoscript/ .

Offline

#10 2017-09-03 07:13:26

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

Looking at the "Other Linux" entry in the wiki I realised I didn't have the kernel in /boot. /Smacks head/ I ran

#pacman -U /var/cache/pacman/pkg/linux-4.xx-x.pkg.tar.xz

and it boots now.


Thank y'all so much! big_smile

Offline

#11 2017-09-03 07:20:39

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2017-09-03 19:22:38

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

I would mark this as solved but it turns out Arch does not completely boot. I noticed an error when it initially built the kernel, but it booted and then dropped to an emergency shell. I initially thought the problem was something with Bluetooth, because

journalctl -xb

showed something about /usr/bin/hciconfig not existing. I've since booted a few more times. when I

cd /boot

and run

ls

it shows /boot as empty. I tried

mount /dev/sda2 /boot

but that does nothing. I can mount /dev/sda2 to /mnt.

I also did

arch-chroot

from the live USB drive and

mkinitcpio -p linux

as well as

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

and even ran

 packer -Syu

successfully, but once I boot from Grub without a chroot it drops me to the emergency shell.

Offline

#13 2017-09-03 19:37:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

Packer is not an Arch tool.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2017-09-03 19:46:27

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

True, I could have updated with pacman. The result would have been the same. While I was in chroot the system was able to see /boot and update. When I reboot without the chroot it can't see the files in /boot.

Offline

#15 2017-09-03 20:47:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Grub does not find Arch [SOLVED]

Probably because you didn't mount /boot before the update...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2017-09-03 23:17:43

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

I definitely mounted /boot. Just to make sure I booted into the live USB again, performed

wifi-menu

 mount /dev/sda6 /mnt
/dev/sda2 /mnt/boot
arch-chroot /mnt

Once I was in the chroot I did

pacman -Syu
mkinitcpio -p linux

and

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

Then rebooted. I'm still getting dropped to the emergency shell.

I looked at the Arch section in /boot/grub/grub.cfg. It's referring to Arch being on /sda6, which is correct. and the root of the bootloader on /sda2.  I haven't changed the disk partitions since this thread started.


My current /boot/grub/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
set root='hd0,gpt6'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6 --hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6  72282b9e-4371-4ed2-a484-c19612a645b4
else
  search --no-floppy --fs-uuid --set=root 72282b9e-4371-4ed2-a484-c19612a645b4
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=30
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=30
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-72282b9e-4371-4ed2-a484-c19612a645b4' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod fat
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  C6D7-8553
	else
	  search --no-floppy --fs-uuid --set=root C6D7-8553
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=72282b9e-4371-4ed2-a484-c19612a645b4 rw  
	echo	'Loading initial ramdisk ...'
	initrd  /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-72282b9e-4371-4ed2-a484-c19612a645b4' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-72282b9e-4371-4ed2-a484-c19612a645b4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  C6D7-8553
		else
		  search --no-floppy --fs-uuid --set=root C6D7-8553
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=72282b9e-4371-4ed2-a484-c19612a645b4 rw  
		echo	'Loading initial ramdisk ...'
		initrd  /initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-72282b9e-4371-4ed2-a484-c19612a645b4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  C6D7-8553
		else
		  search --no-floppy --fs-uuid --set=root C6D7-8553
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=72282b9e-4371-4ed2-a484-c19612a645b4 rw  
		echo	'Loading initial ramdisk ...'
		initrd  /initramfs-linux-fallback.img
	}
	menuentry 'Arch Linux, with Linux linux (recovery mode)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-recovery-72282b9e-4371-4ed2-a484-c19612a645b4' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  C6D7-8553
		else
		  search --no-floppy --fs-uuid --set=root C6D7-8553
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=72282b9e-4371-4ed2-a484-c19612a645b4 rw single 
		echo	'Loading initial ramdisk ...'
		initrd  /initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# 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 "Firmware setup" {
	fwsetup
}

if [ "${grub_platform}" == "efi" ]; then
	menuentry "Microsoft Windows 10" {
		insmod part_gpt
		insmod fat
		insmod search_fs_uuid
		insmod chain
		search --fs-uuid --set=root $hints_string $fs_uuid
		chainloader /EFI/Microsoft/Boot/bootmgfw.efi
	}
fi
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Offline

#17 2017-09-04 00:57:55

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Grub does not find Arch [SOLVED]

Share your fstab and output of `lsblk -f`, Any error displayed before dropping to emergency shell?


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#18 2017-09-04 02:26:35

paulbarbee
Member
Registered: 2010-08-20
Posts: 49

Re: Grub does not find Arch [SOLVED]

Thank you, @fsckd!

I looked at fstab and realised that it was still refering to /dev/sda1 as /boot. When I had re-installed Windows it had chosed /dev/sda2 as the bootloader directory, so I'd put Grub there too. After finding the correct partition UUID with blkid I edited fstab and I'm back in Arch, without any problems.

Thanks again and thank you so much to @jasonwryan for all his help. Thanks also to @Fixxer for his sugestion.

Offline

Board footer

Powered by FluxBB