0

I'm trying to install GRUB onto a separate partition who's volume shares a Windows installation. After having pulled, configured, and made GRUB, I can't grub-mkconfig. Doing some research, I found: grub-probe: error: failed to get canonical path of /cow which is exactly my problem. Taking away that I need to chroot, but no matter what I do, I can't get permission for /bin/bash.

sudo chroot /mnt returns /bin/bash: Permission denied.

  • sudo chmod 777 /bin/bash (and variations: sudo chmod 777 . , sudo chmod 777 /mnt/bin/*, etc.)
  • sudo chmod 755 /bin/bash (and variations similar to above)
  • for dir in proc dev sys etc bin sbin var usr lib lib64 tmp; do sudo mkdir /mnt/chrootdir/$dir && sudo mount --bind /$dir /mnt/chrootdir/$dir(I followed this guide which will explain where /mnt/chrootdir came from)
  • /mnt/bin/bash exists

This isn't an installation of Ubuntu 18.04, just "trying" it. My process so far has been:

  • Download grub
  • Download stuff grub needs (flex, bison, gcc)
  • ./configure
  • make
  • sudo mount /grub/partition /mnt
  • grub-install --boot-directory=/mnt/boot --force
  • grub-mkconfig -o /mnt/boot/grub/grub.cfg <-- "Cannot get canonical path for /cow" which led me to the earlier link.

What am I doing wrong? I tried doing my due diligence so I apologize for making another thread related to this (there seems to be a ton of them) but I really am lost.

  • 1
    Hi Harin, can you clarify this question a little bit? Have a look at the information in the StackOverflow help (stackoverflow.com/help/how-to-ask). I'd suggest starting by 1) describing what you want to accomplish, and 2) explaining the problem you're experiencing (/bin/bash not available in chroot) including any errors it's giving you followed by 3) what you've tried. It's not common to configure and make grub, rather than install from apt (sudo apt install grub-pc or sudo apt install grub-efi depending on your system). – rexypoo Feb 11 at 23:30
  • I want to add GRUB to Windows via a separate partition. The way I've found is best is by using gParted to create a separate partition for GRUB (after having installed Windows) then doing what I described above. Once I get GRUB working, I plan to use my Windows + GRUB VM to debug GRUB because I need to extend its functionality. So, while it's not common to configure and make grub, I will need to do that in the long run when I add my functionality to it. I'm currently just trying to be able to step through unmodified GRUB to get the hang of using GDB and this new dev environment. – Harin Feb 11 at 23:36
  • Your question makes it sound like you are installing grub onto a disk with Windows. It is not clear that this disk also has a Linux partition. Does this disk also have a Linux partition? You are supposed to be chrooting into a partition with a Linux installation on it. Otherwise, you are not doing what the instructions you linked to are for. – Poisson Aerohead Feb 12 at 6:44
  • Ah, that would explain it. I do not have a Linux installation as I am trying to do all this without having to install Linux. Is there a way to do this without having a Linux installation? – Harin Feb 12 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.