I have a 512G disk and I want to clear the last 512k bytes at the end of the disk.
I usually clear it by dd if=/dev/zero of=/dev/da0
the whole disk.
Which way is the fastest to do this operation?
ddunix
I have a 512G disk and I want to clear the last 512k bytes at the end of the disk.
I usually clear it by dd if=/dev/zero of=/dev/da0
the whole disk.
Which way is the fastest to do this operation?
Best Answer
As already pointed out,
dd
accepts theseek=BLOCKS
parameter, which skipsBLOCKS
blocks in the output file.Now you need to know the exact size of the disk, if you want to write the last 512kB. On linux, you can use the
blockdev --getsz DEVICE
command to get the size, in units of 512B.So the command-line becomes something like: