WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Trouble installing grub2  (Read 7532 times)

Offline Fog

  • Newbie
  • *
  • Posts: 21
Trouble installing grub2
« on: July 24, 2014, 12:13:20 AM »
this is my sequence of steps.
Burn corepure64.iso to a cd, boot it up
go to terminal, type in tce searched for grub2-efi.tcz, installed it.
Followed instructions given by typing in
Code: [Select]
sudo x86_64-grub-install --target=x86_64-efi --boot-directory=/mnt/sda5/EFI/BOOT --efi-directory=/mnt/sda5Note that sda5 is my tiny core partition (or will be once I get grub working)
I then try to follow the rest of instructions but grub.cfg doesn't exist
Code: [Select]
tc@box:~$ cat /mnt/sdb1/EFI/BOOT/grub/grub.cfg
cat: can't open '/mnt/sdb1/EFI/BOOT/grub/grub.cfg': No such file or directory
I've looked in all sections possible in sda5, and found no grub.cfg, so I made my own in the required directory by putting in the stated menuentry with vi.
Code: [Select]
menuentry "core" {
  linux (hd1,gpt2)/boot/vmlinuz64 quiet noswap tce=sdb2 tz=GMT-4 blacklist=bcma
 blacklist=ssb blacklist=b43 text
  initrd (hd1,gpt2)/boot/corepure64.gz
}
When taking out the cd and booting to hard drive grub boots to rescue mode, and no commands I've found that are supposed to work (such as ls or search) don't, it says command not found.

I've also tried tce-run grub2-efi.tcz in terminal and hitting enter (though I didn't see why), and copying grub2-efi.tcz to /mnt/sda5/tce.
It seems to me chroot should be necessary, so I tried
Code: [Select]
tc@box:~$ chroot /mnt/sda5
chroot: can't change root directory to '/mnt/sda5': Operation not permitted
Other directories I've tried have the same result, I must not be using the command right.

Note that I haven't been able to find a guide online for tiny core grub2 manual install, if there is one available that you know of that might be helpful. Other than that thanks for reading this far, and I'm happy to provide any more info that might be required.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble installing grub2
« Reply #1 on: July 24, 2014, 01:26:07 AM »
I see a few potential problems, but first this is most probably a path issue.

at the grub prompt  (rescue mode might be limited) type " ls " then enter to list drives and partitions visible to grub.


hd1,gpt2 is not likely the correct path for your install


in CLI mode you can use " ls -lh (hd0,5)/ " for example, which will list the contents of hd0,5   if this is where the kernel is located then use that path

In rescue mode you can type the path manually  (like the following assuming your sda5 is visible to grub as hd0,5 and the Linux kernel is installed as per example)

linux (hd0,5)/boot/vmlinuz64
initrd (hd0,5)/boot/corepure64.gz
boot
« Last Edit: July 24, 2014, 02:37:54 AM by coreplayer2 »

Offline Fog

  • Newbie
  • *
  • Posts: 21
Re: Trouble installing grub2
« Reply #2 on: July 24, 2014, 02:19:00 AM »
In grub rescue mode ls -l or ls -lh returns error bad filename, but ls without any additional options works. The path to my partition is (hd0,msdos5). I edited grub.cfg (located in /mnt/sda5/EFI/boot/grub/grub.cfg maybe I didn't put it in the right place?) accordingly and grub still boots to recovery mode. The help command returns an error: command not found. Here's my grub.cfg just in case I did something wrong

     menuentry "core" {
        linux (hd0,msdos5)/boot/vmlinuz64 quiet tce=sda5 tz=GMT-4 blacklist bcma
        initrd (hd0,msdos5)/boot/corepure64.gz
        boot
}

Thanks for the quick response, I hadn't expected anything until tomorrow.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble installing grub2
« Reply #3 on: July 24, 2014, 03:19:12 AM »
Code: [Select]
linux (hd0,msdos5)/boot/vmlinuz64
initrd (hd0,msdos5)/boot/corepure64.gz
boot

these are commands to be entered manually, one line at a time at the grub rescue prompt (not used in grub.cfg)

enter
linux (hd0,5)/boot/vmlinuz64

if no error then type the next line etc.  If an error then fix error with correct path and start over
« Last Edit: July 24, 2014, 03:32:17 AM by coreplayer2 »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: Trouble installing grub2
« Reply #4 on: July 24, 2014, 03:50:06 AM »
I don't see it mentioned anywhere, but this is for a uefi boot from a gpt partitioned drive, right?

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble installing grub2
« Reply #5 on: July 24, 2014, 03:59:56 AM »
That's a good question  :p

Offline Fog

  • Newbie
  • *
  • Posts: 21
Re: Trouble installing grub2
« Reply #6 on: July 24, 2014, 04:29:55 AM »
It's a normal bios (non uefi) and mbr partitioned. Does that mean I have to have a boot partition at the beginning of the disk?

Coreplayer2 I forgot to include I also tried those commands at the grub rescue prompt, it came back with error: unknown command.

It's been a year or so since I've worked with linux, and have forgotten a lot. I know there was trouble last time I tried to install grub but don't remember how it was solved.

Edit: Here's my disk layout
Code: [Select]
tc@box:~$ fdisk -l

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks  Id System
/dev/sda1               1           5       38912  de Unknown
Partition 1 does not end on cylinder boundary
/dev/sda2   *        1572        6140    36688680   7 HPFS/NTFS
Partition 2 does not end on cylinder boundary
/dev/sda3            9294        9725     3470008+ db Unknown
Partition 3 does not end on cylinder boundary
/dev/sda4               5        1572    12585264   5 Extended
/dev/sda5   *           5        1311    10485760+ 83 Linux
/dev/sda6            1311        1572     2099440+ 82 Linux swap

Partition table entries are not in disk order
« Last Edit: July 24, 2014, 04:36:48 AM by Fog »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Trouble installing grub2
« Reply #7 on: July 24, 2014, 04:58:18 AM »
I doubt the EFI bootloader works with MBR bios. You should use a MBR bootloader.
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble installing grub2
« Reply #8 on: July 24, 2014, 05:00:24 AM »
Now we got to the root of the problem

use grub2 extension for legacy BIOS

Offline Fog

  • Newbie
  • *
  • Posts: 21
Re: Trouble installing grub2
« Reply #9 on: July 24, 2014, 05:42:40 AM »
What's the grub2 extension called? I only saw grub2-efi.tcz, but I'll look again tomorrow.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: Trouble installing grub2
« Reply #10 on: July 24, 2014, 05:54:51 AM »
I thought I'd uploaded it months ago, but...

grub2 extension posted

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Trouble installing grub2
« Reply #11 on: July 24, 2014, 01:59:23 PM »
I've used the grub2 extension from x86 repo  for my non efi installs