Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot boot after installing onto secondary disk #416

Closed
mchf opened this issue Feb 1, 2023 · 4 comments
Closed

Cannot boot after installing onto secondary disk #416

mchf opened this issue Feb 1, 2023 · 4 comments

Comments

@mchf
Copy link
Contributor

mchf commented Feb 1, 2023

Scenario

  1. Running d-installer in a TW virtual machine. Available disks sda, sdb. System running from sda, sdb empty (even non-partitioned)
  2. d-installer used to install TW product onto /dev/sdb
  3. installation came to the end with no problem, asking for reboot
  4. Turned VM with d-installer off, attached disk image of sdb to another machine to boot installed system
  5. installed system didn't boot, crashed into grub rescue
    d-installer-cannot_boot_installed_target

Details from debugging

  • I was able to start normal mode manually from grub rescue using
grub rescue> set prefix=(hd0,gpt2)/@/boot/grub2
grub rescue> set root=(hd0,gpt2)
grub rescue> insmod normal
grub rescue> normal
  • however (hd0,gpt2)/@/boot contains only grub2 folder but no kernel and so on. See
    d-installer-grub_rescue
@mchf
Copy link
Contributor Author

mchf commented Feb 3, 2023

The issue is caused by using the d-installer for unsupported use case.

Core of the issue is caused by the fact that installation is targeted against second disk /dev/sdb in grub's word (hd1). So, when the sdb disk image is later detached and inserted into another machine it changes its relative name to /dev/sda resp (hd0) and grub gets confused.

Here is how you can boot the target from grub rescue:

grub2 rescue> set root=(hd0,gpt2)
grub2 rescue> set prefix=(hd0,gpt2)/@/boot/grub2
grub2 rescue> insmod normal
grub2 rescue> normal
grub2> insmod btrfs
grub2> linux /@/.snapshots/1/snapshot/boot/vmlinuz root=/dev/sda2
grub2> initrd /@/.snapshots/1/snapshot/boot/initrd
grub2> boot

to make it permanent run as root:

# grub2-install /dev/sda
# grub2-mkconfig -o /boot/grub2/grub.cfg

@mchf
Copy link
Contributor Author

mchf commented Feb 6, 2023

As I tried to explain, d-installer "works as expected" here. For those who really wants / needs to use the d-installer in a way as described in the description there is a workaround mentioned above.

I've nothing more to add, so closing.

@imobachgs
Copy link
Contributor

Very useful information. Thanks a lot, @mchf. I will move this tip to the project's wiki.

@imobachgs
Copy link
Contributor

Summarized here. Thanks!

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

No branches or pull requests

2 participants