BBAI64 - NVMe - rootfs

A few users have asked for this, sorry it’s a little late…

Assumptions…

Currently, U-Boot (or Boot ROM) doesn’t support reading the NVMe, so we need something to load u-boot, our choices are eMMC or microSD… eMMC is onboard… So, we might as well assume eMMC for u-boot…

  • ROM loads u-boot from eMMC
  • u-boot loads Image & device tree’s from eMMC
  • linux mounts NVMe as rootfs.
/boot/firmware -> 1st partition of eMMC
/ -> 1st partition of NVMe.

(if you want to use the 2nd partition of eMMC, for anything go ahead, after you complete the copy over to rootfs, just leave the 1st partition alone…)

Hardware/Adapter:

Samsung 970 EVO Plus and https://www.amazon.com/dp/B07DZF1W55

System can be either booting off microSD or eMMC at this point…

Update System (microSD or eMMC boot)

sudo apt update
sudo apt upgrade
sudo reboot

Update All Bootloader related files (microSD or eMMC boot)

sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-emmc.sh
sudo /opt/u-boot/bb-u-boot-beagleboneai64/install-microsd.sh

Flash eMMC from microSD (microSD boot)

sudo enable-beagle-flasher
sudo reboot

Remove microSD if you had been using it, at this point we assume only eMMC bootup…

Copy RootFS to NVMe… (eMMC boot)

sudo cp -v /etc/beagle-flasher/bbai64-emmc-to-nvme /etc/default/beagle-flasher
sudo beagle-flasher-boot-emmc-rootfs-nvme
sudo reboot

NVMe RootFS… (eMMC boot, NVMe RootFS )

/proc/cmdline

debian@BeagleBone:~$ cat /proc/cmdline 
console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/nvme0n1p1 ro rootfstype=ext4 rootwait net.ifnames=0 quiet
debian@BeagleBone:~$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  14.6G  0 disk 
├─mmcblk0p1  179:1    0   128M  0 part /boot/firmware
└─mmcblk0p2  179:2    0  14.5G  0 part 
nvme0n1      259:0    0 232.9G  0 disk 
└─nvme0n1p1  259:1    0 232.9G  0 part /
mmcblk0boot0 179:256  0     4M  1 disk 
mmcblk0boot1 179:512  0     4M  1 disk 

NVMe Benchmarks

debian@BeagleBone:~$ sudo hdparm -tT /dev/nvme0n1

/dev/nvme0n1:
 Timing cached reads:   2598 MB in  2.00 seconds = 1299.56 MB/sec
 Timing buffered disk reads: 1644 MB in  3.00 seconds = 547.65 MB/sec

eMMC Benchmarks

debian@BeagleBone:~$ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
 Timing cached reads:   2438 MB in  2.00 seconds = 1219.10 MB/sec
 Timing buffered disk reads: 498 MB in  3.00 seconds = 165.90 MB/sec

Regards,

3 Likes

Works good, thank you for doing that.