I need to create filesystem with just one partition from nothing (
I tried this sequence of commands:
dd if=/dev/zero of=mountedImage.img bs=512 count=131072 fdisk mountedImage.img n p 2048 131072
Basically, I need to create 64MB image file filled with zeroes. Then I use
fdisk to create new partition for new filesystem, starting at sector
2048 and using all remaining sectors. But now I'm hitting problems. If I set up a loop device and format it using
mkfs -t vfat, partition table is overwritten and filesystem is placed to disk. I don't need whole disk formatted with FAT32, I just need my primary partition to be so.
Does anybody know how can I format only one partition of raw disk image, not whole image? Please help.