18

I am running this script based on the ArchWiki setup procedure. It fails on the GRUB configuration step

I am using the archlinux-2013.12.01-dual.iso inside VMware Player with 1 GB ram, sda is 810 MB. I have also mounted a CIFS share on the host machine.

# DEV=sda
# PART=sda1
# echo "1,,L,*" | sfdisk /dev/$DEV
# mkfs.ext3 /dev/$PART
# mount /dev/$PART /mnt
# pacstrap -i /mnt base 
# genfstab -U -p /mnt >> /mnt/etc/fstab
# arch-chroot /mnt 
# pacman -S grub
# pacman -S os-prober
# grub-mkconfig -o /boot/grub/grub.cfg

I get:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  No volume groups found
error: out of memory.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 164
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.done

I didn't install LVM partitions/drives.

# fdisk -l /dev/sda

Disk /dev/sda: 819 MiB, 858783744 bytes, 1677312 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: 0x000d5a2a

Device    Boot Start       End Blocks  Id System
/dev/sda1       2048   1677311 837632  83 Linux


# lsblk 

NAME              MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
fd0                 2:0    1     4K  0 disk 
sda                 8:0    0   819M  0 disk 
└─sda1              8:1    0   818M  0 part /mnt
sr0                11:0    1   522M  0 rom  /run/archiso/bootmnt
sr1                11:1    1    10M  0 rom  
loop0               7:0    0 224.2M  1 loop /run/archiso/sfs/root-image
loop1               7:1    0   1.4G  1 loop 
└─arch_root-image 254:0    0   1.4G  0 dm   /
loop2               7:2    0   1.4G  0 loop 
└─arch_root-image 254:0    0   1.4G  0 dm   /

/boot/grub/grub.cfg.new is:

#
# 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
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos 
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9d1d349e-d061-4e0f-9312-be19ca2dcb74
else
  search --no-floppy --fs-uuid --set=root 9d1d349e-d061-4e0f-9312-be19ca2dcb74
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
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-9d1d349e-d061-4e0f-9312-be19ca2dcb74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos 
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9d1d349e-d061-4e0f-9312-be19ca2dcb74
    else
      search --no-floppy --fs-uuid --set=root 9d1d349e-d061-4e0f-9312-be19ca2dcb74
    fi
    echo    'Loading Linux core repo kernel ...'
    linux   /boot/vmlinuz-linux root=UUID=9d1d349e-d061-4e0f-9312-be19ca2dcb74 rw  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initramfs-linux.img
}
menuentry 'Arch Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-9d1d349e-d061-4e0f-9312-be19ca2dcb74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos 
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9d1d349e-d061-4e0f-9312-be19ca2dcb74
    else
      search --no-floppy --fs-uuid --set=root 9d1d349e-d061-4e0f-9312-be19ca2dcb74
    fi
    echo    'Loading Linux core repo kernel ...'
    linux   /boot/vmlinuz-linux root=UUID=9d1d349e-d061-4e0f-9312-be19ca2dcb74 rw  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initramfs-linux-fallback.img
}
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-9d1d349e-d061-4e0f-9312-be19ca2dcb74' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_msdos 
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  9d1d349e-d061-4e0f-9312-be19ca2dcb74
    else
      search --no-floppy --fs-uuid --set=root 9d1d349e-d061-4e0f-9312-be19ca2dcb74
    fi
    echo    'Loading Linux core repo kernel ...'
    linux   /boot/vmlinuz-linux root=UUID=9d1d349e-d061-4e0f-9312-be19ca2dcb74 rw  quiet
    echo    'Loading initial ramdisk ...'
    initrd  /boot/initramfs-linux-fallback.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-9d1d349e-d061-4e0f-9312-be19ca2dcb74' {

### 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.
### 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 ###

### BEGIN /etc/grub.d/60_memtest86+ ###
### END /etc/grub.d/60_memtest86+ ###
3
  • Looks like a bug - "please file a bug report with /boot/grub/grub.cfg.new file attached"
    – Panther
    Dec 16, 2013 at 18:55
  • 1
    Are you running grsec? Do you have enough memory?
    – daisy
    Dec 17, 2013 at 10:09
  • @warl0ck: grsecurity? I am using the standard archlinux-2013.12.01-dual.iso inside VMware Player with 384 MB ram. sda is 810 MB. On a secondary ISO, sr1, I ran a script to install Vim and to mount a CIFS share on the host machine.
    – antonio
    Dec 17, 2013 at 11:29

5 Answers 5

23

I ran across the same issue just now, and found another workaround. Basically, it involves making the hosts /run directory available to the guest.

First, we mount /run where it can be accessed by the guest. I will assume that your install partition is mounted at /mnt

mkdir /mnt/hostrun
mount --bind /run /mnt/hostrun

Then, we chroot into the guest, and mount our host's /run/lvm in the guest's /run

arch-chroot /mnt /bin/bash
mkdir /run/lvm
mount --bind /hostrun/lvm /run/lvm

You can then run grub-mkconfig and grub-install without any LVM errors. This also makes the commands behave if you are installing with LVM, for what it's worth.

When done, remember to umount /run/lvm before exiting the chroot.

6

After research triggered by @guest, I found that there is an apparent bug in the grub-mkconfig helper script, /etc/grub.d/10_linux, which makes the fallback initramfs GRUB entry not compatible with the GRUB submenu system. As the usage of a fallback initramfs is very specific to Arch and derivatives, it is not supported by upstream grub-mkconfig. A definitive fix is still in progress. See more details on bugs.archlinux.org

A temporary workaround therefore is disabling submenus in GRUB, by appending:

GRUB_DISABLE_SUBMENU=y

to /etc/default/grub.

Unfortunately, by disabling submenus, I avoid only the second error raised by grub-mkconfig.

So, with:

# arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg

I still get:

Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  WARNING: Failed to connect to lvmetad: No such file or directory. Falling back to internal scanning.
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  /run/lvm/lvmetad.socket: connect failed: No such file or directory
  No volume groups found

I have never installed LVM partitions/drives and, as you can see from my question, I partitioned and formatted the system. Anyway, after fixing the GRUB error, I tried both:

systemctl start lvmetad

and

systemctl start lvmetad.service

and I ran pacstrap again, without success.

The current error is non-critical as

arch-chroot /mnt grub-install --target=i386-pc --recheck /dev/$DEV

goes smoothly and I can boot from $DEV.

3
  • Answering your own question is fine, there is no need to make it into a community wiki post.
    – terdon
    Dec 18, 2013 at 16:45
  • 1
    I can't figure out if this is an answer or another question Dec 18, 2013 at 16:58
  • @MichaelMrozek: Well, it's a partial answer/solution to the question: the second error is fixed; most notably, the first error now shows non-crucial for Arch setup. I am still investigating and hopefully the latter will be fixed too.
    – antonio
    Dec 18, 2013 at 17:36
3

I had the same problem but I found a solution that works for me: just remove os-prober.

3
  • 1
    for my simple instance, this is ok. But in an instance where you have other OS's and want a multiboot menu do you set the entries manually?
    – antonio
    Dec 26, 2013 at 23:05
  • 1
    Don't remove os-prober, just disable its executable bit: chmod -x /etc/grub.d/30_os-prober and it should remove the warning. May 19, 2015 at 0:56
  • This really isn't a solution - os-prober is pretty much an essential part of grub unless you only use one system.
    – daboross
    Dec 26, 2015 at 7:33
2

Adding the line GRUB_DISABLE_SUBMENU=y to /etc/default/grub might help

source: https://bbs.archlinux.org/viewtopic.php?pid=1357765

1
  • +1: Fixed the second error, thanks. See my new attempts here.
    – antonio
    Dec 18, 2013 at 16:09
0

For the first error message, grub cannot connect to LVM metadata daemon, try run this command as root (which will start it):

systemctl start lvmetad

And the second one, try increase the RAM allocated to your VM, perhaps 512M, and run grub again.

1
  • I set the ram up to 1 GB, systemctl start lvmetad (run outside chroot) doesn't give any error message. But re-running grub-mkconfig inside arch-chroot gives exactly the same error (including mem error).
    – antonio
    Dec 17, 2013 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .