Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

disk setup in Cnchi leads to no grub config file #1117

Open
christian-korneck opened this issue Dec 26, 2018 · 4 comments
Open

disk setup in Cnchi leads to no grub config file #1117

christian-korneck opened this issue Dec 26, 2018 · 4 comments

Comments

@christian-korneck
Copy link

christian-korneck commented Dec 26, 2018

Describe the bug
Whenever I install a vanilla Antergos (from antergos-minimal-18.12-x86_64.iso) on a blank disk and choose lvm (with default settings) for the disk setup, the installed system ends up with having no grub config file (/boot/grub/grub.cfg does not exist and at first boot I end up in the grub shell). [Update: Another user reports that it also happens without choosing lvm, so lvm is probably unrelated. I didn't test without lvm].

Firmware mode is BIOS (haven't tried EFI). Both the partitions are created correctly as well as grub gets installed. The only thing missing is the grub config file.

Workaround
To repair: In the grub shell:

$ insmod lvm
$ ls
(lvm/AntergosVG-AntergosSwap) (lvm/AntergosVG-AntergosRoot) (hd0) (hd0,msdos2) (hd0,msdos1)
$ set root=(hd0, msdos1)
$ linux /vmlinuz-linux root=/dev/mapper/AntergosVG-AntergosRoot
$ initrd /initramfs-linux.img
$ boot

This will boot the system. From Linux, create the grub config file:

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

To Reproduce
Steps to reproduce the behavior:

  1. boot from antergos-minimal-18.12-x86_64.iso in BIOS mode (i.e. a virtualbox vm with default settings)
  2. "install Antergos"
  3. leave all settings default, but change the disk setup to lvm (with default settings)
  4. -> the first boot will end up in the grub shell

Expected behavior
/boot/grub/grub.cfg gets created during OS installation

Log Files

From /var/log/cnchi.log:

./cnchi-20181226-195002.log:2018-12-26 19:42:37 [DEBUG  ] Generating grub.cfg...  (grub2.py:270)
./cnchi-20181226-195002.log:2018-12-26 19:42:37 [DEBUG  ] 50mounted-tests file patched successfully  (grub2.py:436)
./cnchi-20181226-195002.log:2018-12-26 19:42:37 [DEBUG  ] Running grub-mkconfig...  (grub2.py:280)
./cnchi-20181226-195002.log:2018-12-26 19:42:47 [WARNING] Error running ['/bin/pidof', 'grub-mount']: b''  (grub2.py:265)
./cnchi-20181226-195002.log:2018-12-26 19:50:01 [ERROR  ] Timeout running the command ['chroot', '/install', 'sh', '-c', 'LANG=en_GB.UTF-8 grub-mkconfig -o /boot/grub/grub.cfg']  (run_cmd.py:159)
./cnchi-20181226-195002.log:2018-12-26 19:50:01 [ERROR  ] subprocess.TimeoutExpired: Command '['chroot', '/install', 'sh', '-c', 'LANG=en_GB.UTF-8 grub-mkconfig -o /boot/grub/grub.cfg']' timed out after 300 seconds  (run_cmd.py:78)
./cnchi-20181226-195002.log:2018-12-26 19:50:01 [ERROR  ] grub-mkconfig does not respond. Killing grub-mount andos-prober so we can continue.  (grub2.py:287)
./cnchi-20181226-195002.log:2018-12-26 19:50:01 [WARNING] Error running ['killall', 'grub-mount']: grub-mount: no process found  (run_cmd.py:118)
./cnchi-20181226-195002.log:2018-12-26 19:50:01 [ERROR  ] subprocess.CalledProcessError: Command '['killall', 'grub-mount']' returned non-zero exit status 1.  (run_cmd.py:78)
@c2h5oh
Copy link

c2h5oh commented Jan 21, 2019

I'm seeing the exact same issue without lvm

@christian-korneck christian-korneck changed the title choosing lvm disk setup in Cnchi leads to no grub config file disk setup in Cnchi leads to no grub config file Jan 21, 2019
@christian-korneck
Copy link
Author

@c2h5oh thanks for the info. I've edited the issue and title accordingly. (I indeed didn't test without choosing lvm. Relation to lvm was just an assumption, which was probably wrong).

@c2h5oh
Copy link

c2h5oh commented Jan 21, 2019

OK, so I've tracked it down to a grub.cfg creation failure:

  • grub-mkconfig will first try to detect OSes on other partitions, but for each partition will throw WARNING: Device /dev/<device> not initialized in udev database even after waiting 10000000 microseconds.. This warning doesn't show up in logs.
  • waiting for 10 seconds on each device/parition is a lot and likely made worse by lvm/luks adding additional devices
  • each device/partition is retried (I don't recall if once or twice)
  • all that combined is enough to get past the 300 second timeout cnchi enforces. simply having 3 drives with with 7 partitions between them was enough even without lvm or luks

As a temporaty fix adding GRUB_DISABLE_OS_PROBER=true to /etc/default/grub allows grub installation to finish quickly - after first boot you just remove it and re-run grub-mkconfig and let it sit as long as it needs to complete.

@Its-Alex
Copy link

Its-Alex commented Mar 9, 2019

Same problem here without lvm except that for me the grub error is

/usr/bin/grub-probe: error: failed to get canonical path of `root-image`.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants