NVME setup problem for lx2160a

I am having trouble setting up the nvme drive when I try to follow [https://solidrun.atlassian.net/wiki/spaces/developer/pages/197494345/LX2160A+Software.

I did interrupt the auto boot and was able to follow the steps in the image snapshot for writing to the nvme from address 0xa4000000.

I was then able to issue the boot command to boot the kernel.

I logged into the Ubuntu OS and then followed the steps to finalize the imaging.
I was able to run fdisk on /dev/nvme0n1 to delete and recreate the partition, but when I issued the w command to save and exit, I saw the messages

    The partition table has been altered.
    Failed to remove partition 1 from system: Device or resource busy
    Failed to add partition 1 to system: Device or resource busy
    The kernel still uses the old partitions. The new table will be used at the next reboot. 
    Syncing disks.

I never did see the prompt ‘Do you want to remove the signature?’

I ignored the message and proceeded to the next step, which was to run resize2fs /dev/nvme0n1p1.

This reported back
resize2fs 1.45.5 (07-Jan-2020)
Filesystem at /dev/nvme0n1p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/nvme0n1p1 is now 90368 (4k) blocks long.

I enabled eth0 using dhclient

Then I updated the date/time using ntpdate pool.ntp.org

Then I ran apt update and it complained about no space left on device:

I’m guessing the partition resize command did not work.

What am I missing?

Thank you in advance for your help.

Well I wonder if it is possible to remount the device :

mount -o remount /dev/nvme0n1p1 /

If not, consider rebooting after the resize.

Thank you for the suggestion benoit.
I tried that and then tried the resize2fs command, which gave the same complaint. I went ahead and did dhclient and ntpdate pool.ntp.org, which work.

Then I did apt update, and it complained about no space…so same error as before.

Something does change though, because when I reboot, kernel bootup fails as it times out on nvme:

I suspect maybe the problem is not being able to resize the mounted partition because it is the root partition (aka /dev/root)?

As another experiment, I removed the NVME drive and powered on. I flashed the eMMC and was then able to boot to the login prompt. I logged in and followed the same steps (delete partition, create new partition, resize, apt update) and it resulted in the same problems. I even tried to remount /dev/mmcblk1p1 and then trying the resize command again, but df -h still reports the original small size and 0 bytes available. Rebooting this time fails, as the eMMC got changed somehow with the steps that were done (delete partition, create new partition, resize, apt update).

So this problem occurs with the eMMC and an NVME device.

Has anyone had success using the quick start guide? https://solidrun.atlassian.net/wiki/spaces/developer/pages/197494288

If I remember correctly I did everything of the SD, then fdisk’ed the NVME, formatted the partition, copied the rootfs over and voilà.

I’m receiving 2 more nvme’s tomorrow, I’ll give you an update over the week end.

Thank you very much Benoit. I look forward to hearing about your results.

What nvme device are you trying to use? Some drives have an issue with lower power states and Linux. You can try adding pcie_aspm=off to the kernel commandline.

It is a Samsung V-NAND 870 EVO Plus SSD.

Please pardon my lack of knowledge. I have just the microSD card booting the LX2160a, which only contains ubuntu-core.img and xspi_header.img. And the NVME, which I can reflash from the microSD card.

  1. What file do I modify to add pcie_aspm=off to?
  2. Is it to some file in the NVME, after it was flashed by the microSD card during the pre-boot state (aka right after nvme write 0xa4000000 0 0xd2000, and the login into Ubuntu)?
  3. Then do I power cycle, login and then try deleting the partition on the NVME and re-partition/re-size it?

Thank you very much for your help.

u-boot should be using the common distro boot method in u-boot. You can check the /boot/extlinux/extlinux.conf file for the kernel args. If you would like an easy way to set these args in u-boot then you can make sure that the append line in extlinux.conf has ${bootargs} on it, then in u-boot you can env edit bootargs and set the kernel parameters you want passed on the commandline.

Thank you jnettlet.

I was finally able to fix the issue with not being able to delete/create/resize the NVME partition. I did this by removing the NVME drive, attaching it to another Ubuntu environment and using gparted to delete all partitions from it and recreate one partition on it with EXT4 format.

Then I put the NVME drive back into the LX2160A and was able to proceed with the partition activities for the NVME drive.