0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【2025年09月版】macOS で ディスクの消去のメモ

Posted at

はじめに

不良セクタが見つかったNVMeを捨てる前に消去したいんだけど、コマンド忘れた。。。のメモ

diskutilで 対象を見つける

diskutil list

ここでは、/dev/disk4 が対象だったとする

アンマウントしておく

diskutil unmountDisk /dev/disk4

消去する

diskutil eraseDisk で消去する場合

ゼロ1回書き込み(セキュア消去レベル1)

diskutil secureErase 1 /dev/disk4

消去のオプションについて

0 : データのみ削除(通常のクイックフォーマット)
1 : ゼロ書き込み1回
2 : 擬似ランダムデータ書き込み1回
3 : 7回書き込み(DoD 5220-22 M 規格)
4 : 35回書き込み(Gutmann メソッド)

dd で消去する場合

ゼロ書き込み

sudo dd if=/dev/zero of=/dev/disk4 bs=1m status=progress

ランダムデータ書き込み

sudo dd if=/dev/random of=/dev/disk4 bs=1m status=progress

さいごに

簡単でしたね

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?