Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Grub can't find root device with F2FS filesystem [SOLVED]
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
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Sun May 14, 2017 2:53 pm    Post subject: Grub can't find root device with F2FS filesystem [SOLVED] Reply with quote

I'm building a new pc with an M2 root drive using the F2FS file system for root. When I try and boot, the process halts with the message:
Quote:
/dev/sda3 is an invalid root device
Could not find the root block device ...


fdisk -l produces:
Code:
Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 8DA04DB9-EAB4-4D3F-85DE-2CEDB82BB84E

Device      Start       End   Sectors   Size Type
/dev/sda1    2048      6143      4096     2M BIOS boot
/dev/sda2    6144    268287    262144   128M EFI System
/dev/sda3  268288 500117503 499849216 238.4G Linux filesystem


parted -l /dev/sda produces:
Code:
Model: ATA SAMSUNG MZHPV256 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3146kB  2097kB               grub  bios_grub
 2      3146kB  137MB   134MB   fat32        boot  boot, esp
 3      137MB   256GB   256GB                root


Warning: The driver descriptor says the physical block size is 2048 bytes, but
Linux says it is 512 bytes.


grep F2FS .config for the booting kernel produces:
Code:
CONFIG_F2FS_FS=y
CONFIG_F2FS_FS_XATTR=y
CONFIG_F2FS_FS_POSIX_ACL=y
CONFIG_F2FS_FS_SECURITY=y
CONFIG_F2FS_CHECK_FS=y
CONFIG_F2FS_FS_ENCRYPTION=y
CONFIG_F2FS_FAULT_INJECTION=y


/etc/default/grub includes the line:
Code:
GRUB_CMDLINE_LINUX="rootfstype=f2fs /usr/lib/systemd/systemd"

When I hit e in grub to edit the command line, it definitely includes the rootfstype=f2fs.

Thanks in advance for your help!


Last edited by Skinjob2707 on Fri May 19, 2017 6:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun May 14, 2017 4:17 pm    Post subject: Reply with quote

Skinjob2707,

Your kernel may not see an M2 drive as /dev/sd*.

Depending on the interface on the M2 drive and your kernel setup, it may be /dev/nvme...
Putting an M2 drive onto a SATA interface is like keeping a Ferrari just to drive to the corner shop.

Exactly what model of M2 drive do you have, so we can check the interface?
Pastebin your kernel .config file.

There is more useful information following the
Code:
Could not find the root block device ...

The kernel will list all the block devices it can see.
If it shows
Code:
Could not find the root block device in .
then the list of block devices is empty.
That's useful information too.
_________________
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
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Sun May 14, 2017 5:08 pm    Post subject: Reply with quote

Here is my config:
https://pastebin.com/qzkq4c4G

The M2 drive is specifically supposed to support the AHCI interface and plugs into a M2 specific slot. It works fine when addressed from the Gentoo Live CD (e.g. format, mount, copying, etc) as /dev/sda. The only time it has a problem is when GRUB tries to deal with it as root.

Apparently Grub 2.02 doesn't support f2fs root natively but requires a patch. Here is the patch in the mailing list: http://lists.gnu.org/archive/html/grub-devel/2016-03/msg00080.html . Here is the patch integrated into Arch's build: https://aur.archlinux.org/packages/grub-f2fs/ I've grepped both the Gentoo source package from distfiles and the files under /usr/portage/sys-fs/grub and none contain any mention of the f2fs file system. This leads me to conclude that the Gentoo grub does not currently support f2fs root devices.

How difficult would it be to get the Arch patch to work under Gentoo?

Thanks for your help!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun May 14, 2017 9:59 pm    Post subject: Reply with quote

Skinjob2707,

That looks like a hand crafted kernel. Genkernel, has a lot more modules.
Code:
CONFIG_ATA=m
CONFIG_SATA_AHCI=m
could be a problem unless you have an initrd.

With no initrd, the kernel must be able to mount root with no outside help.
Modules go on the root filesystem, so needing a module from the root filesystem, to mount the root filesystem, to read the module is an issue.
I suspect that you need those modules built in.

Grub only needs to read the boot filesystem, not root. If that's its own partition, it need not be f2fs.
If that patch has been accepted upstream, it will be in the live (9999) version, which takes the code from the upstream repository.
There is a bug in the patch you linked. There is a fix for it later in the thread.

The grub-2.02.ebuild conforms to EAPI 6, so its easy to try that patch (or both of them)
With EAPI 6, portage understands a tree of user provided patches in /etc/portage/patches/
If you make a directory /etc/portage/patches/sys-boot/grub-2.02 files ending in .patch will be applied to sys-boot/grub-2.02 when portage builds. it.
Patches are applied in lexical order of file names.
_________________
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
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Mon May 15, 2017 12:47 am    Post subject: Reply with quote

You were correct. I did use the genkernel command plus the menuconfig switch. I'm sorry if I used the wrong terminology.

Thanks for your help!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon May 15, 2017 9:52 am    Post subject: Reply with quote

Skinjob2707,

The genkernel command with the menuconfig switch is mostly harmless as long as you use the initrd too.
If your problem is not fixed, please post the output of
Code:
lspci -nn
so we can see your hardware.

If the error has changed, let us know the new error message.
_________________
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
Skinjob2707
n00b
n00b


Joined: 07 Aug 2013
Posts: 57

PostPosted: Wed May 17, 2017 3:41 pm    Post subject: Reply with quote

Your advice resolved the issue for me. Thanks for your help!
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3686
Location: Hamburg

PostPosted: Wed May 17, 2017 4:35 pm    Post subject: Reply with quote

Skinjob2707 wrote:
Your advice resolved the issue for me. Thanks for your help!
urw, now pls put a [solved] in front of the topic ;)
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