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?
dd
would be slow in this instance.
You could install pv
(man page) with:
yum install pv
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
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.
If you wish to zero the whole drive now, simply do:
pv < /dev/zero > /dev/sdX
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] 삭제
몇 마디 만하겠습니다