OS on nvme

It seem that Xfce and Federa work on nvme. But I cannot find instructions to install OS on sdd.
I was able to install Ubuntu on nvme with:

        sudo mount /dev/nvme0n1p1 /mnt
        sudo chroot /mnt

   Use your favorite text editor to edit /etc/default/u-boot. Add the line


Can I safely use these instructions to install other OS on nvme ?

Any other OS working on nvme ?

This is a question I’ve been wondering about myself. I would be interested in booting the included freedom u sdk Linux to boot from nvme this way. Has anyone tried it?

The HiFive Unmatched Software Reference Manual has info on booting from nvme. You can find it at the bottom of https://www.sifive.com/boards/hifive-unmatched

For Freedom-u-sdk, you can just dd the same image used for sdcard to the nvme disk, expand the fourth partition to the end of the disk, and then fix the extlinux config file on the third partition to point at nvme instead of sdcard.

u-boot searches nvme first before sdcard, so it will use the nvme image if it exists. If you need to boot from sdcard with an image on nvme, you can hit a key to interrupt u-boot, and then use “run bootcmd_mmc0”. This might be necessary if there is a problem with the nvme image.


But you still have to have u-boot on an SD card, right? I couldn’t find a jumper combination that would pull u-boot from the NVMe directly, and my attempts at putting u-boot in the MTD on-board flash were successful at booting, but the version of the SPL I was using wouldn’t load u-boot itself from anything except MMC0.

(Currently have Debian on the NVMe with a dummy SD card holding nothing but u-boot – even extlinux.conf comes from the NVMe.)

Yes, you still need u-boot on the SDcard.

I think that u-boot needs some more (driver?) work before it will run from flash.

1 Like

Please let me know how you have do it…
Where is the Debian image ?
What must be done after dd command to boot on nvme ?

Thank you in advance.

How do you do it ? What must be modified ? Example…

I greatly appreciate you help.

I gave a URL pointing at the document that describes how we do it. But basically it is the same as getting a sdcard to work. You just dd the image to the nvme disk instead of the sdcard. I did it on the board itself, putting the image on the sdcard and using dd from the thumb drive to the nvme disk. It took a while, but it worked. Better would be to get a usb-to-nvme adapter and do the dd on a faster computer. The only trick, as I already pointed out earlier, is that you need to edit the extlinux config on the third partition of the nvme after the dd. This is explained in the document I pointed at.

Exactly which part of these instructions are you having trouble with?

I went with the option of putting only the debian rootfs on NVME (then editing /boot/extlinux/extlinux.conf on the SD card to provide the right kernel command line), the u-boot and kernel still comes from the SD card to make it easier to swap them during development / testing.

I dd the u-sdk image to the nvme and the root filesystem is loading from it ok on bootup. I did notice that dd created two primary partitions nvme0n1p1 and nvme0n1p2 1.00MiB and 4.00MiB in size respectively.

Gparted shows the filesystem for these partitions as unknown. Are these where u-boot spl and opensbi are located? Since this get loaded from the flash card anyway can I just delete these partitions?

Yes, fsbl and (s)sbl are on the first two partitions, which are not actually needed on the nvme drive as they are loaded from the sdcard.

If you want details on how booting works, see

1 Like