• Sign in to Neowin Faster!

    Create an account on Neowin to contribute and support the site.

Sign in to follow this  

zeroing out the hdd with the dd-command . - some things we have encountered

Recommended Posts

tarifa    0

background: i have a mx-linux in a notebook - running as a live-dvd - before installation i want to zero out the 



root@mx1: /home/demo# dd if=/dev/zero of=/dev/sda bs=4096 count=4096

i get back: 

dd: failed to open '/def/zero/' : No such file or directory 

why do i get this error?

Well i allways thougth that this will zero out the first 16 MiB of the drive. 16 MiB is probably more than enough to nuke any "start of disk" structures while being small enough that it won't take very long.


dd if=/dev/zero of=/dev/sda bs=512 count=4096 seek=$(expr blockdev --getsz /dev/sda - 4096)

well - dear friends my question is hete the following; : What does this exactly? whi does it happen?

 

 

see the following comand 

blockdev --getsz gets the size of the block device in "512 byte sectors". 
So this command looks like it was intended to zero out the last 2 MiB of the drive.

Unfortunately this command is broken syntax wise. I expect the command was originally intended to be

 

 

and see this-, 

 


dd if=/dev/zero of=/dev/sda bs=512 count=4096 seek=$(expr `blockdev --getsz /dev/sda` - 4096)
and the backticks got lost somewhere along the line of people copy/pasting it between different environments.


love to hear from you +

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.