Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub wont auto boot to BTRFS drive
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
finalturismo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2020
Posts: 84

PostPosted: Wed Jan 08, 2020 5:09 pm    Post subject: [SOLVED] Grub wont auto boot to BTRFS drive Reply with quote

So i cant get grub or EFI stub file to boot BTRFS for some reason. (automatically)

/dev/nvme0n1 and /dev/nvme1n1 are both a partition-less BTRFS raid 0 filesystem

boot is on /dev/sda1

swap is on /dev/sda2

all files from genkernel are in /boot partition

fstab entries are correct uuids

Grub boots but than states that it cant mount root partition.

I did not make sub volumes on BTRFS (don't think its needed)

The UUID is the same for both /dev/nvme0n1 and /dev/nvme1n1


If i try booting with EFI stub i get the following
Code:
VFS: Unable to mount root fs on unknown-block(0,0)





When trying to boot gentoo on Grub i get the following
Code:

mount: mouting /dev/nvme1n1 on /newroot failed: invalid argument (why does it says /newroot? i have /  set in fstab)
could not mount specified ROOT!
Block device /dev/nvme0n1 is not a valid root device
Could not find the root block device in /dev/nvme1n1     (This is not what i have set in fstab i have the UUID of both drives and have tried /dev/nvme0n1  as well)


If i type /dev/nvme0n1 at prompt it boots, its like my fstab file is being ignored?


Last edited by finalturismo on Thu Jan 09, 2020 7:38 am; edited 2 times in total
Back to top
View user's profile Send private message
grknight
Developer
Developer


Joined: 20 Feb 2015
Posts: 16

PostPosted: Wed Jan 08, 2020 6:22 pm    Post subject: Reply with quote

Quote:
If i type /dev/nvme0n1 at prompt it boots, its like my fstab file is being ignored?


Exactly. fstab is *not* involved in the startup process.
The kernel and most initramfs only use the root= parameter.
If root= is a UUID, then an initramfs is required.

Also note that NVMe devices can be added asynchronously. So a delay parameter may be necessary (like rootdelay=2 with no initramfs, scandelay=2 for genkernel, dracut retries by default after 30s)
Back to top
View user's profile Send private message
grknight
Developer
Developer


Joined: 20 Feb 2015
Posts: 16

PostPosted: Wed Jan 08, 2020 6:23 pm    Post subject: Reply with quote

grknight wrote:

Exactly. fstab is *not* involved in the startup process.

I should say in the root discovery process
Back to top
View user's profile Send private message
finalturismo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2020
Posts: 84

PostPosted: Wed Jan 08, 2020 6:23 pm    Post subject: Reply with quote

grknight wrote:
Quote:
If i type /dev/nvme0n1 at prompt it boots, its like my fstab file is being ignored?


Exactly. fstab is *not* involved in the startup process.
The kernel and most initramfs only use the root= parameter.
If root= is a UUID, then an initramfs is required.

Also note that NVMe devices can be added asynchronously. So a delay parameter may be necessary (like rootdelay=2 with no initramfs, scandelay=2 for genkernel, dracut retries by default after 30s)


I have an initramfs how do input the UUID to initramfs?

I only have this issue with btrfs unless there was a problem with kernel 5.4.8 and this issue.

ive done multiple Gentoo installs, havnt had this issue before.



This is my grub.cfg file
Code:
 if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod btrfs
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root   be69a900-186c-4671-8e0e-1ad52d5e4ef8
else
  search --no-floppy --fs-uuid --set=root be69a900-186c-4671-8e0e-1ad52d5e4ef8
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
fi
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
Back to top
View user's profile Send private message
grknight
Developer
Developer


Joined: 20 Feb 2015
Posts: 16

PostPosted: Wed Jan 08, 2020 6:37 pm    Post subject: Reply with quote

finalturismo wrote:
grknight wrote:
Quote:
If i type /dev/nvme0n1 at prompt it boots, its like my fstab file is being ignored?


Exactly. fstab is *not* involved in the startup process.
The kernel and most initramfs only use the root= parameter.
If root= is a UUID, then an initramfs is required.

Also note that NVMe devices can be added asynchronously. So a delay parameter may be necessary (like rootdelay=2 with no initramfs, scandelay=2 for genkernel, dracut retries by default after 30s)


I have an initramfs how do input the UUID to initramfs?

I only have this issue with btrfs unless there was a problem with kernel 5.4.8 and this issue.

ive done multiple Gentoo installs, havnt had this issue before.


You put the UUID on the kernel command-line line
Code:
root=UUID={UUID value}


Which initramfs is this? If it is genkernel, then the dobtrfs kernel parameter is necessary in the kernel command line and also the --btrfs switch is required to build genkernel's initramfs.
Back to top
View user's profile Send private message
finalturismo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2020
Posts: 84

PostPosted: Wed Jan 08, 2020 6:45 pm    Post subject: Reply with quote

grknight wrote:
finalturismo wrote:
grknight wrote:
Quote:
If i type /dev/nvme0n1 at prompt it boots, its like my fstab file is being ignored?


Exactly. fstab is *not* involved in the startup process.
The kernel and most initramfs only use the root= parameter.
If root= is a UUID, then an initramfs is required.

Also note that NVMe devices can be added asynchronously. So a delay parameter may be necessary (like rootdelay=2 with no initramfs, scandelay=2 for genkernel, dracut retries by default after 30s)


I have an initramfs how do input the UUID to initramfs?

I only have this issue with btrfs unless there was a problem with kernel 5.4.8 and this issue.

ive done multiple Gentoo installs, havnt had this issue before.


You put the UUID on the kernel command-line line
Code:
root=UUID={UUID value}


Which initramfs is this? If it is genkernel, then the dobtrfs kernel parameter is necessary in the kernel command line and also the --btrfs switch is required to build genkernel's initramfs.


Yes it was genkernel, can you give me a little more detail on how to put this in the kernel command line? :)

Also genkernel builds the initramfs for me by default.
Back to top
View user's profile Send private message
grknight
Developer
Developer


Joined: 20 Feb 2015
Posts: 16

PostPosted: Wed Jan 08, 2020 6:49 pm    Post subject: Reply with quote

finalturismo wrote:
grknight wrote:


You put the UUID on the kernel command-line line
Code:
root=UUID={UUID value}


Which initramfs is this? If it is genkernel, then the dobtrfs kernel parameter is necessary in the kernel command line and also the --btrfs switch is required to build genkernel's initramfs.


Yes it was genkernel, can you give me a little more detail on how to put this in the kernel command line? :)


In grub, it goes on the end of the 'linux' line. With a stub, you have to bake it in via CONFIG_CMDLINE
Back to top
View user's profile Send private message
finalturismo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2020
Posts: 84

PostPosted: Wed Jan 08, 2020 7:57 pm    Post subject: Reply with quote

grknight wrote:
finalturismo wrote:
grknight wrote:


You put the UUID on the kernel command-line line
Code:
root=UUID={UUID value}


Which initramfs is this? If it is genkernel, then the dobtrfs kernel parameter is necessary in the kernel command line and also the --btrfs switch is required to build genkernel's initramfs.


Yes it was genkernel, can you give me a little more detail on how to put this in the kernel command line? :)


In grub, it goes on the end of the 'linux' line. With a stub, you have to bake it in via CONFIG_CMDLINE


The kernel is building with the --btrfs right now so lets see what happens.
'



is this in the grub.cfg file or the grub default file? because the root fs uuid is already in that file.

or are you talking about the genkernel config file?
Back to top
View user's profile Send private message
finalturismo
Tux's lil' helper
Tux's lil' helper


Joined: 06 Jan 2020
Posts: 84

PostPosted: Thu Jan 09, 2020 7:37 am    Post subject: Reply with quote

finalturismo wrote:
grknight wrote:
finalturismo wrote:
grknight wrote:


You put the UUID on the kernel command-line line
Code:
root=UUID={UUID value}


Which initramfs is this? If it is genkernel, then the dobtrfs kernel parameter is necessary in the kernel command line and also the --btrfs switch is required to build genkernel's initramfs.


Yes it was genkernel, can you give me a little more detail on how to put this in the kernel command line? :)


In grub, it goes on the end of the 'linux' line. With a stub, you have to bake it in via CONFIG_CMDLINE


The kernel is building with the --btrfs right now so lets see what happens.
'



is this in the grub.cfg file or the grub default file? because the root fs uuid is already in that file.

or are you talking about the genkernel config file?



Solved by doing the following


Added --btrfs to genkernel command line
1.
Code:
genkernel all -btrfs



added kernel parameter to /etc/grub/default
2.
Code:
GRUB_CMDLINE_LINUX="dobtrfs"



For users wondering the performance is amazing.

Had to install Gentoo to my portable drive, emerge btrfs 5.4, chroot into it and than use mkfs.btrfs. This way the drives were partitioned with the newest version of btrfs :)
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