Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Gentoo Multiboot (Windows 10) - Kernel panic:
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Sat Apr 16, 2016 1:39 am    Post subject: [Solved] Gentoo Multiboot (Windows 10) - Kernel panic: Reply with quote

Hi,

I've been trying to install gentoo linux for the last 7 days and I almost finished everything flawlessly. However, I can't seem to make gentoo boot: everytime I try to boot, it returns a message about VFS can't mount unknown partition.

More details:
It's a laptop with a Samsung Evo SSD initally running Windows 10. It's a UEFI system with GPT partitions (with rEFInd installed, although I'm currently ignoring it).

Here is my current hard disk structure:

livecd grub # parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA Samsung SSD 850 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 473MB 472MB ntfs Basic data partition hidden, diag
2 473MB 577MB 104MB fat32 EFI system partition boot
3 577MB 593MB 16.8MB Microsoft reserved partition msftres
4 593MB 126GB 125GB ntfs Basic data partition
5 126GB 157GB 31.5GB ext4 rootfs
6 157GB 159GB 2097MB linux-swap(v1) swap
7 159GB 500GB 341GB ntfs Basic data Partition


rootfs is partition /dev/sda5 and the boot (vfat due windows requirements) is /dev/sda2.

As you can imagine, I've been trying using efibootmgr and it's current structure is:

BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0004,0003,0001,0000,2001,2002,2003
Boot0000* Windows Boot Manager
Boot0001* rEFInd Bootloader
Boot0002* USB1-1 (SanDisk Cruzer Glide)
Boot0003* Gentoo
Boot0004* Gentoo
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network


EFI is also a new subject to me, and since gentoo handbook doesn't explain very well how to create UEFI dual boot (or couldn't find relevant instruction) I resorting to the community to help me.

During boot, the tree lines the describe the problem (I guess) are the following:

VFS: Cannot open root device "(null)" or unknown-block (0,0): error -6
Please append a correct "root=" boot options; here are the available partitions:
VFS: Unable to mount root fs on unknown-block(0,0)


What more information will be needed to track the problem?

Thank you so much.
Nelson


Last edited by nelsonwcf on Mon Apr 18, 2016 9:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43595
Location: 56N 3W

PostPosted: Sat Apr 16, 2016 9:19 am    Post subject: Reply with quote

nelsonwcf,

Code:
unknown-block(0,0)
is key.
It means that the kernel cannot see the hard drive at all.

Usually its due to the kernel SCSI stack missing a layer, like Scsi Disk support, the AHCI driver and so on.

With the advent of EFI, there are more reasons for that message.

Code:
here are the available partitions:
shoulh have been followed by a list of block devices that the kernel can see.
In your case it should have been six lines for /dev/sda and its partitions. Your optical drive could have been listed too.
It that list is there your kernel is OK. If its missing, your kernel still might be OK.

What happens next depends on how you made your kernel. Tell us about that.
Also post your grub.cfg file. What you need there depends on how you made your kernel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Sun Apr 17, 2016 2:06 am    Post subject: Reply with quote

Thank you for the help.

Let me share the information I have.

This is my .config file from the kernel: http://pastebin.ca/3495194

I cannot paste grub.conf because I didn't use it. If I understood correctly, we can chose to use efibootmgr instead, correct?

I also used genkernel but it returned an error (even though the linux partition started to appear at rEFInd boot manager.

Can you provide me more ideas in how to fix it?

Note: Is there any way for me to extract the bzImage from Gentoo LiveCD to try to use it on the partition? If it works, than I guess the problem will be on the kernel settings, right?

Thank you!
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Apr 17, 2016 2:51 am    Post subject: Reply with quote

You need to include kernel command line in kernel configuration if you want to boot it without additional boot loader, efibootmgr is not a boot loader.
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Sun Apr 17, 2016 3:10 am    Post subject: Reply with quote

But shouldn't EFI already be a boot loader? If not, how do I do include a line there? Is there a guide showing that? I suspect I'm getting closer to the issue. :-)

Thanks!
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Apr 17, 2016 3:17 am    Post subject: Reply with quote

Google search I did for you. You can use Google on your own, too. 8)
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Sun Apr 17, 2016 4:25 am    Post subject: Reply with quote

Dude, I've tried to use both google and duckduckgo before coming to the forum. The main problem was to know what to look for. None of the answer the search engine returned me gave me the exact answer I needed and I was unable to extrapolate/adapt it to my case. The google search you provided me returned the same results as when I used it but couldn't follow or didn't work. So using google was indeed the first step. The second was rEFInd documentation, but it is not very trivial. Finally, I found Gentoo guide for booting the partition and multi-boot EUFI but which didn't work for me. That's the reason I'm here.

BTW, using google and the forum when using the text interface on links is not trivial, at least not for me. Everytime I have to use google I have to reboot in windows so you can imagine how annoying is not being able to boot.

Thank you.
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Sun Apr 17, 2016 7:28 am    Post subject: Reply with quote

Hi nelsonwcf,

neoptslap wrote:
nelsonwcf wrote:
Everytime I have to use google I have to reboot in windows so you can imagine how annoying is not being able to boot.

see SystemRescueCD

----- (topic 1005562) -----
xaviermiller wrote:
Hello,

SystemRescueCD is gentoo based and has a lot more network drivers, system utilities... and a graphical interface with internet browser, ...
I recommand it :)


Best regards,

neoptslap


Last edited by 324874 on Sun Apr 17, 2016 9:41 am; edited 2 times in total
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Sun Apr 17, 2016 9:17 am    Post subject: Reply with quote

neoptslap wrote:
Buffoon wrote:
You need to include kernel command line in kernel configuration if you want to boot it without additional boot loader, efibootmgr is not a boot loader.
nelsonwcf wrote:
... If not, how do I do include a line there?

See Reference [1]

neoptslap wrote:
NeddySeagoon wrote:
It means that the kernel cannot see the hard drive at all.

Usually its due to the kernel SCSI stack missing a layer, like Scsi Disk support, the AHCI driver and so on.

Buffoon wrote:
You need to include kernel command line in kernel configuration ...

See References [2, 3]

Tips :

Seek information, study and learn to understand (cf. Reference [4]).
Be patient, sometimes, it may be several issues.
+ try to use existing Gentoo's tools to be efficient

References :
  1. Gentoo Wiki / EFI Stub kernel
  2. Gentoo Wiki / How to configure a Linux Kernel
  3. Greg Kroah Hartman / Linux Kernel In a Nutshell
  4. Quick overview about Gentoo 's learning !


Last edited by 324874 on Thu Apr 21, 2016 5:29 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43595
Location: 56N 3W

PostPosted: Sun Apr 17, 2016 11:05 am    Post subject: Reply with quote

nelsonwcf,

You have made your kernel an EFI compatible program. That works but its not the way I would start out.

The EFI loader loads exactly one thing into RAM. The kernel. Everything the kernel needs has to be in that one file.
You don't get to load an initrd, you don't get to pass kernel parameters and so on.
It means that you have to do a kernel rebuild if the boot fails.

You can build both the initrd and the kernel parameters into the kernel.

For the command line, in menuconfig, press / and enter CMDLINE
You will get several hits.
Start with CONFIG_CMDLINE_BOOL, which is actually a menu control. Follow the help to navigate there.
Turn it on. In the menu that appears you will see
Code:
()    Built-in kernel command string (NEW)

That's where you fill in your command line.

The built in initrd is similar. You give the kernel a pathname to your initrd.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 3:14 am    Post subject: Reply with quote

Thank you. At least now I know that if I'm able to make it work with EFI, I will get a great understanding of linux boot process. Some questions that are still not clear to me:

1. Do I need a initramfs? In gentoo documentation, it says I only need it if some directories are located in different partitions. In my case, everything is in just one partition. I'm guessing that I don't need it but having a confirmation could help me here.

2. What would be the alternate way to make the kernel boot without using EFI directly? Using GRUB I think. But how could I make grub Bootloader interact with rEFInd? Won't I have the same issue as I'm having now?

3. Just to be sure: the root path should point to the /, not to the /boot, right? I'm using blkid UUID from /dev/sda5 (root) in the kernel param. This is correct, right?

4. I'm not using a ramdisk so why do I need the initrd kernel parameter?

Thank you,
Nelson
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Mon Apr 18, 2016 8:44 am    Post subject: Reply with quote

Hi nelsonwcf,

I hope you will understand the Linux boot process. However, try to have a clear representation
of what you will learn. Try to extract and manipulate things your way to avoid magical thoughts.

nelsonwcf wrote:
1. Do I need a initramfs? In gentoo documentation, it says I only need it if some directories are located in different partitions. In my case, everything is in just one partition. I'm guessing that I don't need it but having a confirmation could help me here.

nelsonwcf, I advice you to search information or ask to someone "What is a fileystem ?" and check the information.
Indeed, filesystems and partitions are two different things, here, things are subtle. Files are stored "on" filesystems and "not directly" on partitions.

Initramfs stands for initial ram filesystem. I haven't knowledge enough to explain it but I'm trying.
I know it's the root filesystem that is loaded in memory during the boot process because some "system tools" are located on the root filesystem and
may be necessary to mount the root filesystem (depend on the system 's configuration).
For example, it's like you're trying to get into a closed car with the key located in the car. You can't enter in the car without the key.
The Linux kernel want to mount the root filesystem with some "system tools" but it needs to read files located on the root filesystem to use these "tools".

If you use some special system 's programs or if you have some requirements an initramfs is necessary ; using LVM, RAID...

If yes, I advice you read the Gentoo wiki or Arch Linux wiki.

nelsonwcf wrote:
2. What would be the alternate way to make the kernel boot without using EFI directly? Using GRUB I think. But how could I make grub Bootloader interact with rEFInd? Won't I have the same issue as I'm having now?


EFI stands for Extended Firmware Interface. For some years EFI became UEFI (Unified Extended Firmware Interface).
Before UEFI, there was BIOS (Basic Input Output System) : UEFI and BIOS are both firmwares. Now, many manufacturers are developping UEFI.
If your firmware is UEFI so you will have to use UEFI. Manufacturers of UEFI 's implementations try to use as a base the BIOS code as much as possible.
So, you can use the BIOS compatibility mode. When you load a bootloader like GRUB instead of the (U)EFI Stub kernel it's the UEFI firmware that load the bootloader.
So, the UEFI implementation works always (the UEFI specification defines the boot process). You may use the GRUB bootloader if you want load different operating systems
and switch between them at boot time. You may load rEFInd too and use it to load GRUB. However, you will make unnecessary complex operations.
I advise you to use one of these programs if possible and try to run them because using many programs you increase the level of complexity.
Moreover, I think your system will be unstable if you install several programs because some are not in a operative state.

The main difficulty here is to know whether you can use a boot loader without compatibility problems with the boot loader of Windows 10 or with
the UEFI implementation. In my case, now I've got issues.

nelsonwcf wrote:
3. Just to be sure: the root path should point to the /, not to the /boot, right? I'm using blkid UUID from /dev/sda5 (root) in the kernel param. This is correct, right?


I did so and it works.

nelsonwcf wrote:
4. I'm not using a ramdisk so why do I need the initrd kernel parameter?


I believe that initramfs and initrd are different things ! I think if you don't need initrd or initramfs you don't need the initrd kernel parameter.

N.B : Gentoo may be an "difficult" operating system and may require much effort.

Best regards,

neoptslap
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 1:32 pm    Post subject: Reply with quote

Hi neoptslap,

Thanks for taking time answering my questions. Maybe my questions were a bit confusing so a quick background may be useful here.

I have been using linux for a long time, since late 90s, starting with Slackware, moving to Debian, Gentoo and after that doing Linux-from-scratch thrice. So, Linux itself is not the problem here. My issues are with the new EFI standard, not with the OS. It affects not only Gentoo, but other distributions and even Windows (as installing Windows 10 and Windows 7 are also tricky - currently, each time my computer boots, it switches between the boot-loader from 7 and 10).

The easiest solution is to just have Windows 10 in EFI and Linux in BIOS, which already works; i just have to enter the BIOS and turn EFI on and off to select which OSs I want. However, this is annoying. When I found rEFInd, I loved the interface and the simplicity. Windows 10 already works flawlessly with it. Now I'm trying to make Linux work under it.

To check if the problem was just the way I'm setting the kernel, I tried to use grub2 instead, booting directly from EFI instead bypassing rEFInd. It also panic. I've tried to export the .config from Gentoo livecd to my kernel and doing "make olddefconfig" before "make". Surprise, it also crashes.

Bottom line: assuming Linux works under EFI bootloader, I'm doing something wrong. I know the theory behind it but how the EFI boot stack model is implemented in linux is what is eluding me. I know that I have to point the EFI bootloader to the kernel and have it set all the environment up using command strings but I don't know where the problem is right now because the kernel simply doesn't boot and panic. It's not something exclusive for Gentoo but something from linux boot method itself. Maybe I'm just missing some file in EFI/boot? Currently it has only the kernel bzImage renamed to .efi. Or maybe it's some option in kernel 4 that is not compatible with kernel 3 and by using the .config from the livecd is crashing the boot?

That's what I'm trying to figure it out. Maybe I will try finding a kernel option that works with Grub2 first but at this point I don't know if it's any portion of the options I'm doing wrong. Takes around 30 minutes to compile it every time.

Thank you again, guys.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Apr 18, 2016 2:27 pm    Post subject: Reply with quote

I took a crash course on EFI myself not long ago. You can boot EFI stub kernel no problem, everything you need is in EFI Stub wiki page. Once I got it booting I added bootloader (rEFInd) to make the boot more flexible, I really like to have a backup kernel as boot choice. I used my kernel that was working with BIOS boot and modified it for EFI as per wiki page.
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 3:08 pm    Post subject: Reply with quote

Buffoon wrote:
I took a crash course on EFI myself not long ago. You can boot EFI stub kernel no problem, everything you need is in EFI Stub wiki page. Once I got it booting I added bootloader (rEFInd) to make the boot more flexible, I really like to have a backup kernel as boot choice. I used my kernel that was working with BIOS boot and modified it for EFI as per wiki page.


Do I need the Initramfs portion also, even having everything in the same partition, Buffoon? I'm just making sure that's not what is causing the kernel to crash.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Apr 18, 2016 3:11 pm    Post subject: Reply with quote

No need for it. Just make sure everything needed for boot is built in <*>. If you have a kernel that boots in BIOS mode without initrd it will boot in EFI mode, too, after you add EFI options as per wiki page.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Apr 18, 2016 3:33 pm    Post subject: Reply with quote

moving
_________________
Defund the FCC.


Last edited by DONAHUE on Mon Apr 18, 2016 3:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
324874
Apprentice
Apprentice


Joined: 26 Jul 2014
Posts: 168

PostPosted: Mon Apr 18, 2016 3:34 pm    Post subject: Reply with quote

nelsonwcf,

nelsonwcf wrote:
nelsonwcf wrote:
Thanks for taking time answering my questions. Maybe my questions were a bit confusing so a quick background may be useful here.
...
currently, each time my computer boots, it switches between the boot-loader from 7 and 10).
...
Windows 10 in EFI and Linux in BIOS
...
use grub2 instead, booting directly from EFI instead bypassing rEFInd

--- topic 1030000 ---
The Doctor wrote:
As Neddy says, Gentoo is really like eating an elephant. Best do it one plate at a time. Following the nonstandard instructions might be okay, but it might not. Adding 10-20 "nonstandard" options increases the complexity quite a bit.


If you juggle with multiple tools I couldn't help you. :roll:

Does your computer have an UEFI or BIOS firmware ?

BIOS and UEFI are two different techonologies.

nelsonwcf wrote:
Bottom line: assuming Linux works under EFI bootloader, I'm doing something wrong. I know the theory behind it but how the EFI boot stack model is implemented in linux is what is eluding me. I know that I have to point the EFI bootloader to the kernel and have it set all the environment up using command strings but I don't know where the problem is right now because the kernel simply doesn't boot and panic. It's not something exclusive for Gentoo but something from linux boot method itself. Maybe I'm just missing some file in EFI/boot? Currently it has only the kernel bzImage renamed to .efi. Or maybe it's some option in kernel 4 that is not compatible with kernel 3 and by using the .config from the livecd is crashing the boot?


-- Some feedbacks

UEFI is a standard. There are several implementations of this standard. These implementations are firmwares.
Most new computers have a firmware based on UEFI.
Linux kernel developers try to make a kernel that works with this standard.
Linux is a kernel and Linux developers don't work with the "UEFI" firmware because they "play" with firmware 's interface based on the UEFI specification.
The "UEFI" firmware may be open source or proprietary but it's not a Linux 's implementation.

nelsonwcf wrote:
... I don't know where the problem is right now because the kernel simply doesn't boot and panic. ...


If your kernel "panic" so It boots !

nelsonwcf wrote:
... Maybe I'm just missing some file in EFI/boot?
... I don't know if it's any portion of the options I'm doing wrong. ...


So, read again the Gentoo handbook, Gentoo wiki pages ...

  • Only for "UEFI" firmware :

You may use Windows 's boot loader or another boot loader, or EFI Stub kernel. efibootmgr add Gentoo as menu entry in the "UEFI" firmware.
nelsonwcf wrote:
As you can imagine, I've been trying using efibootmgr and it's current structure is:
...

During the boot process, either, you choose a bootloader and load an operating system with it, either, you "enter in" the "UEFI" firmware and choose
an operating system to load.

Best regards,

neoptslap
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Apr 18, 2016 3:50 pm    Post subject: Reply with quote

https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 also works with windows 10 and is worth a look.
To use rEFInd or efibootmgr as boot manager you need to install a boot loader.
The lowest maintenance combination is rEFInd with efi stub kernels.
By default rEFInd finds efi stub kernels on GPT labeled disk partitions formatted with file systems ext2fs, ext3fs, ext4fs, reiserfs, btrfs, ISO-9660, HFS+, or NTFS.
I build and save a new kernel using "make && make modules_install && make install". At my next boot rEFInd's menu will show all the efi stub kernel's in /boot (sometimes elsewhere). The only maintenance required is deleting unneeded kernels.
You should be able to use gdisk to convert the msdos labeled disk to GPT saving your existing gentoo installation. Assuming win 10 is on /dev/sda and gentoo on /dev/sdb: boot sisresccd in UEFI mode, run "gdisk /dev/sdb" and agree to conversion. Enter the chroot. Run blkid:
EXAMPLE RETURN: /dev/sda7: UUID="1f43e373-f923-4ec2-a62e-6a0d98927583" TYPE="swap" PARTLABEL="Linux filesystem" PARTUUID="92d3d504-9e7e-4c3d-9e56-15e3bd43511b"
The / partition PARTUUID will be used in the kernel configuration in the form root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b . Keep it handy. Reconfigure and rebuild the kernel enabling:
Quote:
General setup
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y

-*- Enable the block layer --->
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
[*] EFI GUID Partition support

Processor type and features --->
[*] EFI runtime service support
[*] EFI stub support
[*] EFI mixed-mode support
[*] Built-in kernel command line
(root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b ro) Built-in kernel command string EXAMPLE USE CORRECT PARTUUID FOUND WITH BLKID
[*] Built-in command line overrides boot loader arguments

Firmware Drivers --->
<*> EFI Variable Support via sysfs

Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices --->
[*] EFI-based Framebuffer Support

File systems --->
Pseudo filesystems --->
-*- /proc file system support
[*] /proc/kcore support
[*] Tmpfs virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
-*- Tmpfs extended attributes
[*] HugeTLB file system support
<*> Userspace-driven configuration filesystem
Use efibootmgr to make rEFInd the bootmanager. Use the ESP on the windows disk, more than one ESP tends to confuse UEFI/BIOS's.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Apr 18, 2016 5:35 pm    Post subject: Reply with quote

Quote:
To use rEFInd or efibootmgr as boot manager you need to install a boot loader.

For me rEFInd acts as boot loader, it can append to kernel command line and gives a choice of bootable kernels at boot time, what else you want from a boot loader?
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 5:44 pm    Post subject: Reply with quote

neoptslap wrote:
nelsonwcf,

nelsonwcf wrote:
nelsonwcf wrote:
Thanks for taking time answering my questions. Maybe my questions were a bit confusing so a quick background may be useful here.
...
currently, each time my computer boots, it switches between the boot-loader from 7 and 10).
...
Windows 10 in EFI and Linux in BIOS
...
use grub2 instead, booting directly from EFI instead bypassing rEFInd

--- topic 1030000 ---
The Doctor wrote:
As Neddy says, Gentoo is really like eating an elephant. Best do it one plate at a time. Following the nonstandard instructions might be okay, but it might not. Adding 10-20 "nonstandard" options increases the complexity quite a bit.


If you juggle with multiple tools I couldn't help you. :roll:


The reason I'm juggling with multiple tools is because the conventional methods (as the ones documented in the handbook) are not working for me. Instead of waiting the silver bullet, I'm trying to use different approaches to solve the problem.


Quote:
Does your computer have an UEFI or BIOS firmware ?

BIOS and UEFI are two different techonologies.

nelsonwcf wrote:
Bottom line: assuming Linux works under EFI bootloader, I'm doing something wrong. I know the theory behind it but how the EFI boot stack model is implemented in linux is what is eluding me. I know that I have to point the EFI bootloader to the kernel and have it set all the environment up using command strings but I don't know where the problem is right now because the kernel simply doesn't boot and panic. It's not something exclusive for Gentoo but something from linux boot method itself. Maybe I'm just missing some file in EFI/boot? Currently it has only the kernel bzImage renamed to .efi. Or maybe it's some option in kernel 4 that is not compatible with kernel 3 and by using the .config from the livecd is crashing the boot?


-- Some feedbacks

UEFI is a standard. There are several implementations of this standard. These implementations are firmwares.
Most new computers have a firmware based on UEFI.
Linux kernel developers try to make a kernel that works with this standard.
Linux is a kernel and Linux developers don't work with the "UEFI" firmware because they "play" with firmware 's interface based on the UEFI specification.
The "UEFI" firmware may be open source or proprietary but it's not a Linux 's implementation.




I'm already familiar. My apologies if I gave the impression I was criticizing the developers, which is definitely not the case.

Quote:

nelsonwcf wrote:
... I don't know where the problem is right now because the kernel simply doesn't boot and panic. ...


If your kernel "panic" so It boots !



Yes, but that was stated on my first post. The problem still persists.

Quote:


nelsonwcf wrote:
... Maybe I'm just missing some file in EFI/boot?
... I don't know if it's any portion of the options I'm doing wrong. ...


So, read again the Gentoo handbook, Gentoo wiki pages ...



Keeping reading something again and again is pointless if you don't know what to look for. BTW, Am I giving you the impression I'm not doing my homework?

Quote:


  • Only for "UEFI" firmware :

You may use Windows 's boot loader or another boot loader, or EFI Stub kernel. efibootmgr add Gentoo as menu entry in the "UEFI" firmware.
nelsonwcf wrote:
As you can imagine, I've been trying using efibootmgr and it's current structure is:
...

During the boot process, either, you choose a bootloader and load an operating system with it, either, you "enter in" the "UEFI" firmware and choose
an operating system to load.



Correct, and both options are making my kernel panic with the same message.

Quote:


Best regards,

neoptslap


neoptlap, I believe you may be misunderstanding my issues since you are explaining very basic things to me that I already got covered. I'm trying to figure out what is not working for me that is not covered by the guides - the gap between theoretical knowledge and practical application of it.

Best,
Nelson
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 5:49 pm    Post subject: Reply with quote

DONAHUE wrote:
https://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 also works with windows 10 and is worth a look.
To use rEFInd or efibootmgr as boot manager you need to install a boot loader.
The lowest maintenance combination is rEFInd with efi stub kernels.
By default rEFInd finds efi stub kernels on GPT labeled disk partitions formatted with file systems ext2fs, ext3fs, ext4fs, reiserfs, btrfs, ISO-9660, HFS+, or NTFS.
I build and save a new kernel using "make && make modules_install && make install". At my next boot rEFInd's menu will show all the efi stub kernel's in /boot (sometimes elsewhere). The only maintenance required is deleting unneeded kernels.
You should be able to use gdisk to convert the msdos labeled disk to GPT saving your existing gentoo installation. Assuming win 10 is on /dev/sda and gentoo on /dev/sdb: boot sisresccd in UEFI mode, run "gdisk /dev/sdb" and agree to conversion. Enter the chroot. Run blkid:
EXAMPLE RETURN: /dev/sda7: UUID="1f43e373-f923-4ec2-a62e-6a0d98927583" TYPE="swap" PARTLABEL="Linux filesystem" PARTUUID="92d3d504-9e7e-4c3d-9e56-15e3bd43511b"
The / partition PARTUUID will be used in the kernel configuration in the form root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b . Keep it handy. Reconfigure and rebuild the kernel enabling:
Quote:
General setup
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_RD_BZIP2=y
CONFIG_RD_LZMA=y
CONFIG_RD_XZ=y
CONFIG_RD_LZO=y
CONFIG_RD_LZ4=y

-*- Enable the block layer --->
Partition Types --->
[*] PC BIOS (MSDOS partition tables) support
[*] EFI GUID Partition support

Processor type and features --->
[*] EFI runtime service support
[*] EFI stub support
[*] EFI mixed-mode support
[*] Built-in kernel command line
(root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b ro) Built-in kernel command string EXAMPLE USE CORRECT PARTUUID FOUND WITH BLKID
[*] Built-in command line overrides boot loader arguments

Firmware Drivers --->
<*> EFI Variable Support via sysfs

Device Drivers --->
Graphics support --->
<*> Support for frame buffer devices --->
[*] EFI-based Framebuffer Support

File systems --->
Pseudo filesystems --->
-*- /proc file system support
[*] /proc/kcore support
[*] Tmpfs virtual memory file system support (former shm fs)
[*] Tmpfs POSIX Access Control Lists
-*- Tmpfs extended attributes
[*] HugeTLB file system support
<*> Userspace-driven configuration filesystem
Use efibootmgr to make rEFInd the bootmanager. Use the ESP on the windows disk, more than one ESP tends to confuse UEFI/BIOS's.


That is in fact, the guide I've used the most and the one that was the closest to my issue. However, I'm still doing something wrong because it doesn't work.

I agree with Buffoon in this case, rEFInd acts as boot manager which is also a boot loader. It works just as Lilo or Grub2, you can even put command parameters there.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Apr 18, 2016 6:04 pm    Post subject: Reply with quote

As stated before your kernel is loaded and boots, so it is not a boot loader issue. This is my working UEFI Stub Kernel .config, you can use wgetpaste to post yours. https://bpaste.net/show/950c628f766e

Important ones should be covered below.

Code:
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="root=/dev/sda2 net.ifnames=0"
# CONFIG_CMDLINE_OVERRIDE is not set
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
# CONFIG_EFI_MIXED is not set
CONFIG_FB_EFI=y
CONFIG_EFI_VARS=y
CONFIG_EFI_ESRT=y
CONFIG_EFI_VARS_PSTORE=y
# CONFIG_EFI_VARS_PSTORE_DEFAULT_DISABLE is not set
# CONFIG_EFI_FAKE_MEMMAP is not set
CONFIG_EFI_RUNTIME_WRAPPERS=y
CONFIG_UEFI_CPER=y
CONFIG_EFIVAR_FS=m
Back to top
View user's profile Send private message
nelsonwcf
Tux's lil' helper
Tux's lil' helper


Joined: 31 Oct 2012
Posts: 112

PostPosted: Mon Apr 18, 2016 6:11 pm    Post subject: Reply with quote

Buffoon wrote:
As stated before your kernel is loaded and boots, so it is not a boot loader issue. This is my working UEFI Stub Kernel .config, you can use wgetpaste to post yours. https://bpaste.net/show/950c628f766e


Shouldn't your CONFIG_CMDLINE = root=PARTUID=.... instead of /dev/sdax? You have GPT partition under EFI, right?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43595
Location: 56N 3W

PostPosted: Mon Apr 18, 2016 6:20 pm    Post subject: Reply with quote

nelsonwcf,

Both work. The unaided kernel can use PARTUUID or /dev/ but not UUID.

UUID is a property of a filesystem. To use UUID to mount root, the userspace mount utility must be used.
That requires an initrd, since mount is on the root filesystem and which cannot be read until root is mounted.
The initrd is a cut down root filesystem that contains all the things needed to mount the real root filesystem.
Originally, it was an ext2 filesystem in a compressed file. Now its a cpio archive of cpio archives.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
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
Goto page 1, 2  Next
Page 1 of 2

 
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