# [SOLVED] gentoo-kernel 4.9.6-r1 does not find root on nvme

## knob-creek

I just tried to update the kernel from 4.8.17 to 4.9.6-r1.

The new kernel does not boot from a NVMe SSD, although all relevant kernel configuration is unchanged since 4.8.17.  The root fs is btrfs.

Neither root=/dev/nvme0n1p7 nor root=UUID=12345678-... works, the kernel panics because it did not find the root filesystem.  It then prints a list of found partitions, one of which is nvme0n1p7.

With 4.8.17, i boot with the root=/dev/nvme0n1p7 parameter.

The boot manager is grub 2.

# grep NVME .config

CONFIG_NVME_CORE=y

CONFIG_BLK_DEV_NVME=y

# CONFIG_BLK_DEV_NVME_SCSI is not set

# CONFIG_NVME_TARGET is not set

 # grep BTRFS .config

CONFIG_BTRFS_FS=y

# CONFIG_BTRFS_FS_POSIX_ACL is not set

# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set

# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set

# CONFIG_BTRFS_DEBUG is not set

# CONFIG_BTRFS_ASSERT is not setLast edited by knob-creek on Thu Feb 16, 2017 1:31 pm; edited 1 time in total

----------

## NeddySeagoon

knob-creek,

Try adding rootwait to the kernel command line.

It looks like the kernel tries to mount root before the device is ready.

----------

## knob-creek

Thank you for your quick response.

However, i doubt that this is the problem.  There is lots of other HW initialized (USB etc.) until the kernel reaches the point where root should be mounted.  (The kernel is rather monolithic and i don't have an initrd).  With 4.8.17, the time was roughly the same and it was sufficient.

I will try it anyway.

----------

## NeddySeagoon

knob-creek,

root=UUID=12345678... requires an initrd.  The kernel does not understand UUID.

PARTUID, which is a different string altogether wirr be understood by the kernel.

If the block device isn't ready, it won't help.

----------

## knob-creek

Thank you.  I usually don't use the UUID syntax, ubuntu uses it and i wanted to give it a try, in case device names have changed.

With rootwait there is no change.  The kernel does not seem to know which driver to use for the nvme drive (it seem to recognize it somehow but it writes (driver?) to the console).

The next message is "could not create /dev/nvme0n1p7".

----------

## NeddySeagoon

knob-creek,

With rootwait, the boot process should hang forever if the root device never becomes available.

It will not panic.

If you prefer a pause before the panic, use rootdelay=30 in place of rootwait.

Thats a 30 second wait for the root device, then carry on and panic if its not there.

Its odd that the kernel lists /dev/nvme0n1p7 in available devices.

What is the text of the panic message ... unknown-block(x,y)

What are x and y?

----------

## knob-creek

Well, "wait forever" was my expectation, too.

It sais "cannot create /dev/nvme0n1p7 error -2"

And "unable to ... root ... on nvme0n1p7 or unknown block device (259,7)

(I should start using a different machine for posting my problem description here... ;-)

----------

## NeddySeagoon

knob-creek,

```
unknown block device (259,7)
```

Is the kernel major,minor device number.

The kernel can see the device, or you get (0,0).

It means that it can't read the information on the device.

There are two popular reasons:-

The partition table code is missing from the kernel.

The filesystem code is missing from the kernel.

----------

## knob-creek

This machine has a GPT partitioned SSD and is booted via UEFI.

CONFIG_EFI_PARTITION=y

(and the kernel shows a correct list of partitions just as it panics and (259, 7) seems to indicate that it knows where to look at.)

As i wrote in the beginning, the root fs is btrfs and

CONFIG_BTRFS_FS=y

These settings have not changed since 4.8.17.

I suspect, my kernel refuses to read the root fs for a not so popular reason.  Is there anything special since 4.9 regarding booting from btrfs?

----------

## knob-creek

The problem was unrelated to NVME or BTRFS, cf. this follow up.

----------

