Boot from PCI-E M.2 Adapter card with Samsung 950 Pro

Anyone been able to make this happen? I’ve tried a few things like installing to the built in memory, then copying everything to the M.2 Samsung 950 Pro SSD and modifying my boot file, but i end up at a black screen. The SSD is visible from Ubuntu when you install on the internal memory, but can this thing be the boot drive?!? And if so please god someone help me i’ve had this card and the TX2 for months and have not been able to make this happen.

Not sure for your device, but in short:

  1. Be sure you have a serial console working before doing this.
  2. Early boot stages till uboot will still happen from eMMC (disk mmcblk0).
  3. u-boot reads file extlinux.conf from eMMC partition1 (mmcblk0p1), in directory /boot/extlinux.
  4. A config in this file has name, a filename of kernel image to load and jump into, usually located in (mmcblk0p1) /boot , and boot options mentioning the rootfs device. You can create new configs.

So you would first build a kernel having all required features for driving the SSD as built’in. No modules, since these would be loaded from the SSD so not available when you would need these. Be sure start configuring your new kernel build with the config from current /proc/config.gz. Then you may be sure that CONFIG_BLK_DEV_NVME is set to builtin (y) and set CONFIG_PCI_TEGRA as ‘y’ instead of ‘m’. Build your kernel image. Copy this new kernel image into eMMC (mmcblk0p1) /boot (use a new name, keep previous kernel Image file untouched).
4. Edit the extlinux.conf and create a new config with only the new kernel filename as difference.
5. Test if it boots fine with the new kernel. A serial console will let you select an other config than default one, but the timeout is short (it’s in the extlinux.conf, 30 is 3s).

  1. When the kernel works, change the boot args with the new rootfs partition (such as /dev/nvme0n1p1) in your new extlinux config.
  2. If it works, you would see your rootfs on correct device with command mount. The eMMC would be seen as a SD card, and this is where you would have then to adjust your extlinux.conf or copy another kernel later. Be also aware that kernel modules will be now loaded from your NVME SSD rootfs. So if you later build a new kernel from this config, you would have to copy the image into eMMC and install your modules into the SSD rootfs.

Searching this forum you might also find some relevant posts.

Thank you I will see if I can perform as you said – if not would you be willing to assist via TeamViewer or something similar? I would be willing to pay you for the assistance. Thank you again!

Thanks for the proposal, but I won’t have time for this…I’m helping here for free with the sole expectation that the solution will later be available to everyone.
So just ask when you’re stuck, and better provide detailed information (what you want to acheive, what commands or code you run, and error messages or bad behavior), and share when you move forward.
Note that you can find a lot of useful info from JetsonHacks.

I got it to work – put it back to factory ( flashed it with the JetPack ) – went to JetsonHacks and found their Github – use the scripts they have to pull the source.

git clone https://github.com/jetsonhacks/buildJetsonTX2Kernel.git

I ran the getKernelSourcesNoGUI.sh

At this point I was like okay, well I need to do what you were saying about the /proc/config.gz – but when I went looking for it… I couldn’t see it because i’m a noob and its like hidden or something – so I went snooping around the github of that repo we just pulled form, and inside the next build kernel step, it showed them copying from that exact spot you mentioned, so I thought oh shit… I just couldn’t see it – it was there the whole time… it copied it into the kernel directory ( it was hidden there too ) but I just used ls -a and saw it – edited it like you said – CONFIG_BLK_DEV_NVME was actually already said to (Y) so… I was like damn wtf?
But then I went on and saw that CONFIG_PCI_TEGRA was (M) which I read on some other site ( plus you said it I just didnt know what you were talking about ) that those indicated a module was used. I set this to (Y) as you mentioned…

I didn’t play it safe I was just like to hell with it lets try this…

I mounted and formatted the nvme drive

I ran: sudo cp -ax / /media/nvme

It copied, I verified, I verified the filesystem was ext4 on it and that all the files were indeed copied

Then I modified the /boot/extlinux.config to point to the /dev/nvme0n1p1

I prayed for the best and typed sudo reboot

It came back up and was working fine… I was surprised – I ran df and saw that my / was mounted at the correct size to be the M.2 SSD installed via PCI-E adapter

Nice to read it worked.
For building the SSD rootfs, you may also download rootfs from your JetPack version or NVIDIA (you would have to be logged into developer.nvidia.com for this) and run apply_binaries script so that is is ready with L4T drivers and scripts.

It 's better to get a not mounted filesystem for having a clean rootfs.
So you may also clone your current version.

It can sometimes work as you did…not sure what are the pseudo filesystems in your system.
I have also been using rsync for trying, and it seemed to work with rsync as in this blog. However I’d still advise to copy from unmounted rootfs.