dd if=/dev/zero of=test.img bs=1M count=10
(image generation of 10MB file)mkfs.fat test.img
(create filesystem inside)head -c 512 test.img
exctract the first 512 bytes
- create a buffer of 10MB
- prepend the rest of the data (files etc.) using Fatfs
- profit
Initial advice: natevw/fatfs#21 (comment)