diskutil is the command line version of Disk Utility, the macOS application used to manage hard drives. Just like Disk Utility, you can use the command to format disks, erase drives and more. Once you’re familiar with it, you’ll find that the command is often more powerful and faster than Disk Utility, with more features to boot.
![Command Prompt Bootable Drive Mac Os Command Prompt Bootable Drive Mac Os](/uploads/1/2/7/2/127250834/956880974.jpg)
Sep 26, 2018 Much like prior versions of Mac OS, you can easily create a bootable install drive for MacOS Mojave 10.14. These boot install drives allow for things like easily formatting a Mac to perform a clean install of macOS Mojave, installing macOS Mojave onto multiple Macs without them each having to download the installer, or even as a troubleshooting tool since it can be booted from by any. May 15, 2020 Creating the bootable OS X El Capitan installer will erase the USB flash drive you're using. Before you proceed, make sure you have a backup of the flash drive's contents or that you don’t care that the data will be erased. Use Terminal to Create the El Capitan Bootable USB Installer Connect the USB flash drive to your Mac.
Getting Acquainted with diskutil
If you simply type
diskutil
into the command line and press Enter, you’ll receive a list of “verbs” that diskutil
can operate on.Just like in the English language, these verbs are things that
diskutil
can accomplish. The most basic verb for diskutil
is list
, which you’ll enter like so:This command will list all the disks attached to your machine. It indicates information like partitions, format and, importantly, mount points. The mount points start with
/dev/disk
and are used to specify disk operations in diskutil.
Partitions (called “volumes” in diskutil
parlance) are specified by their identifier on the right.Disk identifiers follow the format disk_s_, where the underscores are replaced with identifying numbers.
Using verbs
We can use the other verbs to get more information about our drives and run specific operations.
The info verb gets more information about a specific disk (disk1, in this case). Use the mount point to specify the target disk to grab information on. You’ll see tons of stuff you might care about and a lot of stuff you won’t. This is the most information you can get about your disk in one place, and it’s helpful when troubleshooting drive problems.
Unmounting and Ejecting with diskutil
The
umount
verb unmounts a specified volume. Unmounting is just like ejecting a volume from Finder, but it can be done to internal disks. In this example, I’ve specified the volume I want to unmount with the disk identifier. You can also specify the volume using the partition name. Unmounted disks become inaccessible via Finder, but they can still be seen via diskutil list
and manipulated with other diskutil
commands. Also, note the command is umount
, with no “n”.The
unmountDisk
verb is similar to umount
, but it unmounts an entire disk instead of one volume. Disks are specified with their mount point, as seen above. You can’t unmount your boot disk or volume, and you’ll get an error if you try to unmount a disk or drive that’s currently in use.The
eject
verb is a lot like unmounting a drive, but only for removable disks. Removable disks are things like USB hard drives and flash drives. If it connects through an interface on the outside of your computer, it qualifies as a removable drive. Once a drive is ejected, it won’t appear in Finder or diskutil list
until it’s physically unplugged and plugged in to its interface again.The
mount
verb is the inverse of the umount verb. It mounts volumes on internal disks manually. Only unmounted volumes can be mounted, obviously. To mount all volumes on a disk, use diskutil mountDisk disk1
, for example.Fixing Problems with diskutil
The
verifyVolume
verb will run a verification pass on a specific volume. Verification involves checking the contents of the disk against the expected values. If any mismatches are found, the disk will be identified as in need of repair.If it turns out that your volume needs to be repaired after you’ve verified it, you can run the repairVolume verb. This will run a repair pass on the volume and attempt to fix any problems found in the verification process.
Format and Erase Drives with diskutil
The eraseDisk verb handles reformatting disks, which erases all data and volumes on a single disk. The verb takes as inputs the format, new disk name and disk identifier, in that order. This example will erase disk2 and reformat it as journaled HFS+. The new disk will have one volume named
![Mac Mac](/uploads/1/2/7/2/127250834/402037590.jpg)
The
reformat
verb will erase a single volume on the disk while keeping the same name and format. It rewrites the same file system that the volume started with, resetting the volume to a blank state.Mac Os Bootable Flash Drive
Partition Drives with diskutil
The partitionDisk verb runs an command-line version of Disk Utility, allowing you to create multiple partitions on a single disk. It’s a little complicated, but it follows this format for it’s arguments:
Mac os x unmount network drive command line. You must be set up in Users & Groups preferences with this Apple ID, on both this Mac and the other Mac.If necessary, enter your user name and password, then select the server volumes or shared folders.To make it easier to connect to the computer in the future, select “Remember this password in my keychain” to add your user name and password for the computer to your keychain. Here are some ways to make it easy to reconnect to shared computers and servers you frequently use:On your Mac, do any of the following:.Choose Apple menu Recent Items, then choose from the list of recent servers.In the Finder, choose Go Connect to Server, click the pop-up menu to the far right of the Server Address field, then choose a recent server.Add shared computers, network areas, and workgroups to the. Select the item, then choose File Add To Sidebar.Add a shared computer or server to your list of favorites. If “Only these users” is selected on the other Mac, make sure the login name you’re using is on the list of allowed users.Using an Apple ID: Connect to the other Mac using an Apple ID.
diskutil partitionDisk MountPoint[numberOfPartitions] [APM|MBR|GPT] [part1Format part1Name part1Size part2Format part2Name part2Sizepart3Format part3Name part3Size ..]
Partition sizes can be specified in gigabytes with the G suffix (2 G) or terabytes with the T suffix (2 T). My favorite way to specify partition sizes, however, is with percentages (25%, for example). The size of the final partition can be specified with “R” to indicate that it should take up the remainder of the disk.
For example, the following command will create three partitions:
They’ll be formatted with JHFS+, APFS and ExFAT, and named Volume1, Volume2 and Volume3 respectively. Dual boot windows 7 mac os x separate hard drives free. Volume1 and Volume2 will each take up 25 percent of the disk, and Volume3 will occupy the remainder. It will also use the GUID Partition Table (GPT) which is one of the more flexible partition table options.
You can see the results of the operation at the end of the Terminal window to determine everything went okay. Using
partionDisk
isn’t the easiest way to partition a disk, but if Disk Utility is complaining, its a good alternative.You might also like:
Terminal Tips: Making Terminal More User-Friendly
Getting Started with Terminal: Using Grep to Search Files
Getting Started with Terminal: Must-Know macOS Terminal Commands
By default, your Mac starts up from its built-in hard disk, but a startup disk can be any storage device that contains an operating system compatible with your Mac. For example, if you install macOS on an internal or external drive, your Mac can recognize that drive as a startup disk. You can then follow the steps in this article to start up from it.
Use Startup Disk preferences
When you use Startup Disk preferences to select a startup disk, your Mac starts up from that disk until you choose a different one.
- Choose Apple menu > System Preferences, then click Startup Disk.
- Click the lock and enter your administrator password.
- Select your startup disk, then restart your Mac.
If you see a message that your security settings do not allow this Mac to use an external startup disk, check the External Boot setting in Startup Security Utility.
Use Startup Manager
When you use Startup Manager to select a startup disk, your Mac starts up from that disk once, then returns to using the disk selected in Startup Disk preferences.
- Press and hold the Option (Alt) key immediately after turning on or restarting your Mac.
- Release the Option key when you see the Startup Manager window.
If your Mac is protected by a firmware password, you can release the key when you're asked to enter the password. - Select your startup disk, then click the arrow under its icon, or press Return.
If you press and hold the Control key during this step, your selection is saved in Startup Disk preferences, so it persists until you change it.
If your Mac is using OS X Lion 10.7.3 or later, you can also use this method to start up from your Time Machine backup disk. Startup Manager identifies your Time Machine backup as ”EFI Boot.”
If you can't select your startup disk or start up from it
Check for these possibilities if you can't see your disk in Startup Disk preferences or Startup Manager, or your Mac won't start up from it.
Check for a compatible operating system on the startup disk
Command Prompt Bootable Drive Mac Os Drive
Make sure that your startup disk is using a version of macOS that is compatible with your Mac.
To start up from an external disk with macOS Catalina 10.15 or later, the disk must connect via USB-A, USB-C, or Thunderbolt, not FireWire.
Check startup security settings
If you're using a Mac that has the Apple T2 Security Chip, check the settings in Startup Security Utility. These settings determine whether your Mac can start up from another disk.
Check for Option ROM firmware
If you're in Startup Manager and can't see a third-party startup disk, the startup disk could be using Option ROM firmware. To enhance system security, Mac computers with up-to-date software don’t show devices that use Option ROM firmware until you load their firmware. To do that, press Option-Shift-Command-Period while in Startup Manager. If your startup disk appears, do that each time you want to start up from it or from another disk connected to it.
If you're using a firmware password, the ability to load Option ROM firmware is disabled as an additional security protection.