Grub2 does not detect (btrfs) partition after reinstall
I just installed Xubuntu alongside a (btrfs) Manjaro installation which used to be booted by Grub2.
Now for some reason Grub2 does not detect the Manjaro partition, so I can't boot from it. Any solutions? (including using a different boot loader) |
You know grub can handle btrfs - check the grub.cfg on Manjaro for what you need to add to the cfg on Xubuntu.
|
Quote:
BTW, I also tried overwriting the current grub.cfg with the one taken from the Manjaro partition (replacing it as a whole), but strangely enough when I run update-grub2 what actually gets written on disk is not from the Manjaro grub.cfg (which I had copied into Xubuntu's /boot/grub directory) but from Xubuntu's own grub.cfg file -- despite the fact that it was just overwritten by the Manjaro one. That's odd! Moreover, the old Xubuntu grub.cfg gets restored (in place of the Manjaro one), seemingly out of nowhere... Now I am in a hurry to restore the boot from the Manjaro partition and I don't mind giving up the newly installed Xubuntu partition altogether. So, is there a way to get update-grub2 to read from the particular grub.cfg file which I want (i.e. the one I copied from the Manjaro partition) and ignore the currently installed grub config (which causes the interference)? Could you please provide some easy-to-follow instructions on how to do it? |
Whenever you run update-grub it will overwrite any changes you made to /boot/grub.cfg. In manjaro /boot/grub/grub.cfg copy the section that is similar to this
Code:
### BEGIN /etc/grub.d/10_linux ### |
It worked! Problem solved. THANK YOU.
|
One thing to note is when the kernel version changes for manjaro during a manjaro update you will need to edit the /etc/grub.d/40 and change the numbers and rerun update-grub. to keep from doing this and IMHO easier way is to make an entry in the 40_custom similar to this:
Code:
menuentry 'Manjaro Linux'{ |
Quote:
/etc/grub.d/40_custom: line 1: #!: command not found The content of my /etc/grub.d/40_custom file is: #! /bin/sh exec tail -n +3 $0 # 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. menuentry 'Manjaro Linux'{ insmod gzio insmod part_gpt insmod btrfs set root='hd0,gpt6' configfile /boot/grub/grub.cfg } Am I missing something? Could you please tell me what to do? |
what is on line one of 40_custom?
|
Quote:
#!/bin/sh which was present by default in the file. |
Quote:
|
Quote:
/etc/grub.d/40_custom: line 1: #!/bin/sh: No such file or directory (I added the space while trying to solve the problem) So I tried both with and without the space, and I get an error message in each case. |
There is something wrong with the first line. Did you use the same editor that you initially used to edit 40_custom?
|
Quote:
I still have to reboot, but I am confident that the problem is solved. Thanks a lot indeed! |
Your welcome
|
By the way, I can now confirm that the problem was about the wrong encoding of the text file. After rebooting, the grub menu shows the entry which I wanted. Problem solved.
|
All times are GMT -5. The time now is 06:46 PM. |