1

I want to wipe a partition quickly.I search the answer in website. such as: dd if=/dev/zero of=/dev/sda1 bs=16M count=96

shred -v -z -n 1 /dev/sda1

But:

All the commandline,will overwrite with value zero though there is zero. I think in the partition somewhere have value,but somewhere also have zero.

Want: Just use commandline but not GUN.Because ddrescue Need to compile and install

dd or shred or other command just overwrite zero to where that there's value is not zero in a partition in Linux.


Update:

My understand is in below

Now:

ddrescue -b 1572864 --generate-mode /dev/zero /dev/sda1 flash.map 
// This will create a flash.map 

ddrescue -b 1572864 --force --fill-mode=+ /dev/zero /dev/sda1 flash.map
//will to fill the patition by flash.map 
//1572864byte =16M*96 

It's right?What about my understand?

  • I am sorry. I got it.My understand is in below Now: ddrescue -b 1572864 --generate-mode /dev/zero /dev/sda1 flash.map // This will create a flash.map ddrescue -b 1572864--force --fill-mode=+ /dev/zero /dev/sda1 flash.map //will to fill the patition by flash.map //1572864byte =16M*96 It's right?What about my understand? Thanks Zchme, Kamil Maciorowski! – Zchme Apr 16 at 16:51
  • This 1572864 certainly looks wrong. It should probably be either 512 or 4096. – Kamil Maciorowski Apr 16 at 16:59
  • I don't understand.I have watch the manual about ddrescue -b bytes --sector-size=bytes Sector (hardware block) size of input device in bytes So my patition size is 16M*96 =1572864byte I have no idea.And I want a not need to compile and install commandline. Thanks Kamil Maciorowski again! – Zchme Apr 16 at 17:11
  • (1) Sector size and partition size are two different things. (2) Is 16M*96 really 1572864 bytes? (is 16M in your calculation 16MiB or what?) (3) Either way the partition seems relatively small (right?); if so, I wouldn't bother and I would just write zeros to the entire partition. – Kamil Maciorowski Apr 16 at 17:22
  • Thanks Kamil Maciorowski! I got it.I am sorry for the website rules.I will follow it. – Zchme Apr 17 at 16:55