Recently I'm using nvme-cli to write the data to the block devices, the nvme write and read will allow the user to write to specific blocks. Unfortunately, they don't offer a write or read interface for file-level since maybe the user can just mount the block device.
After I write the file to the specific block with a start number and cost of the block, I can read it back use nvme-cli, sure it do have some extra junk at the end of the file. But how to make the blocks show in the file system? Is there any way I can do to arrange those blocks to a file that can be observed by VFS when I mount the block device? Are there any functions or interfaces that OS fs offered?
I'm using ext4 format for my empty block device. PLease help me...crying.
I have to do this way, because looks like nvme doesn't have a eaiser interface for fs level write or read, to revision the fs is way much harder in my opinion