I am reading many tutorials about the dd
command. There are some examples including the bs
and count
parameters. Some of them where each one is isolated over the other and other where both are used together, but is not very clear the explicit relation about their values.
At a first glance seems enough and straight use only bs
- and of course taking in consideration that count
by default works with 512 bytes, it because bs
by default is 512 bytes. It such as: bs=512 count=#
.
Question #1:
- When and why is mandatory use both together?
According with some research, a block
has a size of 512
bytes. For example - not sure if are valid:
bs=1M count=10
bs=1M count=5
bs=1.5M count=7
Extra Question #2
- Is there an explicit relation and rate for the values used for them together?
It for example to know if - bs=1M count=10
- bs=1M count=5
- bs=1.5M count=7
- each one are correct or not - and why.
Note: I am assuming there is a kind of rate or rule to define the values when they are used together and therefore avoid to put any random value to see what happens - and harm the disk for a failed experiment. Correct if I am wrong.
Reason: because the dd
command must be use it very carefully I want have very clear the use of them, isolated and together. Of course with the correct values. It is the reason to create this question.
Goal until now it is mentioned in many tutorials about to create a swap file
- in my case for Ubuntu
. How was not clear the dd
syntax, I did do a research of this command and knew the other features, convert
and copy
bs
andcount
operands (together), make sure you understand the pitfalls: When is dd suitable for copying data? – fra-san Mar 30 '22 at 17:52dd
to applyswap file
inUbuntu
, but because it has other features, I am doing the research of this command – Manuel Jordan Mar 30 '22 at 20:48