15
Mar
Posted by Derek@TheDailyLinux in Tips and Tricks » 3 Comments »
Write To or Read From a Given Sector Using dd
This comes in handy when trying to troubleshoot a drive. If you’re met with an error message like “I/O Error: Bad sector 40003″, then you can use ‘dd’ to verify that it’s bad. For example, to write to a given sector/block, use the following command:
dd if=/dev/urandom of=/dev/sdb seek=<sector_number> count=1 bs=512
To read from a given sector/block, use the following command (skip instead of seek):
dd if=/dev/sdb of=/dev/null skip=<sector_number> count=1 bs=512
Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:
Here are some similar posts that you may be interested in:
There's 3 Comments So Far
April 4th, 2012 at 4:46 am
Does it work if your sector size differs from 512 byte?
July 1st, 2012 at 1:27 pm
If your sector size differs you’ll have to change bs=(your sector size).
January 25th, 2013 at 12:56 pm
Thanks!! exactly what i m looking for!
Share your thoughts, leave a comment!