01-21-2021 12:44 AM
I use the XCZU4EV-1SFVC784I to develop petalinux2020.1. While I want to use the NVMe SSD to store data. After fdisk a 80G area for it , when use the 'mkfs' command, petalinux can't recognize the command. It shows "-sh mkfs: command not found ". So I can't mount this area to use it.
I want to know how can solve this problem, thanks.
01-21-2021 05:46 AM
You can enable mkfs using petalinux-config -c rootfs then pick Filesystem Packages → base → util-linux → util-linux-mkfs.
Note that mkfs is just a front-end. Depending on the -t flag, it will call a more specific tool to do the actual formatting. In your case this will be mke2fs which handles ext2/3/4. This also needs to be enabled, Filesystem Packages → base → e2fsprogs → e2fsprogs-mke2fs.
Alternatively, instead of the full version from util-linux and e2fsprogs packages, you can also use the busybox version of these tools (petalinux-config -c busybox, look for mkfs.ext2).
01-21-2021 10:52 PM
Hi. Thanks for your reply.
After adopted the method metioned above (1.Filesystem Packages → base → util-linux → util-linux-mkfs 2. Filesystem Packages → base → e2fsprogs → e2fsprogs-mke2fs) and petalinux-build. It can execute the 'mkfs' command . But when I execute the order ‘mkfs -t ext4 /dev/nvmeOn1p1’, the petalinx command window just printf things ceaselessly. When I restart the board 'mkfs' command didn't work infect. Even if I use the software 'DiskGenius' to make a 80G EXT4 filesystem for NVMe SSD , the board still printf things ceaselessly, can't work normally. And if I remove the EXT4 filesystem for NVMe SSD, the board works normally again.
I cut out a fragment of the ceaseless printing as follow:
So what's the problem here. Looking forward for your reply.
01-25-2021 08:47 AM
Hi, sorry for the delay in replying.
The message you are seeing indicates an unexpected condition related to locking of per-cpu csd resources. The failing function is flush_smp_call_function_queue() which calls csd_unlock() which is printing the warning message. It looks like csd_unlock() got called without a corresponding csd_lock(). Or perhaps csd->flags value got corrupted. Unfortunately I have no idea why this might be happening.
I suspect that mkfs command is not the root cause of the problem. Most likely, any access to the NVMe could trigger it. You could test reading or writing some data using "dd" command, or by reading the partition table with "fdisk" command.
Another thing you could try is to disable SMP, leaving only one CPU active.
01-25-2021 08:58 AM
I wrote this tutorial to use an NVMe SSD on the PCIe slot of an MYIR board that also has a zynq ultrascale+. I think it also applies to yours.
It took me a bit with the kernel configuration to make the SSD work. Before attempting mkfs you need to check if it's available (ls /dev/nvm*)