The final purpose is to build the image of a partition sector by sector. I want the sector size to be 4096. As a first step I am trying to create an empty image of 32MiB with 4096bytes sectors rather than 512bytes. For this I am trying:
dd if=/dev/zero of=empty4k.img bs=4096 count=8192
Then I do
fdisk -l empty4k.img
and shows 512 byte sectors. I believe it is because if you do "
fdisk -l /dev/zero
it also says 512 byte sectors.
Can anyone help me?
Best Answer
The
bs
given todd
just tells how large the buffer should be during creating the file. In the end, the file consists of nothing but zero-bytes, there is no information about alignment.You have to use the specific parameter to
fdisk
, which is-b
, as per theman
-page offdisk(8)
: