How to zero a disk + verify it afterward?

yael

We have a relatively large disk on our Linux machine, 2.5TB in size.

We want to completely format (zero-out) this disk; say the disk is /dev/sdX.


We would like to achieve this with dd, for example:

dd if=/dev/zero of=/dev/sdX bs=1M count=1

My question is: Does dd also support such a formatting (cleaning) of disks with large sizes?

Additionally, what could be the verification method after such dd operation, in order to see if the disk has really been zeroed?

LinuxSecurityFreak
  1. dd would be slow in this instance.

    You could install pv (man page) with:

    yum install pv
    
  2. pv could be faster and I would suggest scrambling instead of zeroing, first, (if you are serious about the data erasure, that is):

    pv < /dev/urandom > /dev/sdX
    
  3. There is no need of checking if this has been done. In this instance, where we would be scrambling instead of zeroing, there is no way anyways.

  4. If you wish to zero the whole drive now, simply do:

    pv < /dev/zero > /dev/sdX
    
  5. If the drive has been zeroed, now you can check if it's really zeroed with:

    pv /dev/sdX | tr --squeeze-repeats "\000" "Z"
    

    Example output:

    1,00MiB 0:00:00 [ 202MiB/s] [=============================>] 100%            
    Z
    

    Noticed the one and only letter Z as the output? That's what you're looking for in here.

    Taken from https://superuser.com/a/559794/402107

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to verify zswap running?

분류에서Dev

How to verify if a list is sorted?

분류에서Dev

How to detect if a disk is seeking?

분류에서Dev

How to thin the disk

분류에서Dev

How to verify if a key is into array in Behat

분류에서Dev

How to zero a dynamic array?

분류에서Dev

IOCTL_DISK_VERIFY는 무엇을합니까?

분류에서Dev

How to grow xfs formated disk?

분류에서Dev

How to select disk using Filesystem

분류에서Dev

How to mount partition from disk

분류에서Dev

How to install Ubuntu on part of the disk?

분류에서Dev

How to improve disk space usage?

분류에서Dev

How to compare signal to zero in vhdl?

분류에서Dev

How to verify if a reboot was due to power outage?

분류에서Dev

How to verify the integrity of a tar.gz file?

분류에서Dev

How to verify the user input in a textfield to compare it with a variable?

분류에서Dev

How to verify the machine configuration using PhantomJS

분류에서Dev

How to patch and verify if a Class was instantiated with a specific parameter?

분류에서Dev

How to verify checksums on-line in brtfs?

분류에서Dev

How to verify if specific date is monday in php

분류에서Dev

Can't run dd from /dev/zero to new added hard disk /dev/sdb on CentOS 7

분류에서Dev

Piping data to a process's stdin without causing EOF afterward

분류에서Dev

How to replace non-zero elements randomly with zero?

분류에서Dev

LVM - how is data allocated between disk

분류에서Dev

How to enable persistent option in disk creator?

분류에서Dev

How to enable persistent option in disk creator?

분류에서Dev

How To Mount A Disk Image On Android With Terminal?

분류에서Dev

How to select a boot disk wie pxelinux

분류에서Dev

how to use the currently unused space on a virtual disk?

Related 관련 기사

뜨겁다태그

보관