LBA address to actual byte offset
I'm working on a windows machine through linux. smartctl reports that there is a pending sector (and the long self-test reported an error reading from that sector) at LBA 0x09c8a4bb (164144315)
How can I 'translate' that LBA address to something I can feed to 'dd'? Bad LBA: 0x09c8a4bb (164144315) Geometry: 255h, 63s, 12161c Units = cylinders of 16065 * 512 = 8225280 bytes I tried looking around online, everything is regarding finding the file in a filesystem occupied. I don't need something that high level - I just need the byte range that I can feed to dd to manipulate the damaged area. |
"dd" uses decimal sectors as the unit when you give dd an offset value, so how about simply doing:
Code:
dd if=/dev/<drive> skip=164144315 | hexdump -C | less |
Quote:
I did a test read of the areas around the error using both block sizes and 512 was the one that put me right on the read error. Thrashed that sector with /dev/urandom for about half an hour and it finally reallocated. |
Glad that worked OK, and by the way, dd uses a block size of 512 bytes by default, so you don't actually have to specify "bs=512" if you don't want to. Good luck, and I hope your HDD isn't going bad if you are starting to get too many bad sectors. :)
|
All times are GMT -5. The time now is 08:29 AM. |