hey guys-
I was wondering if you could help with me a dd command. How do I wipe a range of sectors on a device? Lets just for example purposes I wanted to wipe sectors 100-150.
I figured I would provide this if it provides some information that is needed.
Disk /dev/sda 160.0GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
man dd
man dd
Thanks Tom D . I checked the MAN page, but nothing jumped out to me to cover my question. MAN pages are sometimes not as descriptive as I would like. Can you point me to the proper flag? I think it may be possible with the skip=BLOCKS or seek=BLOCKS flags, but I am unsure of the syntax.
im not the best expert with dd but using;
skip=BLOCKS
Skip BLOCKS `ibs'-byte blocks in the input file before copying.
count=BLOCKS
Copy BLOCKS `ibs'-byte blocks from the input file, instead of
everything until the end of the file.
seems the best option for me, work out how many blocks your sectors take up skip the blocks before hand and copy only those blocks.
The rest is up to you as they say.
im not the best expert with dd but using;
skip=BLOCKS
Skip BLOCKS `ibs'-byte blocks in the input file before copying.count=BLOCKS
Copy BLOCKS `ibs'-byte blocks from the input file, instead of
everything until the end of the file.seems the best option for me, work out how many blocks your sectors take up skip the blocks before hand and copy only those blocks.
The rest is up to you as they say.
Why would you skip blocks from your input file? Your input file would be zero. Wouldn't you use seek=BLOCKS (skip BLOCKS obs-sized blocks at start of output)?
well seek is related to the output file and skip is related to the input file, why would you skip blocks on the output file when your trying to pick from the input and send it to the output.
well seek is related to the output file and skip is related to the input file, why would you skip blocks on the output file when your trying to pick from the input and send it to the output.
When you wipe a disk, your input file is zero. And your output file is where you want the zeros to be written. I would think you would want to skip blocks on the output file because you are not writing to the first block of the disk and only want to write the zeros to the range of sectors (my ex 100-150). So I would want to skip the first 99 sectors, start writing zeros from 100-150, then stop.
how about
dd if=/dev/zero of=/dev/sda seek=100 count=50 conv=notrunc
how about
dd if=/dev/zero of=/dev/sda seek=100 count=50 conv=notrunc
yeah, seek=100 count=50 is what I was thinking. I will have to run a test though to confirm