Why is my DD command only copying 1KB instead of 1.44MB?

0
2
Asked By CuriousCat123 On

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

Answered By DiskWizard99 On

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.

CuriousCat123 -

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.

Answered By TechieTom78 On

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!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.