Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with automount root device in gentoo
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
nicklan
n00b
n00b


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sat Mar 29, 2014 9:43 pm    Post subject: Problem with automount root device in gentoo Reply with quote

I have problem with booting my gentoo.
    My partitions:
    /dev/sda1 - Linux swap
    /dev/sda2 - my Linux root partition (Linux filesystem)
    /dev/sda3 - EFI System (grub2 and my kernel)

To sda3 i have applied command
Code:
mkdosfs -F 32 -n efi-boot /dev/sda3
because grub2 can boot UEFI system only with FAT partition.

I have compile my kernel, then copy to /dev/sda3. Then
Code:
grub2-mkconfig -o /boot/grub/grub.cfg
After restarting my system, i have problem. Look this screen! (http://goo.gl/PPG0Yv) (Cannot open root device «null» or ...)

But when i create initramfs and copied to sda3, i need to enter my root partition manually. (http://goo.gl/cD9inL)

    Could not find the root block device in .
    root block device() :: /dev/sda2


How i can solve my problem? I need to boot my system without initramfs or without manually write my root partition (/dev/sda2).
P.S. My kernel version is 3.12.13, my system is UEFI only (without CSM support)


Last edited by nicklan on Sun Mar 30, 2014 10:34 am; edited 4 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat Mar 29, 2014 10:20 pm    Post subject: Reply with quote

nicklan,

Welcome to Gentoo.
Code:
unknown-block(0,0)
in your error tells that the grub loaded the kernel, the kernel initialised but when it went looking for its root partition, it could not communicate with the hard drive at all.
This is usually because you have left something out of your kernel.

To give more specific advice we need to know
a) what sort of partition table you have
b) the output of the lspci command
c) the filesystem you are using on /dev/sda2 (your root)

--- edit ---

There should be a complete list of partitions that the kernel can see following the text
Code:
 here are a complete list of partitions:
in your case, the list is empty.
_________________
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
nicklan
n00b
n00b


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sat Mar 29, 2014 11:30 pm    Post subject: Reply with quote

Thanks for reply!

a) no sort. My all 3 GPT partitions are sorted. (sda1, sda2, sda3) (I didn't change patition numbers)
b) lspci:
Code:
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1c.3 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 4 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM77 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 3D controller: NVIDIA Corporation Device 1292 (rev a1)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)
04:00.0 Network controller: Broadcom Corporation BCM43228 802.11a/b/g/n
05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168 PCI Express Gigabit Ethernet controller (rev 07)

c) My Partition types:
Code:
/dev/sda2 on /mnt/gentoo type ext4 (rw)
/dev/sda3 on /mnt/gentoo/boot type vfat (rw)

My fstab:
Code:
/dev/sda3               /boot           ext2            defaults,noatime       $
/dev/sda2               /               ext4            noatime         0 1
/dev/sda1               none            swap            sw              0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0



Quote:
This is usually because you have left something out of your kernel.

So many times i recompiled my kernel with different options. Last time i use genkernel all.

Thanks.

P.S. I have tried rEFInd, but my system won't boot at all. It stucks, when booting my gentoo. (Like this screen).
I have asked this questions in other forums, like unix.stackexchange.com, refind official discussion, stackoverflow.com and on linux.org.ru, but i haven't got answers...
You are is my last chance.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Mar 30, 2014 2:17 am    Post subject: Reply with quote

what install cd are you using?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2483
Location: Silver City, NM

PostPosted: Sun Mar 30, 2014 5:23 am    Post subject: Reply with quote

@nicklan, unless you are using an initrd (initramfs), you will need to have all the drivers necessary for mounting /dev/sda2 built into your kernel. It is hard for me to understand what you are saying but if you can get it to work with an initramfs, even for testing, then have the /init script in the initramfs save the output of lsmod and this will tell you the drivers that need to be compiled into the kernel.
Back to top
View user's profile Send private message
nicklan
n00b
n00b


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sun Mar 30, 2014 6:57 am    Post subject: Reply with quote

DONAHUE wrote:
what install cd are you using?

I use SystemRescueCD, because gentoo minimal cd doesn't support UEFI.

Quote:
@nicklan, unless you are using an initrd (initramfs), you will need to have all the drivers necessary for mounting /dev/sda2 built into your kernel. It is hard for me to understand what you are saying but if you can get it to work with an initramfs, even for testing, then have the /init script in the initramfs save the output of lsmod and this will tell you the drivers that need to be compiled into the kernel.

With initrd (initramfs), I need to write my root device manually, then my system starts. (I need to manually type /dev/sda2 to boot my system)
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2483
Location: Silver City, NM

PostPosted: Sun Mar 30, 2014 7:26 am    Post subject: Reply with quote

[quote="nicklan"]
DONAHUE wrote:
With initrd (initramfs), I need to write my root device manually, then my system starts. (I need to manually type /dev/sda2 to boot my system)

If you want to boot without the initramfs then you need to make sure that any modules that were loaded by the initramfs get compiled into the kernel.

It might be easier to modify the initramfs so that you don't have to type in "dev/sda2" to get it to boot. There might be standard tools to modify the initramfs. I don't know about those because I always do it by hand.

This is how I do it by hand but I don't know for sure if this will work for your initramfs. I unpack an initramfs with:
Code:
mkdir initramfs
cd initramfs
gunzip -c ../initramfs-3 | sudo cpio -idum

I then pack it back up again with:
Code:
find . | cpio -o -H newc | gzip -9 > ../initramfs-4

There will probably be a script named "init" that you will want to modify so it automatically boots /dev/sda2.
Back to top
View user's profile Send private message
nicklan
n00b
n00b


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sun Mar 30, 2014 7:42 am    Post subject: Reply with quote

BitJam wrote:
Code:
mkdir initramfs
cd initramfs
gunzip -c ../initramfs-3 | sudo cpio -idum


Code:
gzip: /mnt/gentoo/boot/initramfs-genkernel-3.12.13: not in gzip format
cpio: premature end of archive

P.S. Screen, when i boot with initrd: (goo.gl/cD9inL)
Back to top
View user's profile Send private message
nicklan
n00b
n00b


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sun Mar 30, 2014 10:15 am    Post subject: Reply with quote

Quote:
This is usually because you have left something out of your kernel.

I have recompiled my kernel with mostly options in device drivers. Now my gentoo is correctly see a partitions:
http://goo.gl/PPG0Yv
But i still have got that problem.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3948
Location: Dallas area

PostPosted: Sun Mar 30, 2014 11:16 am    Post subject: Reply with quote

post your grub config file
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Mar 30, 2014 12:16 pm    Post subject: Reply with quote

nicklan,

You need the following items set as <*> in
Code:
make menuconfig


Code:
[*] Advanced partition selection
[*]   EFI GUID Partition support
<*> SCSI disk support
<*> Serial ATA and Parallel ATA drivers  --->
[*]   ATA ACPI Support
<*>   Platform AHCI SATA support
<*>   AHCI SATA support


That should fix your unknown-block(0,0) error but check
Code:
<*> The Extended 4 (ext4) filesystem
too, as its not much use to read the disk, then not being able to read the filesystem.

Rebuild and reinstall your kernel.
<M> won't work for you as you want to boot without an 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
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Mar 30, 2014 12:17 pm    Post subject: Reply with quote

rEFInd is a bootmanager (and a great one) not a boot loader.
you need a bootloader
IMHO the best option for bootloader is efi stub kernel
genkernel all will not make an efi stub kernel
genkernel --menuconfig all can be used to configure an efi stub kernel

as in:
Quote:
Kernel configuration:[edit]
Use either "7.b. Default: Manual Configuration" or "7.c. Alternative: Using genkernel" but start genkernel with 'genkernel --menuconfig all' vice just 'genkernel all'. The kernel name produced by genkernel in /boot will start with kernel- ; as rEFInd looks for vmlinuz or bzImage as the first word in linux kernel names, either replace or prepend kernel- with vmlinuz- or bzImage- in /boot. In addition to the items specified in the handbook or set by genkernel, enable the following:
In menuconfig:

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
[*] 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

If an initramfs is to be used, add an initrd="/boot/<your initramfs name>" to the kernel configuration item "CONFIG_CMDLINE" as in the following example:
Processor type and features --->
[*] Built-in kernel command line
(initrd=/boot/initramfs 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
If systemd is to be used, add "init=/usr/lib/systemd/systemd" to the kernel configuration item "CONFIG_CMDLINE" as in the following example:
Processor type and features --->
[*] Built-in kernel command line
(root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b ro init=/usr/lib/systemd/systemd quiet) Built-in kernel command string EXAMPLE USE CORRECT PARTUUID FOUND WITH BLKID
[*] Built-in command line overrides boot loader arguments
If systemd and an initramfs are to be used; example:
Processor type and features --->
[*] Built-in kernel command line
(initrd=/boot/initramfs root=PARTUUID=92d3d504-9e7e-4c3d-9e56-15e3bd43511b ro init=/usr/lib/systemd/systemd quiet) Built-in kernel command string EXAMPLE USE CORRECT PARTUUID FOUND WITH BLKID
[*] Built-in command line overrides boot loader arguments
Use make && make modules_install && make install to build a manual kernel. Finish the handbook. No need to emerge or install grub or lilo or grub2. REFInd will act as boot manager.

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


Joined: 29 Mar 2014
Posts: 6

PostPosted: Sun Mar 30, 2014 4:15 pm    Post subject: Reply with quote

NeddySeagoon, DONAHUE, thanks for answers, but all of that items is already setted as <*> and [ * ]. It didn't solve the problem.
My grub.cfg - pastebin. Again "Cannot open root device "(null)" or unknown-block(0,0): error -6".

But when i recompiled my kernel with same options, but with:
Code:
Built-in kernel command line
(root=PARTUUID=<This my PARTUUID of /dev/sda2> ro) Built-in kernel command string

It solve my problem! Now my gentoo boot correctly! Even without root option:
Code:
linux   /kernel-gentoo

I don't know why, but without Built-in kernel command line, my gentoo doesn't want to boot.

So, problem solved.

P.S. Grub2 is correctly boot my gentoo, but with rEFInd, i still have stack, when it booting my gentoo.
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