Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-mkconfig do not see initramfs rootfs in not a valid dev
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Sun Jan 06, 2019 1:34 pm    Post subject: grub-mkconfig do not see initramfs rootfs in not a valid dev Reply with quote

First I have running and booting system, I try to genkernel newer kernel I repeat steps from previous successful compilation and booting, but in the end I can boot new kernel / rootfs can't be mount:

I'm using LVM2 on top of RAID5 with 3HDD

1. got .confg from current running kernel 4.14.52-gentoo (and check with zcat /proc/config.gz > .config.running)
2. try compile 4.14.83-gentoo
3. run make oldconfig maually (diff is minimal 2-3 options)
4. genkernel --lvm --mdadm --microcode --install --menuconfig --kernname=variant07 --loglevel=3 --color all
5. compilation success
6. ls -la /boot/
Code:
drwxr-xr-x  6 root root     1024 Jan  5 15:50 grub
-rw-r--r--  1 root root  8155156 Jul 29 00:39 initramfs-genkernel-x86_64-4.14.52-gentoo
-rw-r--r--  1 root root 11815756 Jan  2 23:47 initramfs-variant05-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root 11112912 Jan  5 14:18 initramfs-variant06-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root 13255528 Jan  5 15:39 initramfs-variant07-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root  6132272 Jul 29 00:05 kernel-genkernel-x86_64-4.14.52-gentoo
-rw-r--r--  1 root root  3957200 Jan  2 23:23 kernel-variant05-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root  3588560 Jan  5 14:17 kernel-variant06-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root  6480448 Jan  5 15:02 kernel-variant07-x86_64-4.14.83-gentoo
drwx------  2 root root    12288 Jul 28 16:22 lost+found
-rw-r--r--  1 root root  3009193 Jul 29 00:05 System.map-genkernel-x86_64-4.14.52-gentoo
-rw-r--r--  1 root root  3037192 Jan  2 23:23 System.map-variant05-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root  2763365 Jan  5 14:17 System.map-variant06-x86_64-4.14.83-gentoo
-rw-r--r--  1 root root  3140653 Jan  5 15:02 System.map-variant07-x86_64-4.14.83-gentoo


And here is tricky part after rebooting kernel stops just after 1 or 2 sceens...
Code:
kernel panic not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

got me thinking initramfs??? and teh after 10 tries of compiing kernel I noticed ont thing

7. grub-mkconfig -o /boot/grub/grub.cfg
Code:
Generating grub configuration file ...
Found linux image: /boot/kernel-variant07-x86_64-4.14.83-gentoo
Found linux image: /boot/kernel-variant06-x86_64-4.14.83-gentoo
Found linux image: /boot/kernel-variant05-x86_64-4.14.83-gentoo
Found linux image: /boot/kernel-genkernel-x86_64-4.14.52-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.14.52-gentoo
done


See, grub-mkconfig do not see initramfs, so I've added manually to grub.cfg:
Code:
initrd  /initramfs-variant07-x86_64-4.14.83-gentoo


8. after rebooting is better but then got:
Code:
some modules are loading..
>> Scanning for and activating Volume Groups
Reading all phsical volumes. This may take a while...
>> Determining root device...
!! Block device /dev/mapper/vg01-rootfs in not a valid device...
!! Could not find the root block device in .
!! Please specify another values for:
!! - pres enter for the same
!! - type shell for a shell
!! - type q to skip


here is my /etc/defaults/grub:
Code:
GRUB_DISTRIBUTOR="Gentoo"
GRUB_TIMEOUT=5
GRUB_CMDLINE_LINUX_DEFAULT="dolvm domdadm rootfstype=ext4"
GRUB_DISABLE_SUBMENU=y


in /etc/genkernel I got:
Code:
INSTALL="yes"
OLDCONFIG="yes"
MENUCONFIG="yes"
GCONFIG="no"
NCONFIG="no"
XCONFIG="no"
CLEAN="no"
MRPROPER="no"
MOUNTBOOT="yes"
SAVE_CONFIG="yes"
USECOLOR="yes"
MAKEOPTS="$(portageq envvar MAKEOPTS)"
NICE=10
LVM="yes"
MICROCODE="yes"
MDADM="yes"
MDADM_CONFIG="/etc/mdadm.conf"
DISKLABEL="yes"
BOOTLOADER="grub2"
GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"
CACHE_DIR="/var/cache/genkernel"
DISTDIR="${GK_SHARE}/distfiles"
LOGFILE="/var/log/genkernel.log"
LOGLEVEL=3

# =========COMPILED UTILS CONFIGURATION============
#
# Default location of kernel source
DEFAULT_KERNEL_SOURCE="/usr/src/linux"



/etc/mdadm.conf
Code:
ARRAY /dev/md0 metadata=1.2 name=livecd:0 UUID=5a5b7bcb:b208c3fe:1b53ce5e:2d587893


/etc/fstab
Code:
# <fs>                  <mountpoint>    <type>  <opts>                  <dump/pass>
/dev/sda2               /boot           ext2    defaults,noatime        0 2
/dev/vg01/swap          none            swap    sw                      0 0
/dev/vg01/rootfs        /               ext4    noatime                 0 1
/dev/sr0                /mnt/cdrom      auto    noauto,user             0 0


Running kernel form grub.cfg
Code:
menuentry 'Gentoo GNU/Linux, with Linux x86_64-4.14.52-gentoo (recovery mode)' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-x86_64-4.14.52-gentoo-recovery-141f992c-a8ce-4fa2-8f40-602954b1e300' {
        load_video
        if [ "x$grub_platform" = xefi ]; then
                set gfxpayload=keep
        fi
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  b085fb37-5c2e-475a-81f8-6ab233b80981
        else
          search --no-floppy --fs-uuid --set=root b085fb37-5c2e-475a-81f8-6ab233b80981
        fi
        echo    'Loading Linux x86_64-4.14.52-gentoo ...'
        linux   /kernel-genkernel-x86_64-4.14.52-gentoo root=/dev/mapper/vg01-rootfs ro single
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-genkernel-x86_64-4.14.52-gentoo
}


not running
Code:
menuentry 'Gentoo GNU/Linux, with Linux variant07-x86_64-4.14.83-gentoo' --class gentoo --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-variant07-x86_64-4.14.83-gentoo-advanced-141f992c-a8ce-4fa2-8f40-602954b1e300' {
        load_video
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  b085fb37-5c2e-475a-81f8-6ab233b80981
        else
          search --no-floppy --fs-uuid --set=root b085fb37-5c2e-475a-81f8-6ab233b80981
        fi
        echo    'Loading Linux variant07-x86_64-4.14.83-gentoo ...'
        linux   /kernel-variant07-x86_64-4.14.83-gentoo root=/dev/mapper/vg01-rootfs ro  dolvm domdadm rootfstype=ext4
}


They are almost exactly the same (just initrd par is missing as I mention)

Any advice I'm tired since 2 weeks I try update my kernel
Back to top
View user's profile Send private message
ribx
Apprentice
Apprentice


Joined: 20 Nov 2003
Posts: 219
Location: germany

PostPosted: Mon Jan 07, 2019 12:31 am    Post subject: Reply with quote

mkconfig does not check for your initrd name:

see /etc/grub.d/10-linux
Code:
  for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
       "initrd-${version}" "initramfs-${version}.img" \
       "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
       "initrd-${alt_version}" "initramfs-${alt_version}.img" \
       "initramfs-genkernel-${version}" \
       "initramfs-genkernel-${alt_version}" \
       "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
       "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
...


anyway, it "should" work if you add the initrd line manually.

Please note: RAID5 is kind of obsolete with todays storage capabilities. Problem is, if you have a RAID5 and a disc crashes, the chances that another disc dies while making the restore is quite high (as every block will be read/write for calculation of parity, no matter if it has real data on it or not). Also you could loose performance with SSDs. A better way is to use a filesystem like btrfs or zfs and handle the mirroring of file on the filesystem layer. thats much more effective and if two discs die, you still have some files remaining on the last disc. You could do the raid stuff also in the lvm layer, but then again with btrfs you can even get rid of the lvm layer. (and get nice features like snapshoting too)
_________________
The adopt an unanswered post initiative
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Mon Jan 07, 2019 8:10 pm    Post subject: Reply with quote

yeah should... dont know what can I do more... how to fix it :(

regarding raid5 I just got spare 3hdd and just give a try... didn't know about it... I just return to gentoo after some years and I setup old desktop just for fun... so maybe I just start installing gentoo again from scrach... so what you recommend for 3 x 1TB HDD to get more then 1TB and get some mirroring.... I got found 64 GB SDD use it as bcache????
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Tue Jan 08, 2019 12:39 am    Post subject: Reply with quote

For a similar error this one says that that the initramfs should be constructed with udev modules, and you have to do it yourself by adding the udev hook to mkinitcpio.conf (and then mkinitcpio yourself, I presume -- I have never used genkernel!). So, try lsinitcpio -a /path/to/initramfs.

The post has another valuable suggestion: try mounting /dev/mapper/vg01-rootfs directly and see what happens.

This one (from 2012), specifically says that mounting LV devices with an initrd created by genkernel will fail as genkernel does not use the udev hook.

Edit: sanity check via this.

Edit 2: You can see the contents of the initrd by
Code:
cpio -idm --file initrd.img
Back to top
View user's profile Send private message
emc
Guru
Guru


Joined: 02 Jul 2004
Posts: 564
Location: Cracow, Poland

PostPosted: Wed Jan 09, 2019 5:57 pm    Post subject: Reply with quote

niku wrote:
For a similar error this one says that that the initramfs should be constructed with udev modules, and you have to do it yourself by adding the udev hook to mkinitcpio.conf (and then mkinitcpio yourself, I presume -- I have never used genkernel!). So, try lsinitcpio -a /path/to/initramfs.

The post has another valuable suggestion: try mounting /dev/mapper/vg01-rootfs directly and see what happens.

This one (from 2012), specifically says that mounting LV devices with an initrd created by genkernel will fail as genkernel does not use the udev hook.

Edit: sanity check via this.

Edit 2: You can see the contents of the initrd by
Code:
cpio -idm --file initrd.img

nice... mkinitcpio is nor officially supported... and make ebuild myself try to emerge and then and find out all the stuff with lvm/raid is not worth for me... to be honest... I will never have so much time.... to fix it. any way I need get my box up and running, (but so much to install mint) anyway I read more about btrfs on 3HDD... and make it more usable and maintainable. As I mention this desktop I just for fin to play with gentoo... again...
Back to top
View user's profile Send private message
niku
n00b
n00b


Joined: 23 Dec 2018
Posts: 38

PostPosted: Thu Jan 10, 2019 4:19 am    Post subject: Reply with quote

An alternative to genkernel/mkinitcpio would be Dracut. Also, making custom initramfs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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