Boot from nvme

I have followed instructions from this link in order to make my Jetson Nano custom board boot from nvme ssd disk.

It is working most of the time. But, sometimes, after reboot the service responsible for performing the task fails.

I get the following message

$ systemctl status setssdroot.service

● setssdroot.service - Change rootfs to SSD in M.2 key M slot (nvme0n1p1)
Loaded: loaded (/etc/systemd/system/setssdroot.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Wed 2023-11-22 08:01:45 +04; 8h ago
└─ ConditionPathExists=/dev/nvme0n1p1 was not met

Any idea what might be causing the issue?

P.S. This is the code of setssdroot.service

[Unit]
Description=Change rootfs to SSD in M.2 key M slot (nvme0n1p1)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=local-fs-pre.target local-fs.target shutdown.target
Wants=local-fs-pre.target
ConditionPathExists=/dev/nvme0n1p1
ConditionPathExists=/etc/setssdroot.conf
ConditionVirtualization=!container
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/setssdroot.sh
[Install]
WantedBy=default.target

The log clearly states that the NVMe drive is not found.
You may need to check the physical connection or something like that.

Also, this script is not officially made by NVIDIA, and we do not take responsibility for any issues.

Thanks for the reply,

yes it seems that at startup the ssd drive is not found, but if you login to the device a couple hours later it is available under /dev/nvme0n1p1.

I know that the script was not made by nvidia, the issue does not seem to be due to the script after all. I just posted the question, first to see if anyone else had this issue before, and to get some advice about what I could do to resolve.

You may see if swapping for a different carrier board/NVMe drive helps if it’s really a connection issue.

It happened once more. I have logged in the device.

$ ls -al /dev/nvme*

returns:

crw------- 1 root root 236, 0 نوف 23 18:01 /dev/nvme0
brw-rw---- 1 root disk 259, 0 نوف 23 18:01 /dev/nvme0n1
brw-rw---- 1 root disk 259, 1 نوف 23 18:01 /dev/nvme0n1p1

If I query the status of the service that sets ssd as root:

$ sudo systemctl status setssdroot.service

● setssdroot.service - Change rootfs to SSD in M.2 key M slot (nvme0n1p1)
Loaded: loaded (/etc/systemd/system/setssdroot.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Thu 2023-11-23 18:01:05 +04; 2h 55min ago
└─ ConditionPathExists=/dev/nvme0n1p1 was not met

How come at 18:01:05 path /dev/nvme0n1p1 doesn’t exist but at the same time I get:

brw-rw---- 1 root disk 259, 1 نوف 23 18:01 /dev/nvme0n1p1

I think that just means at the time the service initiated, /dev/nvme0n1p1 was indeed not there.
Whether the device appears later or not does mean much because it won’t trigger the service again.

Is there ant way I can modify the service to wait until /dev/nvme0n1p1 is available?

I don’t feel like that’s the correct way of doing it.
You should first rule out the connection issue. I don’t know why the device does not show up on startup.

Anyway, does restarting the service when /dev/nvme0n1p1 is present work?

Yes, after restart setssdroot.service works properly and sets the ssd as root.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.