[OSGeoLive] problem with bootable usb stick creation via dd

Ben Caradoc-Davies ben at transient.nz
Thu Aug 16 19:35:14 PDT 2018


Actually that verification will not work because dd bs is limited to 
about 2 GiB (signed 32-bit?). The solution is to use "head -c", or 
because in this case the image size is an exact multiple (502) of 8 MiB, 
bs=8M count=502. The source confirms that the size argument to head is 
size_t (64-bit on amd64). This also stops trying to load the whole image 
into memory.

Wrong:

# dd if=/dev/sdb bs=4211081216 count=1 | md5sum
0+1 records in
0+1 records out
2147479552 bytes (2.1 GB, 2.0 GiB) copied, 111.671 s, 19.2 MB/s
d115d027efbf43eaba4ff2589aab17e8  -

Right (dd reading a bit more than the image size):

# dd if=/dev/sdb bs=1G count=4 | head -c 4211081216 | md5sum
83a07dc571b7810495f0835e5f390ab8  -

Right (image size is an exact multiple of 8 MiB):

# dd if=/dev/sdb bs=8M count=502 | md5sum
502+0 records in
502+0 records out
83a07dc571b7810495f0835e5f390ab8  -
4211081216 bytes (4.2 GB, 3.9 GiB) copied, 225.907 s, 18.6 MB/s

On 17/08/18 11:57, Ben Caradoc-Davies wrote:
> And if you know the md5sum and exact size size in bytes of the source 
> image, and have enough memory, you can also verify the write:
> 
> sudo dd if=/dev/sdX bs=4211081216 count=1 | md5sum
> 
> $ ls -l osgeolive-12.0beta3-amd64.iso
> -rw-rw---- 1 ben ben 4211081216 Aug 17 11:40 osgeolive-12.0beta3-amd64.iso
> $ md5sum osgeolive-12.0beta3-amd64.iso
> 83a07dc571b7810495f0835e5f390ab8  osgeolive-12.0beta3-amd64.iso
> $ cat osgeolive-12.0beta3-amd64.iso.md5
> 83a07dc571b7810495f0835e5f390ab8  osgeolive-12.0beta3-amd64.iso
> 
> Kind regards,
> Ben.
> 
> On 17/08/18 11:09, Ben Caradoc-Davies wrote:
>> Have you tried writing the raw ISO with dd?:
>> sudo dd if=osgeolive-12.0beta3-amd64.iso of=/dev/sdX bs=8M; sync
> 

-- 
Ben Caradoc-Davies <ben at transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand


More information about the osgeolive mailing list