I'm trying to use the `dd` command to copy a file named `pattern.bin`, which is 1KiB in size, to a destination called `floppy1`, and I want it to happen 1440 times. The command I'm using is: `dd if=pattern.bin of=floppy1 bs=1024 count=1440`. However, regardless of the block size (bs) I set, whether it's 12, 512, or anything else, the output always ends up being just 1kB. I get the output: `1+0 records in 1+0 records out 1024 bytes (1.0 kB, 1.0 KiB) copied, 5.9289e-05 s, 17.3 MB/s`. Can someone explain what's going wrong? It just doesn't make sense to me!
2 Answers
I think there might be a misunderstanding about what you're attempting. From what I gather, you're trying to create a floppy disk image with the same file, right? If that's the case, you can use a different command like `dd if=/dev/zero of=floppy.img bs=1024 count=1440` to create a blank image that mimics the floppy disk. That's usually the method I rely on for these tasks.
It looks like there's a bit of confusion with how the `dd` command works. Your command actually copies the first 1440KiB of `pattern.bin` to `floppy1`, not 1.44 million copies of the file. If `pattern.bin` is smaller than 1440KiB, it just copies the whole file instead of repeating it multiple times. Unfortunately, `dd` doesn't have a built-in function to duplicate the input multiple times like you're trying to do. You might need to consider a different approach or a script to accomplish that!
Yeah, that's what I'm after! Thanks for clarifying it for me. It sounds like using `dd` with `/dev/zero` is definitely the way to go.