Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] A big problem with GRUB2
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
fresherthanever
n00b
n00b


Joined: 11 Nov 2013
Posts: 40
Location: Houston

PostPosted: Mon Nov 11, 2013 2:41 am    Post subject: [Solved] A big problem with GRUB2 Reply with quote

I have a UEFI capable board (comp specs in sig), and I installed the EFI Gentoo AMD64 from lubuntu (in UEFI, naturally) LiveUSB. I basically followed http://wiki.gentoo.org/wiki/GRUB2#UEFI.2FGPT to install GRUB2 onto my 500GB drive. Besides using pf-sources and using a genkernel initramfs, I've essentially used the same installation guidelines featured in the handbook for AMD64. My partitions go as follows:

/dev/sda1 /boot/efi vfat 500m
/dev/sda2 /boot ext2 1.5g
/dev/sda3 linux-swap 1g
/dev/sda4 / 240g
/dev/sda5 /usr ~255g

So after installing GRUB2 and finalizing the installation, when I booted, I got the GRUB2 command line and it told me it couldn't find the kernel or something. I literally have not touched to installation since because I didn't want to overcomplicate the situation and I need to sleep. So, any advice on how to get my machine to boot over EFI GRUB2 with initramfs?
_________________
Specs: AMD FX-6100|ASUS M5A97 AM3+|XFX AMD Radeon HD 6870|1TB 7200RPM/500GB 7200RPM|8GB DDR3 1600MHz


Last edited by fresherthanever on Sun Nov 17, 2013 10:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Mon Nov 11, 2013 9:28 am    Post subject: Reply with quote

You have to tell grub where (e.g partition) the kernel resides.

There are several ways, My usual approach is try and error (the fastest way if you use the build in command line and editing options, and remember what you already tried).

It helps if you could post your relevant grub.config
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Mon Nov 11, 2013 10:17 pm    Post subject: Reply with quote

recommend forgetting about grub2 and using http://wiki.gentoo.org/wiki/EFI_stub_kernel (as bootloader) if single booting gentoo; add refind (as boot manager) for mulibooting and/or to minimize maintenance required for new kernels. If windows is involved see http://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
zongo
n00b
n00b


Joined: 25 Dec 2013
Posts: 21

PostPosted: Sat Dec 28, 2013 5:24 pm    Post subject: Reply with quote

Hi,

I am new to Linux/Gentoo, being reading for a while, spent the whole day trying to install Gentoo on a Dell XPS12.

I have being reading the pages noted above, but I am stuck even earlier...

I am trying a UEFI - GRUB2 - systemd installation, and I am not sure what I have to follow:

https://wiki.gentoo.org/wiki/GRUB2

or

http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=10

or

https://wiki.gentoo.org/wiki/Systemd

I am not capable of merging the 3 pages into one consistent operative description. Mostly following the handbook, but after installing dbus and systemd,
I emerging grub2, tried "grub2-install" and got "/usr/lib/grub/x86_64-efi does not exist". In the directory /usr/lib/grub there is only i386-pc.

I also think that my partition scheme was rubbish - I copied the one of the gentoo installation manual, but I fear now that it is not compatible with efi-gpt...

Could somebody help me out please? :cry:
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Sat Dec 28, 2013 9:36 pm    Post subject: Reply with quote

are you dual booting with windows? recommend https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8.
are you replacing windows with gentoo? recommend https://wiki.gentoo.org/wiki/EFI_stub_kernel
in either case recommend leaving grub2 out of it.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
zongo
n00b
n00b


Joined: 25 Dec 2013
Posts: 21

PostPosted: Sat Dec 28, 2013 10:57 pm    Post subject: Reply with quote

DONAHUE wrote:
are you dual booting with windows? recommend https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8.
are you replacing windows with gentoo? recommend https://wiki.gentoo.org/wiki/EFI_stub_kernel
in either case recommend leaving grub2 out of it.


Replacing. I read the stub stuff, and I am going to try it. Thank you :) Still, I find the article difficult to understand precisely.

If I understand right, I just need two partitions. The EFI partition, which should start at 1Mib for reading efficiency (block contiguity) and should be 200-500 MiB, and the rest of the disk as root filesystem, no more external boot required. Am I right?

About the kernel command line: I definitely need it in order to choose systemd over initrc. Is specifying a partition enough to do this? Does it work even if /boot is not on a separate partition, but rather together with the root filesystem? Is there a way to add a path to a partition identifier? e.g. dev/sda2(/root)

Code:
Processor type and features  --->
    [*] Built-in kernel command line
    (root=/dev/sda2)


About initramfs: this I might need in the future if I encrypt the root partition. Still, from the article it appears that the linux kernel image and the initramfs should become one file, while the commands appear to imply that initramfs remains separated and in boot. Again, would this still work with a /boot non-separated from the root filesystem?

Possibly very dumb question: what does the following command "file" does?

Code:

root # zcat /boot/initramfs-genkernel-x86_64-3.6.11-gentoo > /boot/initramfs.cpio
root # file /boot/initramfs.cpio



About the multikernel option:
again, it appears that I should copy the kernel images into /EFI/Boot within the EFI partition. So in order to identify different OSes I just have to change the names? Does this means that the name "bootx64.efi" is completely arbitrary?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Sun Dec 29, 2013 1:31 am    Post subject: Reply with quote

zongo wrote:
DONAHUE wrote:
are you dual booting with windows? recommend https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8.
are you replacing windows with gentoo? recommend https://wiki.gentoo.org/wiki/EFI_stub_kernel
in either case recommend leaving grub2 out of it.


Replacing. I read the stub stuff, and I am going to try it. Thank you :) Still, I find the article difficult to understand precisely.

If I understand right, I just need two partitions. The EFI partition, which should start at 1Mib for reading efficiency (block contiguity) and should be 200-500 MiB, and the rest of the disk as root filesystem, no more external boot required. Am I right?

:arrow: I would add a swap partition just larger than installed ram; so, EFI, /, swap

About the kernel command line: I definitely need it in order to choose systemd over initrc. Is specifying a partition enough to do this?

:arrow: No, systemd needs init=/usr/lib/systemd/systemd or real_init=/usr/lib/systemd/systemd (initramfs)

Does it work even if /boot is not on a separate partition, but rather together with the root filesystem?

:arrow: Yes.

Is there a way to add a path to a partition identifier? e.g. dev/sda2(/root)

Code:
Processor type and features  --->
    [*] Built-in kernel command line
    (root=/dev/sda2)


:arrow: need init= without or real_init with initramfs. Example
Quote:
Processor type and features --->
[*] EFI GUID Partition support
[*] EFI runtime service support
[*] EFI stub support
[*] Enable seccomp to safely compute untrusted bytecode
[ ] Enable -fstack-protector buffer overflow detection
Timer frequency (1000 HZ) --->
[ ] kexec system call
[ ] kernel crash dumps
[*] Build a relocatable kernel
(0x1000000) Alignment value to which kernel should be aligned
[ ] Support for hot-pluggable CPUs
[ ] Compat VDSO support
[*] Built-in kernel command line
(root=/dev/sda2 ro init=/usr/lib/systemd/systemd) Built-in kernel command string
[*] Built-in command line overrides boot loader arguments


About initramfs: this I might need in the future if I encrypt the root partition. Still, from the article it appears that the linux kernel image and the initramfs should become one file, while the commands appear to imply that initramfs remains separated and in boot. Again, would this still work with a /boot non-separated from the root filesystem?

:arrow: Yes.

Possibly very dumb question: what does the following command "file" do?

Code:

root # zcat /boot/initramfs-genkernel-x86_64-3.6.11-gentoo > /boot/initramfs.cpio
root # file /boot/initramfs.cpio


:arrow: decompresses /boot/initramfs-genkernel-x86_64-3.6.11-gentoo and installs result as /boot/initramfs.cpio, file command tests the result is correct as report should be /boot/initramfs.cpio: ASCII cpio archive (SVR4 with no CRC).
To get this:
Code:
emerge genkernel-next
genkernel all
zcat /boot/initramfs-genkernel-x86_64-3.6.11-gentoo > /boot/initramfs.cpio
genkernel --menuconfig kernel
Edit menuconfig to include
Quote:
General Setup --->
[*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
(/boot/initramfs.cpio) Initramfs source file(s)
exit menuconfig, saving the configuration and allow genkernel to complete. There is now an initramfs built into the kernel created from the .cpio which was created from the initramfs-genkernel-


About the multikernel option:
again, it appears that I should copy the kernel images into /EFI/Boot within the EFI partition. So in order to identify different OSes I just have to change the names? Does this means that the name "bootx64.efi" is completely arbitrary?

:arrow: Not completely. More accurate to call /EFI/Boot/bootx64.efi the default that efi will boot absent other direction.

_________________
Defund the FCC.
Back to top
View user's profile Send private message
zongo
n00b
n00b


Joined: 25 Dec 2013
Posts: 21

PostPosted: Sun Dec 29, 2013 12:10 pm    Post subject: Reply with quote

Thank you!

Now I have a better picture. One more thing: if I need more than one command on the command line, do I simply chain them with a blank in between?

Like "root=/dev/sda2 init=/usr/lib/systemd/systemd"?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7550
Location: Goose Creek SC

PostPosted: Sun Dec 29, 2013 5:53 pm    Post subject: Reply with quote

yes
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum