Tiny Core Base > CorePlus

[Solved} Grub2 does not load grub.cfg automatically

(1/6) > >>

Sashank999:
Hi !
I have installed TCL on my BIOS laptop recently. I have installed grub2-multi extension from app browser. After that, I ran

--- Code: ---sudo grub-install /dev/sda5

--- End code ---
I inserted "/dev/sda5" because I have Win 10 on my second partition.
I have manually created grub.cfg in /tce/boot/grub and entered

--- Code: ---timeout=11
menuentry "Tiny Core Linux" {
root (hd0,4)
kernel /tce/boot/vmlinuz quiet
initrd /tce/boot/core.gz

--- End code ---
Now, I get grub console when I select Tiny Core in Windows Bootloader. What should I do to get the grub automated ?

A small doubt : I installed grub2-multi but I get "GRUB4DOS 0.4.6a" at the top of grub console. Why ?
I also get "File not found" error when I type "insmod ntfs" but ntfs.mod is present in /mnt/sda5/tce/boot/grub/i386-pc .

Rich:
Hi Sashank999
You neglected to tell  grub2  where to look for files. From the  grub2  .info file:
http://tinycorelinux.net/11.x/x86/tcz/grub2-multi.tcz.info

--- Code: ---Comments:       grand unified bootloader with legacy bios and efi modules
                ----------
                howto:
                $ sudo mount /dev/sdc1
                $ sudo grub-install --boot-directory=/mnt/sdc1/boot /dev/sdc
                $ cat /mnt/sdc1/boot/grub/grub.cfg
                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
                }
                ----------
--- End code ---

Based on where you placed your config file (/tce/boot/grub/grub.cfg), you should have used:

--- Code: ---sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
--- End code ---

    [EDIT]: Fixed typo.  Rich

aus9:
@Sashank999

Have you previously used grub-legacy?

You have mixed up your kernel line syntax.

its no longer kernel blah blah but
linux blah blah.

2) best to define the boot partition by
set root=(hdA,y)

count A hard drive by zero,1,2,3
count y partitions by normal count 1,2,3

Rich has assumed that which is why he is thinking /dev/sda5

3) It might be best you post the full contents of your grub.cfg

4) however, you will notice the info file shows /boot at the root of /mnt/sdc1
but you appear to be trying to use boot as a sub-directory to /mnt/sda5/tce

sorry to butt in.


--- Quote ---File not found
--- End quote ---
  would suggest grub is not correctly installed but you have not reported what errors you saw when you attempted to install grub2?

5) also its not clear to me, does windows boot ok?

Does windows bootloader have a chainload command to grub2?
Is that your intention?

In which case your windows menu must chainload to the Partition boot record for /dev/sda5.
and so it might also mean you need to show that part of your windows boot loader menu too please.

aus9:
hi

I forgot to address this question

--- Quote ---A small doubt : I installed grub2-multi but I get "GRUB4DOS 0.4.6a" at the top of grub console. Why ?
--- End quote ---

reason: on 64 bit grub2 at command mode should display the characters
"GRUB version 2 <something>"

Therefore, grub2 was never installed into your partition boot record.(PBR)

At some time in the past, someone had installed grub4dos.
You can only have one bootloader in your MBR
You can only have one bootloader in your PBR

You don't even need a bootloader in MBR, you could use a usb or optical disc to boot the hard drive.
You don't need a bootloader in PBR, unless you want to keep Microsoft things separate from Linux things.

To get rid of grub4dos, you just need to overwrite that PBR with another boot loader.
It does not have to be grub2 if you are struggling with it.

Hope that helps

Sashank999:

--- Quote from: Rich on May 22, 2020, 08:42:02 AM ---Hi Sashank999
You neglected to tell  grub2  where to look for files. From the  grub2  .info file:
http://tinycorelinux.net/11.x/x86/tcz/grub2-multi.tcz.info

--- Code: ---Comments:       grand unified bootloader with legacy bios and efi modules
                ----------
                howto:
                $ sudo mount /dev/sdc1
                $ sudo grub-install --boot-directory=/mnt/sdc1/boot /dev/sdc
                $ cat /mnt/sdc1/boot/grub/grub.cfg
                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
                }
                ----------
--- End code ---

Based on where you placed your config file (/tce/boot/grub/grub.cfg), you should have used:

--- Code: ---sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
--- End code ---

    [EDIT]: Fixed typo.  Rich

--- End quote ---
TY for the reply and sorry for the late.
I have seen in some other website that the grub2 looks for grub.cfg in (hdX,Y)/boot/grub. So, I copied entire /tce/boot folder and pasted it beside tce. Now, it works !
Another thing, do we have a way to change the boot directory after installation of grub2 ?

Navigation

[0] Message Index

[#] Next page

Go to full version