Quantcast
Channel: How to create a file of the exact size of a directory (and its files), to hold a FAT32 filesystem? - Super User
Viewing all articles
Browse latest Browse all 2

Answer by Luis Lavaire for How to create a file of the exact size of a directory (and its files), to hold a FAT32 filesystem?

$
0
0

The right tool for this task is du.

mkfs.vfat -C $BOOT_IMG \
    $(( ($(stat -c %s $BOOT_IMG_DATA) / 1024 + 511) / 1024 ))

That command will create the file $BOOT_IMG, which will have enough size to keep the contents of $BOOT_IMG_DATA.


Viewing all articles
Browse latest Browse all 2

Trending Articles