Site TIPS PAGE🔎 SEARCH  Ξ INDEX  MAIN MENU  UP ONE LEVEL
 OJB's Web Site. Version 2.4. Mac Tip.You are here: tip79 tips mac owen2 
Tip

Discuss   Up to OJB's Mac Tips List

Erase a Disk from Terminal

To erase a Disk from the Command Line...

Get disk identifier, use: diskutil info "DISKNAME" | grep "Device Node"
Then erase disk using: diskutil eraseDisk FILESYSTEM DISKNAME DISKIDENTIFIER

Where FILESYSTEM is JHFS+ (Journalled), HFS+, FAT32
DISKNAME is the name to be given to the disk
DISKIDENTIFIER is the ID returned above (eg /dev/disk6s2)

Erase volume example: diskutil eraseVolume JHFS+ Erased /dev/disk6s2
Erase disk example: diskutil eraseDisk JHFS+ Erased disk6

Related Tips

Secure Erase from El Capitan
Secure Erase Options
Secure Erase SSD






I usually write a blog post about once a week. The latest post can be viewed here: Think for Yourself: In the end, everything is just an opinion. Be skeptical, and think for yourself! (posted 2026-04-25 at 21:12:02). I do podcasts too! You can listen to my latest podcast, here: OJB's Podcast 2026-04-14 How Far is that Star?: How would we really know how big the universe is?
 Site ©2026 by OJBOJB's BlogWhy Macs are BestMade & Served on Mac 
Site Features: Blog RSS Feeds Podcasts Feedback Log07 Jun 2024. Hits: 1,000,115,618
Description: Mac TipID: 118   Status: PublicLoad Timer: 187ms