Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I have a drive with 10000 512b sectors.

If I do

sudo dd if=/dev/zero of=/dev/disk2 skip=99999 count=10

what will happen?

When I tested this with a real drive, dd's output suggested that it did in fact write something somewhere, but I don't understand where/how that would be possible?

share|improve this question
Can you share dd’s output? – Benjamin Barenblat Feb 1 '14 at 17:09

Whole drives are referenced without numbers for example: /dev/sda Partitions are referenced with numbers : /dev/sda2

Your example: of=/dev/disk2 references partition 2 on disk.

In many cases the last partition does not use the whole drive and in fact a few MB are left unused. Going past the end of partition 2 could damage partition 3 if the hard drive had a third partition.

The most likely reason it worked is the unused space I mentioned, and the fact you only tried to go 10 sectors over the partition limit and not the hard drive limit. 1MB is 2048 sectors. If you had reached the end of the drive there would be an I/O error.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .