3

Trying to instal ArchLinux on a Virtual Machine but I'm getting this error:

When I follow the final steps to install grub https://wiki.archlinux.org/index.php/GRUB#Install_to_disk

 grub-install --target=i386-pc --recheck --debug /dev/sdx
 grub-mkconfig -o /boot/grub/grub.cfg

I type like this:

 grub-install --target=i386-pc --recheck --debug /dev/sda

That worked fine.

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

And that too... (save the cfg where is supose to).

I mounted all on /mnt because this is a fresh install so I follow all the steps from the https://wiki.archlinux.org/index.php/Installation_guide

looked in to "Beginners' guide" and got the same answer but grub is not installed correctly...

The grub starts and looks for a device UUID that is not present; So grub starts in grub rescue mode.

So how can I do this right?


//EDIT

this is my grub.cfg

root@archiso /mnt/boot/grub # ls
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
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  9de3d09f-5b66-48f7-9fcb-f832a684a04f
else
  search --no-floppy --fs-uuid --set=root 9de3d09f-5b66-48f7-9fcb-f832a684a04f
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=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_archlinux ###
### END /etc/grub.d/10_archlinux ###

### 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.
### 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+ ###
if [ "${grub_platform}" == "pc" ]; then
    menuentry "Memory Tester (memtest86+)" --class memtest86 --class gnu --class tool {
        search --fs-uuid --no-floppy --set=root  9de3d09f-5b66-48f7-9fcb-f832a684a04f
        linux16 /boot/memtest86+/memtest.bin 
    }
fi
### END /etc/grub.d/60_memtest86+ ###

this all the UUIDs

ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root  9 Sep 17 16:36 2014-04-01-03-36-48-00 -> ../../sr0
lrwxrwxrwx 1 root root 10 Sep 17 16:36 6b4d5963-c7dd-409a-b8cb-bc28f7119a4b -> ../../sda2
lrwxrwxrwx 1 root root 10 Sep 17 16:36 9de3d09f-5b66-48f7-9fcb-f832a684a04f -> ../../dm-0
lrwxrwxrwx 1 root root 10 Sep 17 16:36 f2844853-8f7f-43b7-a9ca-1df878849bf4 -> ../../sda1

ok will add blkid

    root@archiso /mnt/boot/grub # blkid /dev/sda*
    /dev/sda: PTUUID="756a4dfc" PTTYPE="dos" 
    /dev/sda1: UUID="f2844853-8f7f-43b7-a9ca-1df878849bf4" TYPE="swap" PARTUUID="756a4dfc-01" 
    /dev/sda2: UUID="6b4d5963-c7dd-409a-b8cb-bc28f7119a4b" TYPE="ext4" PARTUUID="756a4dfc-02" 
     root@archiso /mnt/boot/grub # blkid /dev/dm-*
     /dev/dm-0: UUID="9de3d09f-5b66-48f7-9fcb-f832a684a04f" TYPE="ext4
1
  • 1
    "I'm getting this error: <blank line> <next sentence>" → What error?
    – Anko
    Sep 16, 2014 at 23:23

2 Answers 2

5

If you are in arch-chroot mode you should run

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

other than

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

Because: When you are installing arch linux for the first time, you mount your file system in /mnt and install base system from outside. Once you're done with base packages, you can arch-chroot inside /mnt and all the commands should be ran as you are in a normal operating system.

If this doens't solve your issue, please continue:


Check if any of your partions have bootable flag.

lsblk -f

You can run this:

mkdir -p /boot/grub/locale
cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo

In order to avoid some inoffensive error messages when booting with grub. Might not be the case but you can give it a try.

I'm not sure what can be causing the problem, but for instance you can install a different boot loader like syslinux to see if the problem was caused by grub or the filesystem.

Since you're installing in VM feel free to use it as a sandbox and try all the different ways of installing this.

I don't know how it works in VM but I used some different install configurations for grub since I have a UEFI hard drive.

1
  • Very thorough answer. Concise and to the point. Welcome to U&L.SE
    – eyoung100
    Sep 17, 2014 at 18:43
1

The way I found to solve it was by creating a separate partition to boot. then all the installation worked just find.

In the grub installation all I did was.

mount the boot partition in the directory boot. (that I previously create in /)

so mount /dev/sda2 (/) in /mnt and the mount /dev/sda3 (/boot) in /mnt/boot

pacstrap /mnt grub-bios

genfstab -U -p /mnt >> /mnt/etc/fstab

and finally grub-install /dev/sda

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

that worked!

thanks to all.

1
  • Hi, i am getting the same error, and when i tries this solution, it says pacstrap command not found. Did u do it before you change root? The guide shows change root before this step
    – Qianqian
    Mar 24, 2016 at 1:03

You must log in to answer this question.

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