WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Chroot not working when installing Grub  (Read 482 times)

Offline t18

  • Newbie
  • *
  • Posts: 36
Chroot not working when installing Grub
« on: August 25, 2024, 04:21:03 PM »
Hello,

I've got CorePlus installed on my hard drive, partition sda3.

I've tried to install Grub but unsuccessfully. According with your instruction:

Code: [Select]
$ sudo mount /dev/sdc1In my case is sda3 but it's already mounted and it seems I can't umount it (device busy) even from the live CD.

Code: [Select]
$ sudo grub-install --boot-directory=/mnt/sdc1/boot /dev/sdcSo the installation got broken:
Code: [Select]
error: failed to get the canonical path of 'rootfs'
They say it's better to chroot to /mnt before installing Grub. Output:
Code: [Select]
chroot: can't execute '/bin/sh': no such file or directory
Same if I add '/bin/bash' and having the bash shell already installed.

I've been unable to create a working grub.cfg file manually. Adding your:
Code: [Select]
      insmod ext2
                search --no-floppy --fs-uuid --set=root 3916536c-ab5b-45f4-92de-a6b8af8ec630
                menuentry "core" {
                linux /boot/vmlinuz quiet noswap waitusb=10:UUID="3916536c-ab5b-45f4-92de-a6b8af8ec630" tce=UUID="3916536c-ab5b-45f4-92de-a6b8af8ec630" tz=GMT-4 blacklist=bcma blacklist=ssb blacklist=b43 text
                initrd /boot/rootfs.gz /boot/modules.gz
                }
with the correct UUID for the sda3 partition I get the error:
Code: [Select]
unknown filesystem
you need to load the kernel first

What I've mistaken? Many thanks

Offline t18

  • Newbie
  • *
  • Posts: 36
Re: Chroot not working when installing Grub
« Reply #1 on: September 18, 2024, 08:31:02 AM »
I've finally had the necessary time to do some searches but not for chroot, it remains an unresolved mistery to me for now.

I've been able to fix grub to boot after discovering that the vmlinuz and the initrd paths and values have changed.

A couple words on it would have been appreciated.

Thank you for your great OS!

Offline mocore

  • Hero Member
  • *****
  • Posts: 616
  • ~.~
Re: Chroot not working when installing Grub
« Reply #2 on: September 18, 2024, 08:51:32 AM »
fwiw

this guide for "legacy bios/uefi dual boot usb stick with grub2" https://forum.tinycorelinux.net/index.php/topic,19364.0.html
could be a good reference

you didn't mention what grub you are trying to load (legacy-bios/or uefi)?


Offline t18

  • Newbie
  • *
  • Posts: 36
Re: Chroot not working when installing Grub
« Reply #3 on: September 19, 2024, 11:19:21 AM »
I've only found a "grub-multi.tcz" on the App.

Supposedly it's working in Legacy mode since my machine is an old Pentium II.

It seems there is not the update-grub command, do you confirm?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11516
Re: Chroot not working when installing Grub
« Reply #4 on: September 19, 2024, 12:13:31 PM »
Hi t18
Correct , update-grub  is not present in  grub2-multi  (grub2).

These are the files included in the 32 bit version:
http://tinycorelinux.net/15.x/x86/tcz/grub2-multi.tcz.list

These are the files included in the 64 bit version:
http://tinycorelinux.net/15.x/x86_64/tcz/grub2-multi.tcz.list

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11516
Re: Chroot not working when installing Grub
« Reply #5 on: September 20, 2024, 02:23:37 PM »
Hi Hi t18
It looks like  update-grub  was replaced with  grub-mkconfig.

It errors out with:
Code: [Select]
error: failed to get the canonical path of 'rootfs'which appears to be caused by it calling  grub-probe.