How to Format an External Disk for Time Machine Backup Using the Terminal on macOS
Are you having trouble setting up an external drive for Time Machine backups? Sometimes, leftover partitions can cause issues, but with macOS Terminal, you can completely erase the disk and format it properly in just a few steps.
Steps to Format the Disk Using the Terminal
-
Open Terminal:
You can find Terminal by searching with Spotlight or navigating toApplications > Utilities > Terminal
. -
List All Disks:
To identify your external drive, use the following command to list all connected disks:diskutil list
Look for your external drive in the list (it may appear as something like /dev/disk2).
- Erase and Format the Disk:
Once you have identified your external drive, you can use this command to erase all partitions and format it for Time Machine:
diskutil eraseDisk APFS TimeMachine GPT /dev/disk2
Make sure to replace disk2 with the correct identifier from the previous step. If you’re using an older version of macOS, you can use HFS+ (Mac OS Extended) instead of APFS.
- Set Up Time Machine:
Once the disk is formatted, go to System Settings > Time Machine and select your external drive to start backing up your data.
Breakdown of the Command
Let’s break down the command so you can understand what’s happening:
• diskutil: The macOS command-line tool for managing disks and volumes. • eraseDisk: This option erases the entire disk, including all partitions. • APFS: Apple File System, recommended for Time Machine. Use HFS+ if you need backward compatibility with older macOS versions. • TimeMachine: The name you want to give the volume. Feel free to change this to any name. • GPT: Stands for GUID Partition Table, the partitioning scheme required for macOS. • /dev/disk2: The identifier of your external disk. Be sure to double-check this to avoid erasing the wrong drive!
By following these steps, you can easily set up your external drive for Time Machine backups using the macOS Terminal. This method is efficient, and you won’t have to deal with partitioning issues again!
Happy backing up!