[SOLVED] Can't install Grub to HD

I just found out myself… Well, guess I was wrong there… :innocent:

I said so in my very first post:

I’m sorry that was not clear; I can only install Grub to the SD card and use it to boot into my OSs on the HD. What I’m trying to do and what is not working is to normally install Grub to HD, since I originally intended to use that SD card for something else.

The problem with SD card is that you have the first 2 partitions as /dev/mmck or something like this (typing from phone) and not reflected in parted -l . And I think there is a limit on number of partitions (7?) for SD card. Not sure, but need to check it out.

Normally, there shouldn’t be problems installing in (proper) partitioned sd card, but in your case, that is the problem especially with the first 2 partitions.

Right now, I am not sure, but please google and find out.

Manjaro install s are well normal. And don’t have any problem.

Will follow up when I get back.

Meantime do some homework yourself.
Cheers don’t mean to be harsh. But really, you need to put all information at the beginning. Cheers.

Summary

This text will be hidden

Ok … run any livecd. Run terminal with full root account:

OR

Umount all automatically mounted partitions:

Do the following steps:

  1. Chroot

mount /dev/sda7 /mnt mount /dev/sda9 /mnt/boot mount -B /proc /mnt/proc mount -B /sys /mnt/sys mount -B /dev /mnt/dev chroot /mnt /bin/bash
2. Grub installation:

  1. Exit chroot:
  1. Umount all mountpoints:

umount /mnt/dev umount /mnt/proc umount /mnt/sys umount /mnt/boot umount /mnt

  1. Reboot your computer.

  2. Give feedback.

PS
Any advice needed? Avoid using kind sort of inventions / gadgets / toys like Super Grub Disk. Grub Customizer, “I’ll do it AUTOMATICALLY for you PRO_SUPER_HIPER_LOADER”, etc. :smiley:

Here is manual:
https://www.gnu.org/software/grub/manual/grub.html .

A quick question. How did you make your sd card bootable? Did you install a separate bootloader there and if yes, what is it based on? And where is the grub.cfg (or menu.lst or sysljnux or…)? You will need to print out that grub.cfg or…

PS I have a few USBs and externals with bootloader’s in them and given out many with OSs or isofiles in them.

Hey Guys,
I just tried installing Grub via Live CD the way @marcin82 had explained. It was a good idea, but it would have been too easy if it had worked… :pensive:
Btw @gohlip,
I installed Grub on the SD card by simply creating a single partition on it (fat16) and running sudo grub-install /dev/mmcblk0 . grub.cfg and syslinux are on the /boot partition, but I haven’t found a menu.lst.

Well, I think I’ll just get another SD card and leave it that way. I apreciate all your help and I’m very grateful. But I don’t think we will find a solution soon and I more and more feel like wasting your time. Don’t know if it is my fault but I’m sorry for being so “unhelpable”. :disappointed:

However, I learned many things and you guys are great! Keep on the good work! :smiley:

Thanks again and bye for now! :blush:

First, no, you’re not wasting our time and we are always willing to help, otherwise we won’t be here. The thing is your sd card partitions is listed as /dev/mmclk0… and a normal sd card can be listed as sdb1, etc… just like a normal partition. and will be found in parted -l.

BTW, here’s a method which I used to make a usb bootable and can be applied to sd cards as well. Just format the boot partition as ext2. Use gparted to set partition table (msdos in your case) first before creating partitions.

If you like, you can try (on another sd if you want) . all it needs is about 50 MB, but since sd’s now come with at least 4GB, you can create another partition to keep another OS, an isofile or another partition for another OS. I am happy to help out if you need any information.

Cheers, take care.

ps: it can boot the OS’s on the hard drive as well.

[edit] - in the case of sd cards or external usb’s,

sudo mount /dev/sdbx /mnt
sudo grub-install --boot-directory=/mnt/boot /dev/sdb

where sdb is the sd card. If sdc, use sdc. Check with parted -l, fdisk, …

Were any errors?

I forgot … if there is installed grub-customizer - remove it when you are in chroot environment:

Then update-grub once more:

OR

What at general are the errors when you see Grub2 menu and run one of the menu entry?

I’m sorry @gohlip, I think we are not talking about the same thing…
To make it clear:
I can install Grub to a an SD card. That works. Then I can use that SD card to boot the OSs on my HD. No Problem with that.
What I want to do is to install Grub to the HD, so that I don’t need the SD card anymore. That’s what doesn’t work.

Not at all.

I don’t even get to see the menu. When I boot It tells me that no OS is installed on the HD.

Boot up to manjaro,
Recheck at terminal what is the hard drive, is it sda or sdb.
Then

sudo grub-install /dev/sda

or

sudo grub-install /dev/sdb

whichever is the hard drive.

Then just do a

sudo update-grub

whether it’s necessary or not.

Doesn’t work?

Then use force

sudo grub-install --force /dev/sda

either /dev/sda or dev/sdb

EDIT

Oh writing this in a hurry.
Also go to /etc/fstab,

I recall (without checking now) there is an entry for your sd card - comment this out (at the same time you do the above)

If none, ignore this post.

But good idea after booting up Manjaro, pull out the sd card before doing the commands.:grin:

Wait a moment …

[quote]/dev/sda1 2,048 1,026,047 1,024,000 7 NTFS / exFAT / HPFS
/dev/sda2 1,026,048 124,033,023 123,006,976 7 NTFS / exFAT / HPFS
/dev/sda3 124,033,024 125,642,751 1,609,728 27 Hidden NTFS (Recovery Environment)
/dev/sda4 125,642,752 976,773,119 851,130,368 5 Extended
/dev/sda5 968,384,512 976,773,119 8,388,608 82 Linux swap / Solaris
/dev/sda6 758,654,976 968,384,511 209,729,536 7 NTFS / exFAT / HPFS
/dev/sda7 125,642,816 325,642,814 199,999,999 83 Linux
/dev/sda8 325,642,816 625,642,814 299,999,999 83 Linux
/dev/sda9 * 625,642,816 626,228,751 585,936 83 Linux[/quote]

If you set BOOT flag on /dev/sda1 - will it change something?

After all this mess, I assume there must be a wrong assumption :grin: .
My bet goes on the BIOS/UEFI.
I have no UEFI experience. The good old BIOS has a shortcut to specificlly select the boot medium on each boot. If there is a similar option you could try to specify a different option for a couple of boots to see the reaction.
I go to have a swim now to fresh up!!

Writing this ahead because I’ll be logging off within the next hour and will be away for at least 8 hours.

If all still won’t work, force reinstall grub before doing the commands.

Boot up Manjaro,
pull out the sd card.
Recheck hard disk drive as sda or sdb
pacman --force -S grub
sudo grub-install --force /dev/sda (or /dev/sdb)
sudo update-grub

ps: as marcin82 pointed out, if using grub-customizer (or had before) remove it, like totally. burn it , trash it, bury it, kill it…

1 Like

No. in linux, it really doesn’t matter. And it will be reset after a grub-install.[quote=“petsam, post:49, topic:5091”]
My bet goes on the BIOS/UEFI.
[/quote]His drive(s) show dos (msdos) and no way uefi will boot this. We may be confused if gpt and then it can either be bios or uefi.

But what I’m concerned is that sd card shows as /dev/mmmcksomething and that’s not good.
My sd cards show as ‘normal’ partitions.

Yes, I know it … but for Windows yes, it does.

[quote=“marcin82, post:52, topic:5091”]
Yes, I know it … but for Windows yes, it does.
[/quote]And if OP gets manjaro’s grub-install done, the boot flag will show in the manjaro /boot partition.
Currently it’s (flag) still windows boot as he hasn’t got manjaro to set grub in that hard drive.
But, really that’s not something we should worry about. But good to bring this up in case it does.

So… here’s what this sd card does.
http://linux-sunxi.org/Bootable_SD_card

And here’s how to erase it.

$ umount /dev/mmcblk0
$ umount /dev/mmcblk0p1

$ dd if=/dev/zero of=/dev/mmcblk0 count=8192 bs=4M
$ dd if=/dev/zero of=/dev/mmcblk0p1 count=8192 bs=4M
After that, I guess you need to reinstall grub and do the grub -install

Oh, of course, use at own risk, I haven’t done this,
Good night.

Excuse me for not replying by now, but I haven’t found time to do so yesterday.
But today I have good news!
Finally, it works! :grin:

That was the solution for me! Thank you all so much! You can’t imagine how happy I am right now… :heart_eyes:
Didn’t know it was so easy…

However, I still have a question: What’s so bad about grub-customizer? Though I haven’t used it yet, I once read an article about it and thought about trying it on my other PC.

And something else: I recenty ran into another problem, which I think also has to do with Grub; I can’t open virtual consoles (tty1-tty6) by pressing Ctrl+Alt+F1, Ctrl+Alt+F2 and so on. When I do that I simply get a black screen. Switching back to desktop using Ctrl+Alt+F7 works. I already found out, that it’s probably Grub setting a wrong resolution for the console, but no fix on the internet seems to work for me.
Shall I open a new post for that?

Anyway, it’s great that I can boot normally now. :slight_smile:
Thanks again so far!

1 Like

Yay! Have an Altstadt bier on me. Prost!

Always good to hear this and you’re most welcome.

Cheers. Take care.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by Bytemark