Servers

Installing Ubuntu Linux on a PCIe NVMe drive


During my installation of Ubuntu 19.10 to a PCIe NVMe drive, you might run into a problem as soon as it starts copying data with an error like this:

Current device storage tree:
Shutdown Plan:
Error: Could not stat device /dev/disk/by-id/wwn-eui.0100000000000000 
Waiting on device path: /dev/disk/by-id/wwn-eui.0100000000000000
An error occured handling 'disk-nvme0n1': 
OSError - [Errno Failed to find device at path: %s]

Why is this happening?

The installer is trying to access the NVMe drive by its WWN (World Wide Name) but it can’t find the symlink for the drive.

WWN is a standardized way for storage drives to have the same ID regardless of the machine and often are used to address SAN resources (think like mac addresses on a network but for disks across the network on an iSCSI storage server). Something about the direct attachment of PCIe NVMe drives produces an issue with WWN ID generation. For “normal” SATA drives, the WWN looks like /dev/disk/by-id/wwn-0x5000c500a2a745c4 but if you see the WWN generated for our NVMe drive it is mostly zeros, /dev/disk/by-id/wwn-eui.0100000000000000.

While the NVMe drive is correctly loaded and accessible, ubuntu didn’t load the symlink for the questionable WWN ID that is auto generated for us.

The Solution

Before installation starts copying files, we need to jump to TTY2 console by pressing Windows key + F2 and mapping a symlink to the correct drive we want to install to (if you have more than one NVMe drive attached, make sure you are mapping the correct one with something like lsblk or unattach the drives you don’t want to install to).

cd /dev/disk/by-id/
sudo ln -s ../../nvme0n1 wwn-eui.0100000000000000
sudo ln -s ../../nvme0n1p1 wwn-eui.0100000000000000-part1
(there are 14 zeros after the 1)

Now we should be able to return to TTY1 (Windows key + F1) and finish the installation without getting an error.

openanalytics 7673 views

I'm a 35 year old UIUC Computer Engineer building mobile apps, websites and hardware integrations with an interest in 3D printing, biotechnology and Arduinos.


View Comments

This site uses Akismet to reduce spam. Learn how your comment data is processed.