[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

iso verification: results - successful but still bewildered



scdbackup@gmx.net, debian-user@lists.debian.org

Thomas,
   Thank you for your previous assistance concerning the hacked iso issue.  Below is my progress.  The only remaining issues are found in Retort4-5 below:
   
<Quote1>
Why this overwriting of partition 1 by zeros ?
The partition table will be overwritten by the ISO anyways.

Retort1-->Thanks for this info.
        
--------------------------------------------
<Quote2>
dd if=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso of=/dev/sdb bs=1M
...
(For me it runs substantially faster if i add option bs=1M.)

Retort2-->I ran dd again:
[code]
$ dd if=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso of=/dev/sdb
dd: failed to open ‘/dev/sdb’: Permission denied
$  ll /dev/sdb
brw-rw----. 1 root disk 8, 16  8月 14 19:45 /dev/sdb
$  sudo chown a:adm /dev/sdb
$  ll /dev/sdb
brw-rw----. 1 a adm 8, 16  8月 14 19:45 /dev/sdb
$  ll /dev/sdb
brw-rw----. 1 a adm 8, 16  8月 14 19:45 /dev/sdb
$  dd if=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso of=/dev/sdb
$  dd if=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso of=/dev/sdb bs=1M
613+0 records in
613+0 records out
642777088 bytes (643 MB) copied, 105.551 s, 6.1 MB/s
[/code]
--------------------------------------------
<Quote3>
Did the command last long enough to be credible ?
Did it report
1255424+0 records in
1255424+0 records out

Retort3--> Again, I burnt the iso to disk again (above and below):
[code]
$  dd if=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso of=/dev/sdb bs=1M
613+0 records in
613+0 records out
642777088 bytes (643 MB) copied, 105.551 s, 6.1 MB/s
[/code]

--------------------------------------------

<Quote4>
  When you write:
$ dd if=debian-8.4.0-amd64-netinst.iso bs=1 skip=32768 count=6 | od -c
...
0000000 001 C D 0 0 1

Your file yielded two blanks on this shell command

dd if="/dev/sdb" bs=2048 skip=16 count=1 |
dd bs=1 count=6 | od -x | head -1 | \
awk '{print $2 " " $3 " " $4}'

Wheras an ISO is supposed to yield (on little-endian machine):

4301 3044 3130

Retort4-->
Do you mean that you want me to try out these commands?  Or is the program not usable on an average lubuntu 14.04 Samsung netbook like mine?  Is there anything more I can do?

--------------------------------------------

<Quote5>
As we learn from the copy-to-stick command, we need to curb to 1255424
blocks of dd''s default size (512 bytes per block). My USB stick is at
/dev/sdc:

$ dd if=/dev/sdc count=1255424 | sha256sum

Retort5--> May I assume that the number "1255424" is the records in/out integer?  The first results below I used a count matching the burn of the iso to sdb:
[code]
$ dd if=/dev/sdb count=613 | sha256sum
613+0 records in
613+0 records out
313856 bytes (314 kB) copied, 0.0509401 s, 6.2 MB/s
943ad23096494bdff9a29f99368430285f8ecbe57da49db3d1fcf4be0800643d  -
[/code]
The second results below I used a count matching the burn of the iso to sdb:
[code]
$ dd if=/dev/sdb count=1255424 | sha256sum
1255424+0 records in
1255424+0 records out
fd7729e3bdfcb2b1b8793f5a19096fb2eee3cf709c39112ed2da7e7a2d7f6886  -
642777088 bytes (643 MB) copied, 31.813 s, 20.2 MB/s
$  sha256sum /media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso
fd7729e3bdfcb2b1b8793f5a19096fb2eee3cf709c39112ed2da7e7a2d7f6886
[/code]

Quite incredible, with the 'magic' number of "1255424" and using sha256sum the "/dev/sdb" and the original iso MATCH!!!  But not the above command using the "records in/out integer" of 613(M), which is coincidentally the size of the downloaded iso on the local disk.  Where does the number 1255424 come from?  I notice that 613 M = 613 000 000 and if you break this down into 512 K than 613M / 512K = 1197265.6 which is near the magic number, is this not important?  At this point I still didn't know where the 'magic number' came from.  At this time I thought that sha256sum wasn't my target checksum, so I checked both /dev/sdb and the original iso with sha512sum:
[code]
$ dd if=/dev/sdb count=1255424 | sha512sum && wait && sha512sum /media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso
1255424+0 records in
1255424+0 records out
642777088 bytes (643 MB) copied, 124.684 s, 5.2 MB/s
3365649694bf623d63f37853582d3fe0f7aa774821e2533d2dc79f5d763df1751e20da98da013ccc9bd3257159362434462bd7363caff3a590e75701b81e751c  -
3365649694bf623d63f37853582d3fe0f7aa774821e2533d2dc79f5d763df1751e20da98da013ccc9bd3257159362434462bd7363caff3a590e75701b81e751c  /media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-lxde-CD-1.iso
[/code]
It looks like the sha512sum of the /dev/sdb and the original iso MATCH ALSO!!!  

But may I understand the 'magic number' better?



Sincerely,
Andrew

P.S. -  Is there any forum (like linuxquestions.org) that I could post this on?  I am new to debian and doubt the email thing is as quick as the email mailing list.

-------- Original Message --------
Subject: Re: iso hacked suspicious: answers
Local Time: August 10, 2016 5:23 PM
UTC Time: August 10, 2016 5:23 PM
From: scdbackup@gmx.net
To: debian-user@lists.debian.org

Hi,

Andrew F Comly wrote:
> E) Burn iso to media
> dd if=/dev/zero of=/dev/sdb1 bs=1M;
> wait;

Why this overwriting of partition 1 by zeros ?
The partition table will be overwritten by the ISO anyways.

(And on what asynchronous processes are you waiting to end ?)


> ddif=/media/LG/AC/bckup/Install/2_Bootable-OS/Debian/i386/debian-8.5.0-i386-l
xde-CD-1.iso of=/dev/sdb

Blanks matter. :))

Assumed that you did put a blank between "dd" and "/media", the command
would be ok for copying the ISO onto a USB stick at /dev/sdb.
(For me it runs substantially faster if i add option bs=1M.)

Did the command last long enough to be credible ?
Did it report
1255424+0 records in
1255424+0 records out
?


>             sudo sha256sum /dev/sdb

As we learn from the copy-to-stick command, we need to curb to 1255424
blocks of dd's default size (512 bytes per block). My USB stick is at
/dev/sdc:

$ dd if=/dev/sdc count=1255424 | sha256sum
...
fd7729e3bdfcb2b1b8793f5a19096fb2eee3cf709c39112ed2da7e7a2d7f6886 -

$ fgrep fd7729e3bdfcb2b1b8793f5a19096fb2eee3cf709c39112ed2da7e7a2d7f6886 SHA256SUMS
fd7729e3bdfcb2b1b8793f5a19096fb2eee3cf709c39112ed2da7e7a2d7f6886 debian-8.5.0-i386-lxde-CD-1.iso


Testing with ./check_debian_iso (which counts blocks of 2048 bytes each):

$ ./check_debian_iso SHA512SUMS debian-8.5.0-i386-lxde-CD-1.iso /dev/sdc
Piping 313856 blocks of '/dev/sdc' through 'sha256sum'
to verify checksum list item 'debian-8.5.0-i386-lxde-CD-1.iso'.
313856+0 records in
313856+0 records out
642777088 bytes (643 MB) copied, 31.7854 s, 20.2 MB/s
Ok: '/dev/sdc' matches 'debian-8.5.0-i386-lxde-CD-1.iso' in 'SHA256SUMS'


Have a nice day :)

Thomas



Reply to: