1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/bin/sh set -ex #dd if=/dev/zero of=test.img bs=1M count=128 rm -f test.img mkdosfs -F 32 -C test.img $((134217728/512)) mkdir -p toimg/foo/bar touch toimg/foo/bar touch toimg/baz mcopy -p -v -s -i test.img toimg :: mdir -s -i test.img fsck.vfat -V test.img |