bash create a floppy file with mbr and mount

133 Views Asked by At

I need to create a floppy file to mount and copy files. I also need to change the mbr. When I do this:

mkdir -p disk_images

rm disk_images/floppy.flp

dd if=/dev/zero of=disk_images/floppy.flp bs=1k count=1440

mkdosfs -F 32 disk_images/floppy.flp

mkdir floppydisk

dd status=noxfer conv=notrunc if=build/boot.bin of=disk_images/floppy.flp

sudo mount -t vfat -o loop,defaults disk_images/floppy.flp floppydisk

I get the error

mount: /home/user/myos/floppydisk: wrong fs type, bad option, bad superblock on /dev/loop13, missing codepage or helper program, or other error.

omitting the last dd works but that way, I can't control the mbr.

0

There are 0 best solutions below