Просмотр подробной информации о диске в приложении «Дисковая утилита» на Mac
Можно получить подробную информацию о диске или томе на компьютере Mac, например:
местоположение диска или тома (внутренний или внешний);
объем доступного пространства — в него входит как свободное место, так и «очищаемая память», или пространство, которое система macOS освобождает при необходимости, удаляя лишние файлы с компьютера. Вы не можете вручную удалить файлы, занимающие «очищаемую память», но macOS удалит их, когда нужно будет место;
место подключения тома;
количество файлов и папок на диске;
отчет системы автоматического мониторинга (S.M.A.R.T.) — общая характеристика работоспособности диска.
Диск из группы логически соединенных томов
При создании раздела логического тома из группы логически соединенных томов с помощью diskutil, значения, отображаемые в полях «Доступно» и «Занято» отчета в Дисковой утилите, определяются по объему дискового пространства, занятого созданным Вами разделом логического тома. Например, если Вы создаете раздел логического тома размером 400 ГБ из группы логически соединенных томов объемом 1 ТБ, 400 ГБ дискового пространства, которые были использованы для создания раздела логического тома, будут отнесены в Дисковой утилите к использованному пространству, а оставшиеся 600 ГБ — к свободному пространству группы логически соединенных томов. При выборе раздела логического тока объемом 400 ГБ значения, отображаемые в этих полях, будут определяться по объему данных, имеющемуся в разделе логического тома.
В программе «Дисковая утилита» на компьютере Mac выберите пункт меню «Вид» > «Показать все устройства».
Выберите диск или том, затем нажмите кнопку «Информация» .
Pro Terminal Commands: Using diskutil
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.
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
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.
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:
diskutil partitionDisk MountPoint [numberOfPartitions] [APM|MBR|GPT] [part1Format part1Name part1Size part2Format part2Name part2Size part3Format 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. 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.
Как отформатировать носитель из Терминала на Mac
Иногда может потребоваться отформатировать диск с помощью командной строки, а не через графический интерфейс Дисковой утилиты. Дисковая утилита предоставляет много возможностей для управления дисками. Это простой и понятный инструмент для работы с внешними накопителями на Mac.
Тем не менее, функционал графического интерфейса сильно ограничен. Под ним спрятана мощная командная утилита, которая позволяет делать намного больше. Например, Дисковая утилита не даёт разбить диск с таблицей разделов Master Boot Record на разделы, а утилита командной строки даёт.
Команду можно удалённо запустить на десятках компьютеров одновременно или написать скрипт, который за несколько секунд приведет к единому состоянию несколько флешек или внешних дисков.
В то же время использование командной строки требует внимания и точности ввода параметров, чтобы гарантировать, что отформатирован будет именно тот диск и именно в том виде, в котором нужно.