Purpose of ibs/obs/bs in dd

file-io, filesystems, linux

Solution

The block size is the number of bytes that are read and written at a time. Presumably there is a `count=` option, and that is specified in units of the block size. If there is a `skip=` or `seek=` option, those will also be in block size units. However if you are reading and writing a regular file, and there are no disk errors, then the block size doesn't really matter as long as you can scale those parameters accordingly and they are still integers. However certain sizes may be more efficient than others.

Problem

I have a script that creates file system in a file on a linux machine. I see that to create the file system, it uses 'dd' with bs=x option, reads from /dev/zero and writes to a file. I think usually specifying ibs/obs/bs is useful to read from real hardware devices as one has specific block size constraints. In this case however, as it is reading from virtual device and writing to a file, I don't see any point behind using 'bs=x bytes' option. Is my understanding wrong here? (Just in case if it helps, this file system is later on used to boot a qemu vm)

Original source