Change root partition to nvme

Not really sure how to do this as current partuuid/uuid seems to get detected via uboot.

I did take the emmc out and change the root part uuid after a DD thinking it would work or break.
So the nvme had the old uuid and the emmc would now be different.

It just found the new uuid and booted as normal.

I am used to other distro's that have extlinux and there you just change either partuuid or even by /dev/sdxx

Must admit aint a clue anyone know?

I don't think the RockPro64 is capable of booting of a PCIe device. As far as I know, only SD and eMMC boot is supported.

Manjaro ARM does not used UUID's to define the boot device, but labels.

It is via the other distro's but debian has an extlinux folder that sort of chains onto the uboot and that actually loads the kernel and sets the root partition.

https://wiki.pine64.org/index.php/ROCKPro64_Main_Page#NVMe_drives

Just puzzled as not even sure how they got extlinux on arm but seen it and done via the 4.4 debian images they have avail.

Also they have overlays for certain settings and have never been really sure why they have an overlay to set it to gen 2.0 and why not just in the original dts?

http://linux-sunxi.org/Mainline_U-Boot#Booting_with_extlinux.conf

What you rekon just create an extlinux folder and give it a go?

No idea. We don't use extlinux. :slight_smile:

Yeah pcie is such a pia its set at pcie gen1 also but capable of gen 2.0 my ssd is about 60% of what its capable of

Yeah almost double actually with the large rec lengths

	Command line used: iozone -e -I -a -s 100M -r 4k -r 16k -r 512k -r 1024k -r 16384k -i 0 -i 1 -i 2
	Output is in kBytes/sec
	Time Resolution = 0.000001 seconds.
	Processor cache size set to 1024 kBytes.
	Processor cache line size set to 32 bytes.
	File stride size set to 17 * record size.
                                                              random    random     bkwd    record    stride                                    
              kB  reclen    write  rewrite    read    reread    read     write     read   rewrite      read   fwrite frewrite    fread  freread
          102400       4    66609    69801   102195   103629    17303    72750                                                                
          102400      16   177090   195027   247512   250026    63688   190096                                                                
          102400     512   396419   393390   438394   442361   445217   388249                                                                
          102400    1024   419098   435542   498233   507013   511439   406886                                                                
          102400   16384   416304   403364   720201   739061   739895   406424              

On my cheap budget Integral 120gb nvme

I just compiled 5.3 then copied the DTB after a quick mod

&pcie0 {
	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
	num-lanes = <4>;
	max-link-speed = <2>;
	pinctrl-names = "default";
	pinctrl-0 = <&pcie_perst>;
	vpcie12v-supply = <&vcc12v_dcin>;
	vpcie3v3-supply = <&vcc3v3_pcie>;
	status = "okay";
};

Just max-link-speed = <2>; needs to be added and its gen2.0 otherwise its gen1.0 with half the bandwidth.

Cool. This is on the RockPro64, right?

Yeah
https://1drv.ms/u/s!AocmAh35i26Qihh62ETHD9xpmUFU?e=RKvtZb
dtb here its just 5.3 with that added dunno why its not been pushed to mainline as it is gen 2.0 on the rk3399?

Even my crappy £20 integral nvme can reach 740MB/s if gen2.0 its was about 350 or something before

No idea. Gonna patch it in the Manjaro RC kernel.

1 Like

before on a dmesg | grep pci it will tell you 2.5gbs but if the above as great you will patch reports back 5gbs.

I now have manjaro with working pcie 2.0 on a rk3399 whoop! whoop! lols.

I have a feeling working out how to boot from emmc but have root as nvme is going to be a trickier prospect. I may be gone for some time! :slight_smile:

Strit does x86 Manjaro use syslinux?

ps Strit where are the labels defined?

Any chance you could include as a test with u-boot

CONFIG_NVME Enable NVMe device support
CONFIG_CMD_NVME Enable basic NVMe commands

I haven't had much luck with building u-boot haven't managed to get it to boot yet :slight_smile:

Actually Ayufan doesn't seem to have u-boot nvme config or dts and it seems to work ?

Labels get defined when the image is being created with our tools.

Once we can test it ourselves, we might start working on it.

I don't think the nvme config is needed as doesn't seem to be included with other working distro's with nvme.

I don't think it is working from labels you know, even though root is labelled root.
In the uboot env the only label mention should be rootfs not root but it still loads.
I think basically it just runs because it is at the end of the 32mb loader partitions and the root folder is positioned normally where the boot partition is but here its an all in one.
That is the biggest problem as the seek point for /boot is in the root so can not be separated and prob will hinder as dropping that root will also drop the boot partition.

Thinking it prob needs to be like the others with separate boot and root partitions, its actually really good that way as if we ever do figure out how to get the uboot console on hdmi then you can multiple options and multiple roots parts if you ever wanted multiboot.

I am going to chance my luck at changing the nvme label to rootfs as you never know but thinking as an all in one its likely not to work.
I am trying to remember where in the kernel load the rootfs comes in.

I was wondering more where the labels are used in the uboot env as can not seem to find them.

Yeah I changed the label for the emmc from ROOT to boot
Changed the label for the nvme to rootfs
Changed the uuid of the emmc partition to a generated one and then the mentioned one in the uboot env B921B045-1DF0-41C3-AF44-4C6F280D3FAE

Didn't think it would work but the thing that makes me think because the isn't a separate /boot /root partitions it just accepts the default seek point of the partition start as default.
As after changing both label and uuid it still booted as normal.

Nope turned out much easier than expected, but was trying not to mangle the script of boot.txt.

So first just dd mmc to nvme

boot.txt

setenv bootargs console=ttyS2,1500000 root=/dev/nvme0n1p1 rw rootwait
#setenv bootargs console=ttyS2,1500000 root=PARTUUID=${uuid} rw rootwait

only prob is boot is now the nvme partition and uboot updates will go there but its the mmc that is loaded
I did put an entry in fstab for
/dev/mmcblk1p1 /boot ext4 defaults,discard 0 2

but because boot is a subfolder I end up with old root with /boot in it