Erase External Hard Drive Mac Terminal

Connect the external backup hard drive to your Mac. Click the Time Machine icon from the Menu Bar and then select Enter Time Machine. Scroll your mouth to switch the Time Machine backups to find the one you need to delete. Click the Gear icon from the top menu of the backup and then select Delete Backup. If you have set a password for your Time. In response to IMRAN. There is a secure erase in Disk Utility for non SSD hard drives. 1 - select the disk in the sidebar. 2 - click on the Erase button: 3 - click on the Security Options button: 4 - select the level of secure erase in the next window: Again, that option does not appear if the disk is an SSD.

Jun 08, 2020 • Filed to: Solve Mac Problems • Proven solutions

Jul 07, 2020 Interactive mode lets you customize exactly how DBAN will erase files, as well as which hard drives it will wipe. You can get to this screen with the ENTER key from DBAN's main menu. If you don't want to do this, and would rather have DBAN erase all your files the easy way, restart this walkthrough at Step 4, and be sure to choose the F3 key. Jun 22, 2020 This post lists top 10 free hard drive data wipe software for Windows 10/8/7/Vista/XP. If you want to completely erase all data on hard disk, SSD, external hard drive, USB, etc. On Windows 10/8/7/Vista/XP PC, so as to prevent private data from leaking, you can check the tutorial below.

Every time you delete any file or document on the Mac hard drive it creates a free space. This free space can be utilized for storing other data. However, if this free space doesn’t get overwritten, then it can be used to retrieve the previous data that it held using a data recovery tool. Now, if you are selling the hard drive of your Mac and don’t want the person buying it to recover the documents that you deleted then you must erase free space on Mac hard drive. However, make sure that the erasure is done in a secure manner without damaging the hard disk.

Part 1: How to Erase Free Space on Hard Drives in Mac OS X

You will have to use the Disk Utility app provided by your Mac OS X to erase free space on Mac hard drive. It offers you the chance to overwrite on the free space left on your hard disk so that no one is able to retrieve the data that was previously stored on it. However, do keep in mind that this method for free space erasure is only applicable for traditional hard drive and won’t work on SSD versions that utilize flash memory.

  1. The initial step is to start the Disk Utility app. This app is located in the Utilities menu which can itself be found in the Applications menu. You can use the Launchpad for launching this app as well.
  2. If the hard drive whose free spaces you want to erase is an external hard disk then you would have to connect it to the Mac and then select it from the menu located on the left-hand side of the screen.
  3. Click the Erase free space button after opening the Erase tab.
  4. Pick the level of erasure you want and the click the Erase free space to start the overwriting process on the hard drive’s vacant spaces.
  5. There are three different erasure options available to you which are Fastest, Secure and Most Secure. Fastest option overwrites the free space just once while Secure and Most Secure options do that three and seven times respectively.
  6. Select any of the erasure options that you like and then click the Erase free space button.

Part 2: How to Secure Erase Free Space on Hard Drives in Windows

Although the Disk Utility app of Mac OS X can erase free space on Mac hard drive, there is a chance that it might not be able to do so in a secure manner. To make sure that the erasing of the free space is completed without any damage to the hard drive then using a data erasure tool is the best option. There are various such tools available on the internet but the best one among them is Stellar BitRaser for File. It has the capability to secure erase free space on hard drives and ensure that the deleted data can’t be recovered.

  • Completely erases the data, ensuring that it can’t be recovered using any data recovery tool.
  • Supports multiple data erase algorithms which can be used for erasing data.
  • Provides a search feature for quickly search the file or document which needs to be erased from the hard drive.
  • Offers the chance to erase the chat history of messaging services like Yahoo and Skype.
  • Capable of erasing all traces of internet activity including the internet history maintained by popularly used browsers.

Step 1: Download Stellar BitRaser for File on your Windows PC, take out the hard drive on Mac and connect it to Windows computer.

Step 2: Click the 'Erase Unused Space' option on the left, to select your Mac hard drive.

Step 3: Selected your Mac hard drive and click 'Erase Now' button to process.

Step 4: After a while, the Mac hard drive erase complete and you can reboot the system.

While other data erasure tools take several passes to erase the free space on a hard drive, Stellar BitRaser only requires a single pass to erase it permanently. However, if you feel the need to take another pass then you can take two more passes. This will ensure beyond doubt that the free space on your Mac hard drive is erase forever.

Wipe External Hard Drive

In order for you to use Stellar BitRaser for File to erase free space on Mac hard drive, you need to take it out from your Mac first. The reason for this is that this data erasure tool isn’t compatible with Mac OS X and works only on Windows. So, you need to connect the Mac hard disk to a Windows PC before you erase the free spaces on it using Stellar BitRaser for File.

In short, deleting data on the Mac hard drive doesn’t securely erase it. It just creates free space which can be used for recovering the deleted data using a data recovery tool. So, you need to erase free space on Mac hard drive. The Disk Utility app of Mac OS X can be used for erasure of these free spaces. However, for secure erasure, you need to make use of a reliable data erasure tool like Stellar BitRaser for File. It can erase the vacant spaces on your Mac hard drive and make sure that the data that they contained previously can’t be retrieved using any professional Mac data recovery tool.

What's Wrong with Mac

Recover Your Mac
Fix Your Mac
Delete Your Mac
Learn Mac Hacks

There are mainly two reasons why you want to restore your Mac to factory settings and erase everything.

  • You want to erase your MacBook Pro/Air, MacBook, iMac to sell or give away the Mac.

  • Your Mac is running slow or having other problems so that you want to delete everything on Mac to start over.

It is not difficult to erase everything on a Mac and reformat the MacBook or iMac. But if you want to reset MacBook Pro/Air, iMac without losing data, or securely and completely wipe a Mac, there are a couple of things you should do. Just follow this guide to complete all the steps that are needed to securely and completely erase everything on Mac. Your Mac will be restored to factory settings after that.

Step 1: Back Up Your Mac Before Factory Reset

I believe that there must be some important files on your Mac. Therefore, it is a must to back up your files before erasing your MacBook or iMac. There are mutiple options to back up your Mac:

Move everything that are important to you to an external hard drive. It is time-consuming but feasible if you have limited documents, photos, videos, etc. that need to be backed up before erasing Mac.

Back up your files on Mac to a cloud storage, such as iCloud. Before doing that, make sure your iCloud account have enough free space.

Make a copy of your Mac data to an external hard drive with a backup program, such as Time Machine, Apple's built-in backup tool for Mac. Learn about the steps to back up a Mac: How to Backup Your Mac with or without Time Machine.

You can wipe a Mac without losing data by using one of the backup methods mentioned above. And to reduce the size of your Mac's backup and incease the backup speed, it is recommended to clean useless junk files on your Mac before a Time Machine or iCloud backup. FonePaw MacMaster can easily delete caches, logs, borwsing history, duplicate files and photos, large files, useless apps and more from your Mac.


  • Download and run FonePaw MacMaster on your Mac.

  • Select the file type you want to clean, such as system junks, duplicate photos. Click Scan.

  • Click Clean to remove the junks you don't need.

Go ahead to back up your Mac. The backup will be finished more quickly, taking less space of your external hard drive or iCloud account.

Erase External Hard Drive Mac Terminal Free

Step 2: Completely Delete Private Files

Do you know that files on Mac are actually recoverable after factory reset? That's right. Even though you have reformatted your Mac and erased everything on Mac, it is still possible to recover the erased files on the Mac with a professional data recovery program such as FonePaw Data Recovery. If you have confidential files on your Mac and don't want to take the risk that somebody may find the files from the reformatted Mac after performing data recovery, you can use Eraser on FonePaw MacMasterto securely delete confidential files on your Mac before factory reset. The Eraser can erase the trace of a file on the hard drive and make it unrecoverable.

  • Install FonePaw MacMaster on your Mac.

  • Click Eraser and select the files you want to destroy.

  • Click Erase to make it unrecoverable.

Step 3: Turn off FileVault

FileVault encryption is an Apple built-in feature that is designed to encrypt your hard drive and files on the hard drive. It is recommended to turn off FileVault before reset and clean install macOS system. Here are the stpes to disable FileVault encryption.

  • Open System Preferences > Security & Privacy.

  • On the Security & Privacy window, click the FileVault tab.

  • Click Lock button and you will need to enter password of the administrator account the unlock FileVault settings.

  • After entering the password, you are able to click Turn Off FileVault. Click it.

All files on your Mac will be dencrypted after FileVault is off.

Step 4: Remove iTunes Authorization and iCloud Account

You don't want your iTunes or iCloud account to be linking to your MacBook or iMac if you decide to sell it or give it away. You can authorize only 5 computer with your iTunes account so you don't want to lose an allocation to a Mac that you no longer own. So before erasing your MacBook or iMac, you should first deauthorize iTunes and disable iCloud on your Mac.

Deauthorize iTunes on Mac

  • Open iTunes on Mac.Click Account > Authorizations > Deauthorize This Computer.

  • You'll need to enter the password of your Apple ID. Then click Deauthorize.

Erase Mac Hard Drive

Sign out of iCloud on Mac

  • Open System Preference > iCloud. Click Sign Out.A window will pop up, asking whether you want to keep a copy of your iCloud data on the Mac.

  • Deselect all the options and click Continue, which will ensure that your iCloud data won't stay on the Mac.

Also, don't forget that your iCloud account can also be used to receive iMessage. So run Messages, click Preferences > Accounts to sign out of iMessage.

Step 5: Erase MacBook, MacBook Air/Pro, iMac

App To Erase Hard Drive Mac Download

After finishing the above steps, you are now offically able to wipe your MacBook, MacBook Pro, MacBook Air or iMac. You need to erase your Mac in recovery mode.

Erase External Hard Drive Mac Terminal Download

Enter your Mac into recovery mode

Power off your Mac and then reboot it. As it is rebooting, press and hold Command + R (Option + Command + R or Shift + Option + Command + R) until you see the Apple logo.

Generally you can use Command + R combination to enter the Recovery mode. If you need to upgrade you need to the latest macOS compatible with your Mac, use Option + Command + R; If you want to clean install the macOS that came with your Mac, use Shift + Option + Command + R.

Erase everything on your Mac

When you are in recovery mode on Mac, you will see the macOS Utilities menu. Select Disk Utility.

Select the disk to erase. To erase everything on your Mac, you usually should choose the main hard drive named Macintosh HD.

If the Mac is running High Sierra or later, Disk Utility will show all the Macs linked with your Apple ID under Macintosh HD. So be careful not to delete the drive of other Macs.

Click Erase. Then you need to enter name and format of the drive. You can choose either APFS or Mac OS Extended (journaled) to reformat the Mac. APFS is a new file system introduced by Apple since High Sierra, which is more recommendable.Click Erase to begin wiping everything on your Mac.

Step 6: Reinstall macOS on MacBook, iMac

After deleting everything on your Mac, you can now reinstall macOS. Go back to macOS Utilities menu. Select Reinstall macOS and follow the on-screen instructions to finish.

That's all about how to factory reset your Mac and erase everthing. If you have more question, drop it in the comment section.

How To Erase Hard Drive Mac

Rating: 4.2 / 5 (Based on 63 ratings)Thanks for your rating.
Securely clean up the junk files, big files, unneeded files on your Mac to speed it up.

Erase Hard Drive Mac Without Disk

Hot Articles
My Mac Running Slow, Here is Why and How
How to Reset Safari Browser on Mac
How to Format A Hard Drive for MacOS
SOLVED: White Screen on Mac Computer
Unfreeze Mac: Ways to Fix Frozen Mac
Mac Won't Turn On? Here Are Fixes
RE: How to Fix MacBook Stuck on Loading Screen
Mac Screen Goes Black? Here's Why and How
Startup Disk Full on MacBook Pro/Air, How to Clean Startup Disk
What Is the Other in Mac Storage and How to Delete Other on Mac

The Terminal is a useful application in your macOS that allows you to access macOS features and APIs through the command-line interface. You can open the Terminal app on your Mac by launching Finder from Dock and then navigating to Applications >Utilities >Terminal.

Image: Launch Terminal app

Terminal helps you manage your external hard drive far better than the GUI. All you need to do is enter the required Terminal command, then hit Return. The app will execute the requested command immediately. But, Terminal won’t show any warning while executing any commands.

So, back up your Mac before using Terminal to avoid data loss due to the remove command's accidental use. The backup ensures you can restore data in case of any data loss event. And suppose you didn’t back up your data and executed some unsafe commands that resulted in a data loss disaster. In that case, you can still recover your data using data recovery software.

The next sections describe commonly used Terminal commands and free Mac data recovery software to salvage your lost data.

View Your External Drive Using Terminal

The first thing you would like to do with your external drive is to view it using Terminal. The command line to view the list of all your connected drives is as follows.

diskutil list

Erase External Hard Drive Mac Terminal Without

Image: diskutil list

This command will return all the mounted or unmounted drives and their partitions. Alternatively, you can look for the external hard drive using the following command:

Erase External Hard Drive Mac Terminal Software

ls /Volumes

Please note down the external hard drive's identification; a sample DriveID could be /dev/disk2. The correct DriveID is required to manage your external hard drive using Terminal.

Unmount or Mount External Drive Using Terminal

In GUI, you need to plug the external hard drive into your Mac to mount it automatically while drag and drop the drive icon to Trash to eject or unmount it. To remount the drive, you require to unplug the drive and plug it again.

But you can easily unmount and remount your external hard drive using the Terminal command without the need to reconnect the storage device. The Terminal command to unmount an external drive is shown next:

diskutil unmount $DriveID

If the above method doesn’t work, you can force unmount the drive. The Terminal commands to unmount an external hard drive forcefully is shown next:

Delete External Hard Drive Partition Mac Terminal

diskutil unmount force $DriveID

Image: Unmount disk command

To mount the external hard drive once again, enter the following command:

diskutil mount $DriveID

Image: Mount disk

The storage drive will mount on your Mac, and you can access all the stored content.

Delete Files/Folders from External Drive Using Terminal

When you remove any file or folder using Terminal, it won’t move to Trash and is removed permanently. So, backup your external hard drive to yet another storage medium to preempt data loss. The Terminal commands to delete a file from an external drive is shown next:

rm $FilePath

Here, replace the $FilePath with the path of the file that you want to remove permanently. In case you want to remove a folder instead of a file, you need to use the remove command recursively. The Terminal commands to delete a folder from an external drive is shown next:

Image: use rm command to remove files

rm -r $FolderPath

Replace the $FolderPath with the path of the folder that you want to delete.

Verify and Repair External Drive Using Terminal

When an external hard drive is not working as expected or is corrupt, you can verify it using Terminal and repair it when needed. The command to verify an external hard drive is shown next:

diskutil verifyVolume $DriveID

Image: Verify your drive

If the command doesn’t show any message, it means no error is found. Else, you need to repair the Mac drive. The terminal command to repair the external hard drive is as follows:

diskutil repairVolume $DriveID

Image: Repair Mac External Drive

When the repair succeeds, you can access your storage drive without any issue. Else, erase the drive to create a new file system.

Erase External Drive Using Terminal

You need to be more cautious while erasing your external drive using Terminal. Because the use of the erase command on a wrong drive can result in a data loss disaster. So, back up your data before executing the command. The Terminal commands to erase an external hard drive is shown next:

diskutil eraseDisk $FileSystem $DriveName $DriveID

Image: Erase External Hard Drive

Here, replace the entities with the required file system (APFS, JHFS+, HFS+, FAT32, or ExFAT), drive name, and drive identification. The command will erase the external drive and format it to the specified file system. Later, you can restore the backed-up data to the newly formatted drive.

Recover External Drive Data Using Mac Data Recovery Software

When you have accidentally lost data due to unsafe Terminal command, employ free Mac data recovery software to recover it on Mac. The steps are as follows:

How To Erase External Hard Drive

  • Install and launch Stellar Data Recovery Free Edition for Mac on your MacBook Air/Pro, iMac (Pro), or Mac mini.

Image: Recover external drive

  • Watch this video guide to recover your lost data on Mac running on macOS Big Sur or earlier.
*Stellar Data Recovery Free Edition for Mac is useful for scanning your Mac external drive, previewing files, and recovering up to 1 GB of files without any cost. To recover more,upgrade the software to Professional or Premium edition. Also, the software offers a 30-day money-back guarantee, just in case.


Erase external hard drive mac terminal software

Now you know how to manage your external hard drive with Terminal commands on Mac. You can view, unmount, mount, repair, and erase your external hard drive or delete files from it. In case of accidental data loss, use a free data recovery software for Mac to recover your deleted or lost files.