1 Replies - 174 Views - Last Post: 16 July 2019 - 04:47 PM

#1 sayhello   User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 261
  • Joined: 12-November 17

encountering issues with the dd-command

Posted 16 July 2019 - 04:18 PM

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



[email protected]: /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)

Q: What does this exactly?

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

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

Is This A Good Question/Topic? 0
  • +

Replies To: encountering issues with the dd-command

#2 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6822
  • View blog
  • Posts: 31,455
  • Joined: 10-May 07

Re: encountering issues with the dd-command

Posted 16 July 2019 - 04:47 PM

View Postsayhello, on 16 July 2019 - 07:18 PM, said:

[email protected]: /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?


issue ls -l /dev/zero & see if it's a thing, & if so, what it is.

What's weird is that your if has an argument if "/dev/zero" (file, not directory) & you're printed error is "/def/zero/" (directory, not file.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1