Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 at 17:09

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.