I have Grub2.02~beta2-9 installed in its own dedicated partition to be OS independent.

Asked by Stan Ham on 2014-05-21

In Grub Customizer, I pull down the "File" menu and select "Change environment...". It shows all info as if I were using Grub2 in my OS's partition (/dev/sda4). When I Click on the "Partition" dropdown and select the partition where my Grub2 files are located (/dev/sda2), I immediately get an error window stating: "This seems not to be a root file system (no fstab found)". And of course, that is exactly correct, but it will not let me point it to where my grub files are located. By the way, my Grub 2 functions perfectly in this dedicated partition. I was hoping Grub Customizer would make it easier for me to edit my grub.cfg file in this special partition, but so far, it appears not. Additional info: I just installed Ubuntu 14.04 LTS twice on the same drive, in two different partitions on /dev/sda and installed Grub2 files into their own dedicated partition on this same drive, and this all works perfectly. Then, I decided to go get Grub Cusromizer to make it a lot easier to edit my menu appearance, but alas encountered this issue. Is there something that I am missing, or is there a work-around? Would symlinks help this situation? I've never set up any, but I pretty much know what they are. If so, where and how would they be needed? In my active OS, I have a mount point for the Grub2 partition. I'm wondering about setting up symlinks in whatever are the proper places in the directory tree of my active OS, and having them point through my mount point to the "true" grub files and directories. Unfortunately, however, I am not knowledgeable enough on Grub to know exactly where they would need to be placed. Kind regards, Stan

Question information

Language:
English Edit question
Status:
Solved
For:
Grub Customizer Edit question
Assignee:
No assignee Edit question
Solved by:
Stan Ham
Solved:
2014-05-22
Last query:
2014-05-22
Last reply:
2014-05-21

The problem is that grub customizer doesn't edit the grub.cfg directly. Instead it edits the files which are used to generate the grub.cfg and runs update-grub afterwards. This process makes sure that a kernel update (for example) won't overwrite the configuration created by grub customizer.

You're using a separate partition containing only the resulting file - grub.cfg. To get it working you also need the full tool chain - update-grub, grub-install and so on. Also you'll need the configuration at /etc/grub.d. After creating the /etc/fstab (I think it should contain the partition it resides on mountpoint "/") you'll see the required commands and files. Also the partition must contain the empty directories "proc", "sys" and "dev". I didn't try it yet but I think it's too difficult to copy all the required stuff. The alternative way is: installing a small linux distribution containing grub 2 on this partition.

I think implementing a "static mode" into grub customizer results in too much duplicate code because I have to implement the behavior of update-grub. This is why I didn't do it yet.

Stan Ham (stan7301) said : #2

Hi Daniel; thanks so much for the quick response. While waiting, I played with using a symlink a bit, but that did not pan out at all.... acknowledging that I am not savvy with the ln command, and may have overlooked something that could have made that effort succeed... bottom line is that I abandoned that effort. However, after reading your response, I got another idea, which DID pan out to provide me with the desired outcome..... that being to be able to use Grub Customizer to edit my grub.cfg file in a dedicated partition. Admittedly, it's a bit clunky, and requires a fairly small amount of "under the hood" knowledge of Linux, but really not all that much. My dedicated partition for my grub files is /dev/sda2 with a lable on it of "Grub-Files". I booted into my OS at /dev/sda4. I have a mount point there for the grub files partition which is: /media/username/Grub-Files. For good measure, I re-installed grub to my dedicated grub files partition via this command: sudo grub-install --root-directory=/media/username/Grub-Files /dev/sda. I then immediately ran this next grub command to create the grub.cfg file in the dedicated partition: sudo grub-mkconfig -o /media/username/Grub-Files/boot/grub/grub.cfg. With this done, I am assured that I can boot using grub in my dedicated (OS independent) partition. Next I rebooted to verify that it worked, which it did, and I booted back into my OS on /dev/sda4. Once there, I ran Grub Customizer and fixed up the menu the way I wanted it to appear at boot time, saved that work, knowing full well that the grub.cfg file being edited was not out on my dedicated partition, but rather in /boot/grub/grub.cfg instead of in /media/username/Grub-Files/boot/grub/grub.cfg. I then exited out of Grub Customizer, launched nautilus via sudo command: sudo nautilus and in nautilus, simply copied the grub.cfg file which Grub Customizer edited so nicely for me to overwrite the one in my dedicated partition. I then rebooted and found that my "edits" were there in the boot menu being displayed, and all is well. I do understand that I will have to repeat this effort each time there is a kernel update, but this is a whole lot easier than trying to figure out how to edit the grub.cfg script file directly myself!! I don't know if this could be described as a "work around" or what, but maybe this procedure will be useful to other folks who want grub in a dedicated partition, AND want to use Grub Customizer to much more easily edit the basic grub2 boot menu. Very kind regards, Stan