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
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.
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.
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?