I tried the read-sector 0 on the WD Passport USB disk. The first line printed is:
625c cd55 c06e 50ba d1d9 2f98 275b e5da
however reading sector 0 with 'dd | od -t x2' gives (which is ok):
c033 8efa 8ed8 bcd0 7c00 e689 5706 c08e
Repeating the same steps with other disk gives both outputs (from dd and hdparm) alike.
As some disks use internal encryption I modified 1st byte using dd, so 0x33 changes to 0x44 (first physical byte on disk, not the word format printed). Now dd shows (and this is ok):
c044 8efa 8ed8 bcd0 7c00 e689 5706 c08e
whilst hdparm read-sector gives (and only this line is changed, so all 16B):
cdf8 fe30 72de d2ae 39e7 3d00 b675 c3ea
Restoring original first byte gives initial results.
This tells me that both dd and hdparm access the same sector.
I did not read the sources of hdparm but what exactly it is reading from the disk? It is difficult to believe it gives access to the data from the other side of the encryption device…
Other question - how can I ensure the read-sector gives the same data as dd?
Log in to post a comment.