Tiny Core Linux
Tiny Core Base => CorePlus => Topic started by: Sashank999 on May 22, 2020, 06:20:36 AM
-
Hi !
I have installed TCL on my BIOS laptop recently. I have installed grub2-multi extension from app browser. After that, I ran
sudo grub-install /dev/sda5
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
timeout=11
menuentry "Tiny Core Linux" {
root (hd0,4)
kernel /tce/boot/vmlinuz quiet
initrd /tce/boot/core.gz
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 .
-
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
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
}
----------
Based on where you placed your config file (/tce/boot/grub/grub.cfg), you should have used:
sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
[EDIT]: Fixed typo. Rich
-
@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.
File not found
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.
-
hi
I forgot to address this question
A small doubt : I installed grub2-multi but I get "GRUB4DOS 0.4.6a" at the top of grub console. Why ?
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
-
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
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
}
----------
Based on where you placed your config file (/tce/boot/grub/grub.cfg), you should have used:
sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
[EDIT]: Fixed typo. Rich
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 ?
-
@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.
File not found
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.
No, I didn't previoulsy used grub-legacy. But, I learnt its syntax from the grub console and some web articles.
When I type "kernel /tce/boot/vmlinuz", it says "Kernel command not found". Hence, I changed it to kernel command.
2) When I use "set root=(hd0,4)", it changes for the next boot.
3) I posted the full contents previously. That was all the grub.cfg.
4) There were no errors reported when installing grub2.
5) The Windows boots up perfectly.
The windows cannot boot from grub2 but "EasyBCD" chainloads grub2 from win bootloader.
Yes my intention is to boot grub2 from win bootloader.
-
hi
I forgot to address this question
A small doubt : I installed grub2-multi but I get "GRUB4DOS 0.4.6a" at the top of grub console. Why ?
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
TY for the reply.
I did not install grub4dos. But, when I copy the /mnt/sda5/tce/boot directory to /mnt/sda5 (beside /tce), the grub shows GRUB Version 2. Thank You all for the replies ;D!
-
@Rich
@Juanito
Hi...win10.....is that a 32 bit or 64 bit OS?
You appear to have a 32 bit TC without a 32 bit efi grub install.
I am thinking out loud that you may have a UEFI/BIOS that coupled with BCD, that:
you are unable to turn off secure boot,
your bios expects to find a signed linux key
and only if that thinking is correct....you might need to consider the following,
but wait for a second opinion from with Rich, Juanito or Curaga or other gurus please.
A) you might need a 64 bit TC....assuming you have a 64 bit CPU
but there might be a 32 bit efi command as per below or even better from the gurus
B) you might need a different grub2 install command probably
sudo grub-install --boot-directory=/mnt/sda5/boot --target=x86_64-efi /dev/sda5
but if 32 bit efi works....I don't know as I have not got it a command that might work is
sudo grub-install --boot-directory=/mnt/sda5/boot --target=i386-efi /dev/sda5
-
Hi Sashank999
... Another thing, do we have a way to change the boot directory after installation of grub2 ?
I think running the install command again using the --boot-directory= option should do it:
sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
I would create a backup of your grub.cfg file before running the install command just to be safe.
-
@Rich
@Juanito
Hi...win10.....is that a 32 bit or 64 bit OS?
You appear to have a 32 bit TC without a 32 bit efi grub install.
I am thinking out loud that you may have a UEFI/BIOS that coupled with BCD, that:
you are unable to turn off secure boot,
your bios expects to find a signed linux key
and only if that thinking is correct....you might need to consider the following,
but wait for a second opinion from with Rich, Juanito or Curaga or other gurus please.
A) you might need a 64 bit TC....assuming you have a 64 bit CPU
but there might be a 32 bit efi command as per below or even better from the gurus
B) you might need a different grub2 install command probably
sudo grub-install --boot-directory=/mnt/sda5/boot --target=x86_64-efi /dev/sda5
but if 32 bit efi works....I don't know as I have not got it a command that might work is
sudo grub-install --boot-directory=/mnt/sda5/boot --target=i386-efi /dev/sda5
Hi @aus9
My Windows 10 is 64 bit OS.
I don't know if my TCL is 32 bit and, I don't know that TCL has a 64 bit version ??? .
"BIOS/UEFI" My Laptop is BIOS. It does not have secure boot and fast boot.
Mine is not an EFI laptop so none of the above command should be followed. I think so...
And one more thing, In previous post, I mentioned that my Grub shows v2 and it shows menu. It loads the grub.cfg in /tce/boot/grub/grub.cfg, not the one in /boot (copied and pasted beside tce folder)/grub/grub.cfg.
-
Hi Sashank999
... Another thing, do we have a way to change the boot directory after installation of grub2 ?
I think running the install command again using the --boot-directory= option should do it:
sudo grub-install --boot-directory=/mnt/sda5/tce/boot /dev/sda5
I would create a backup of your grub.cfg file before running the install command just to be safe.
@Rich . Now, I am gonna do a new grub install with --target=i386-pc (of course unnecessary) and also with --boot-directory=/tce/boot/ like this :
grub-install --target=i386-pc --boot-directory=/tce/boot/ /dev/sda5
I will also report any errors during installation, make a backup of current grub.cfg and restore grub.cfg after new grub installation.
P.S. I am also doing rm-rf those old grub folders (/boot and /tce/boot/grub)
[EDIT] : Added P.S.
-
I don't know if my TCL is 32 bit
for 32 bit....menu might show vmlinuz and core.gz
for 64 bit ....menu might show vmlinuz64 and corepure64.gz as per
http://tinycorelinux.net/11.x/x86_64/release/distribution_files/
BTW I am not trying to force you on onto 64 bit as generally speaking 32 bit packages are smaller than 64 bit. But if you have lots of RAM....well you decide ;D
-
I rm -rf the old grub directories,got "sudo su" and typed :
grub-install --target=i386-pc --boot-directory=/tce/boot /dev/sda5
Then I got this error : "grub-install: error: failed to get canonical path of "rootfs" "
So, I tried this :
grub-install --target=i386-pc --boot-directory=/mnt/sda5/tce/boot /dev/sda5
Then, I got :
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: error: will not proceed with blocklists.
But the grub folder was created in /mnt/sda5/tce/boot . So, I used the --force :
grub-install --target=i386-pc --boot-directory=/mnt/sda5/tce/boot --force /dev/sda5
Then I got :
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
Then, I restored the old grub.cfg into the grub folder and then rebooted. Then, I got the GRUB v0.4.6a console.
I booted into TCL and then did the previous trick: Copying /mnt/sda5/tce/boot directory to /mnt/sda5. Then, the GRUB v2 booted with the menu.
I don't know if my TCL is 32 bit
for 32 bit....menu might show vmlinuz and core.gz
for 64 bit ....menu might show vmlinuz64 and corepure64.gz as per
http://tinycorelinux.net/11.x/x86_64/release/distribution_files/
BTW I am not trying to force you on onto 64 bit as generally speaking 32 bit packages are smaller than 64 bit. But if you have lots of RAM....well you decide ;D
Then, I got 32 bit TCL now. How to change to 64 bit ? Is replacing the vmlinuz and core.gz to vmlinuz64 and corepure64.gz enough ?
-
You can either replace them or copy them alongside and add a grub.cfg menu entry so that you have the choice of 32/64-bit.
If you decide to add a menu entry, use "tce=tce64" to create a separate tce folder for 64-bit tinycore.
-
You can either replace them or copy them alongside and add a grub.cfg menu entry so that you have the choice of 32/64-bit.
If you decide to add a menu entry, use "tce=tce64" to create a separate tce folder for 64-bit tinycore.
Hi Juanito
Thanks for the reply.
My question is why does the grub only load GRUB v2.02 from /boot/grub but not from /tce/boot/grub ?
UPDATE : The GRUB v2.02 loads grub.cfg from /tce/boot/grub, not from /boot/grub.
-
Sashank999
I am still guessing your grub.cfg is as shown post one.
Does this file exist in multiple locations when you try to run grub-install command?
I am guessing you did not put a copy under /boot/grub or /boot?
2) I am guessing you have read the core concepts and have chosen to remain cloud mode
http://tinycorelinux.net/concepts.html
so staying with 32 bit TCEs might still be best.
Some of us, have less fast internet and tend to have persistent tcedir.
-
Sashank999
I am still guessing your grub.cfg is as shown post one.
Does this file exist in multiple locations when you try to run grub-install command?
I am guessing you did not put a copy under /boot/grub or /boot?
2) I am guessing you have read the core concepts and have chosen to remain cloud mode
http://tinycorelinux.net/concepts.html
so staying with 32 bit TCEs might still be best.
Some of us, have less fast internet and tend to have persistent tcedir.
Hi aus9
Yes, my grub.cfg is still as in post #1.
No. The grub.cfg file is deleted. Whole grub folder (/tce/boot/grub) is deleted. As I have internet, I copied and pasted the code as in post #1.
No, I put a copy of grub.cfg in /tce/boot/grub.
I do not understand the modes and that stuff. I just mounted my USB Drive with TCL (by YUMI Installer) and clicked on tce-install-GUI . After that, in a live TCL session from USB, I installed GRUB v2.02 from App Browser and ran the grub-install command as said in post #1.
-
Hello Admins ! ;D
Finally, I got the solution for the problem.
This time I tried it uniquely. Today, I removed the grub folders again and did
sudo grub-install --boot-directory=/mnt/sda5/boot /dev/sda5
Where, my TCL Partition was /dev/sda5 and /mnt/sda5 is the mountpoint of my TCL Partition. But, the directory /mnt/sda5/boot was a non-existent directory.
In my previous post, I said that the grub was reading grub.cfg from a folder inside /tce/boot/grub whereas the modules were being loaded from /boot(beside tce directory in that partition)/grub . I have read somewhere that TCL would run from a single directory but may cause problems due to boot directory in tce.
So, this time, I selected a non-existent boot directory which is beside tce ( not inside tce).
And, created a grub.cfg and added
menuentry "Tiny Core" {
root=(hd0,msdos5)
linux /tce/boot/vmlinuz quiet
initrd /tce/boot/core.gzIt works like a charm ! :D ;D ;) 8) :)
Note : I also request the admins to update the installation page of TCL and make the wiki accessible too.
-
I did not want to reply to your previous, but now I can not hold back any longer.
where exactly is your current grub.cfg...please show the full pathway from
sudo find /mnt -name grub.cfg
2) If I understand you currently, you are claiming grub installs into the Partition Boot Record of sda5 pointing to a dir that does not exist.....and on reboot....your menu appears and you can boot it.
3) Your grub.cfg seems to have changed slightly from post 1. Does that mean it no longer works from post 1?
And....I am gobsmacked your setup works.....I must try that out for my sda3 when I get time.
Normally.....grub2 is told.....set root=(hd0,5) .....to look for the balance of the grub2 files at first drive fifth partition
and normally expects to find either
/boot or
/grub as the directories and not /tce.
so I am still gobsmacked
-
I did not want to reply to your previous, but now I can not hold back any longer.
where exactly is your current grub.cfg...please show the full pathway from
sudo find /mnt -name grub.cfg
2) If I understand you currently, you are claiming grub installs into the Partition Boot Record of sda5 pointing to a dir that does not exist.....and on reboot....your menu appears and you can boot it.
3) Your grub.cfg seems to have changed slightly from post 1. Does that mean it no longer works from post 1?
And....I am gobsmacked your setup works.....I must try that out for my sda3 when I get time.
Normally.....grub2 is told.....set root=(hd0,5) .....to look for the balance of the grub2 files at first drive fifth partition
and normally expects to find either
/boot or
/grub as the directories and not /tce.
so I am still gobsmacked
Ok. Now, I am slowly understanding GRUB2. GRUB2 (according to me) is an overlay over the GRUB4DOS. It boots GRUB2 when the overlay GRUB2 files are available in boot directory and it boots GRUB4DOS when those files are not available. I saw somewhere on the web saying that by default, GRUB2 looks for its own files in (hdX,Y)/boot/grub. And hence, I think this works.
1) My grub.cfg is here (copied as it is from command you said)
sudo find /mnt -name grub.cfg
2)I think there is some confusion. I made the grub-install point to that non-existent directory. Then, the grub created that grub directory itself.
I don't think the --boot-directory option of grub-install. From help of grub-install :
--boot-directory=DIR install GRUB images under the directory DIR/grub
instead of the boot/grub directory
And hence I typed --boot-directory=/mnt/sda5/boot .
3) Yes. The post #1 is made for GRUB4DOS and I made it coz I saw GRUB4DOS name above the grub console. It doesn't work for GRUB2. Now, as GRUB2 was booting fine, I changed the "kernel" command as "linux" and the "root" command as a variable. The commands "kernel" and "root" do not exist in GRUB2.
-
Sashank999
copy and paste your results to this command please
sudo find / -name grub.cfg
I have changed the command because your reply does not make any sense to me.
I am looking for your full pathway to your file. I hope that is now clearer.
I am unwilling to install grub4dos and instead will attempt to duplicate whatever I think you are doing using only grub2. I hope that is now clearer.
thanks
-
The full result of that command is
/mnt/sda5/boot/grub/grub.cfgFor the before post, answering your command, I actually copied it from terminal and pasted in Firefox. I now realised that it doesn't work like that. It is just the same command. Sorry.
Now, it is the result.
Sorry for the late reply. I had my internet connection cut.
-
no worries.
Are you now able to say:
you have grub4dos and grub2
your current setup is a success
you would like this post to be marked as solved?
-
No. I only have grub2 and no grub4dos.
My current setup is a success. ;D
Yes. This post can be marked as solved ;D .
Additionally, I request the TCL makers or updaters to provide a guide for successful installation of grub2 on TCL.
-
Hi Sashank999
... Yes. This post can be marked as solved ;D ...
Done.
-
Hi
I only have grub2 and no grub4dos.
so your earlier remarks you saw grub4dos.....no longer apply?
Then you have successfully installed grub2 into the PBR of /dev/sda5
I have no experience of using grub4dos
Additionally, I request the TCL makers or updaters to provide a guide for successful installation of grub2 on TCL.
There are some issues with current wiki, this is a known issue. There are these forum posts, in addition to the wiki entries
http://forum.tinycorelinux.net/index.php/topic,19364.0.html
alternative guide
http://forum.tinycorelinux.net/index.php?action=post;quote=143377;topic=22848.30;last_msg=146885
In addition, altho I do not use it....I believe the coreplus iso that will boot you into a 32 bit OS has an installer.
I think you are actually asking for something more like
"how do I keep Windows bootloader, and chainload to grub2 in a specific partition?"
but you have already confirmed you have that working.
Also you may like to read coreplayer2 assessment of bios makes
http://forum.tinycorelinux.net/index.php?action=post;quote=143186;topic=22848.15;last_msg=146885
cheers
-
Yes. The GRUB4DOS is no longer visible. And I have working GRUB2 !
Cheers !