Меню Рубрики

Mac os unmount disk

Unmount a disk set or disk member using Disk Utility on Mac

You can unmount a disk set or a member disk if you need to repair it or perform other maintenance.

Unmount a disk set

In the Disk Utility app on your Mac, select the disk set that you want to unmount in the sidebar.

Click the Unmount button in the toolbar or beside the disk set name.

After unmounting a disk set, you can disconnect the disk members of the set from your computer.

Unmount a disk member of a set

In the Disk Utility app on your Mac, select the disk set that you want to unmount in the sidebar.

Click the Unmount button in the toolbar or beside the disk set name.

Disconnect the disk member that you want to unmount.

If you unmount and disconnect a disk and then reconnect the disk later, Disk Utility rebuilds the disk member automatically if you selected “Automatically rebuild” when creating the disk set. If you need to rebuild the disk manually, see Repair a disk in a disk set.

Источник

Mount & Unmount Drives from the Command Line in Mac OS X

You can mount and unmount drives, volumes, and disks from the command line of MacOS and Mac OS X.

For many users, the easiest way to unmount a drive in Mac is to either just drag a volume into the Trash, use the eject keys, disconnect the drive, or use one of the force eject methods. Along the same lines, if you want to remount a drive you can usually just physically unplug the drive and plug it back again. But what if you want to be able to mount, unmount, and remount drives from the command line? That’s exactly what we’ll cover here.

This trick works with external USB disks, hard drives, Firewire, Thunderbolt, DVD’s, CD’s, network drives, even USB thumb drives, literally any volume that can be mounted and accessed through the incredibly helpful diskutil command. By using the command line to remount the drive, the entire process can be completed remotely if necessary through SSH, and without ever having to physically disconnect a drive from the Mac. This is infinitely useful for troubleshooting situations, for scripting and automation, and it’s a great trick for those of us who just like to tinker around in Terminal.

How to Unmount a Drive from Command Line on Mac

Let’s first cover unmounting drives. To do this you’ll need another volume attached or connected to the Mac in some form or another, then launch Terminal to get started (sits in /Applications/Utilities/).

1: List All Drives

The first thing you’ll need to do is list the connected drives. This will provide a list of all drives that are attached to the Mac, that are either mounted and unmounted, and all of their respective partitions. We are doing this so we can get the drive identifier, which is typically something like disk1s2, or disk2s2, etc

The output will look something like this:

$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 120.5 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *16.0 GB disk1
1: EFI 209.7 MB disk1s1
2: Apple_HFS OSXDaily 15.7 GB disk1s2

For the sake of this example, we’ll focus on the attached drive named “OSXDaily”, which happens to be an external USB thumb drive that appears last in the list. Note the identifier for that drive is “disk1s2” and we’ll carry that to the next series of commands to unmount and remount it.

It’s probably worth mentioning that drives will always be located in /dev/ and thus /dev/ will always be prefixed to the identifier.

2: Unmount the Specified Drive

Still using the diskutil command, we’ll point it at the drive in question to unmount.

diskutil unmount /dev/disk1s2

This will report back the named volume and location has been unmounted, like so:

$ diskutil unmount /dev/disk1s2
Volume OSXDaily on disk1s2 unmounted

That’s all there is to it. You’ll notice the drive is no longer accessible in Finder, but it will still be visible through diskutil from the command line, or the more familiar Disk Utility app in Mac OS X’s GUI.

How to Mount a Drive from the Command Line on Mac

If you can unmount a drive, of course you can mount or remount one too. The command sequence is very similar; locate the volume, then mount the drive.

1: Find the Drive to Mount

If you already know where the volume is located, you can ignore part 1 and jump straight to part 2, but let’s cover retrieving the volume identifier anyway. This time around we’ll shorten it a bit because we’ll assume we know the name of the drive to mount, thus we only need to locate the identifier. We’ll do this by using grep to shorten the output of the diskutil command like so:

$ diskutil list |grep OSXDaily
2: Apple_HFS OSXDaily 15.7 GB disk1s2

That output is obviously much shorter than the full output of diskutil list which we showed above.

For this example, the drive “OSXDaily” is still located at /dev/disk1s2 and that’s what we’ll mount.

2: Mount (or Remount) the Drive

To mount (or remount) a drive, we’ll use the same diskutil command with a new flag and inputs like so:

diskutil mount /dev/disk1s2

Using the same examples as elsewhere, here is what the command and the output will look like:

$ diskutil mount /dev/disk1s2
Volume OSXDaily on /dev/disk1s2 mounted

This obviously mounts the drive again, and it will also make the mounted volume visible again in the Mac OS X Finder and to GUI-based apps in the various Open or Save dialog boxes.

How to Unmount & Remount a Drive / Volume in a Single Command

Want to quickly unmount and remount the same volume, essentially power cycling it’s connectivity to the Mac? You can do that in a single command by stringing the two together like so:

diskutil unmount /dev/disk1s2;diskutil mount /dev/disk1s2;echo «Remounted Volume»

This would look like the following when executed:

$ diskutil unmount /dev/disk1s2;diskutil mount /dev/disk1s2;echo «Remounted Volume»
Volume OSXDaily on disk1s2 unmounted
Volume OSXDaily on /dev/disk1s2 mounted
Remounted Volume

If you happened to be watching the volume in the Finder during this process, you would find it to disappear briefly, then reappear almost immediately. The last echo portion is optional but it makes the entire command action even more verbose.

Thanks to Nilesh for the tip inspiration

Источник

Как справиться с ошибкой «Couldn’t Unmount Disk» в Дисковой Утилите (Mac)

Как правило, проблем в работе Дисковой Утилиты в OS X практически не возникает. Тем не менее, в некоторых ситуациях пользователи сталкиваются со злосчастной ошибкой «Couldn’t Unmount Disk«, которая означает, что система не может «прочитать» диск. Данная ошибка чаще всего возникает при анализе и восстановлении диска, а также при разделении его на разделы и даже при форматировании. Однако не всегда понятна природа ошибки и способы борьбы с нею. Именно этой теме и посвящена сегодняшняя статья.

Причина возникновения ошибки кроется в загрузочной области диска; отсюда и сообщение «Couldn’t Unmount Disk», которое появляется, когда данные на диске заняты каким-либо из перечисленных выше процессов. Поэтому самый очевидный способ — это загрузиться с другого раздела/диска и запустить Дисковую Утилиту уже с него.

Таким образом, можно использовать два взаимозаменяемых решения, одно из которых более действенное, а другое помогает лишь время от времени.

Устранение ошибки с помощью загрузочной флешки

Этот способ является наиболее эффективным, поэтому мы рекомендуем в первую очередь именно его. Для этого необходимо предварительно создать загрузочную флешку. Как её сделать, вы можете прочитать здесь.

Шаг 1: Подключите загрузочную USB-флешку к вашему Mac и перезагрузите систему.

Шаг 2: Нажмите клавишу OPTION во время перезагрузки и выберите подключённую флешку.

Шаг 3: На экране выбора действия выберите «Disk Utility».

Шаг 4: Откройте «First Aid» и проверьте диск на ошибки (и исправьте их, при наличии таковых). Затем выполните действие, которое обычно приводит к ошибке «Couldn’t Unmount Disk«.

Устранение ошибки с помощью раздела восстановления

В каждой из последних версий OS X можно загружать систему через специальный раздел восстановления. Эта фишка может помочь в том случае, если ошибка возникает при форматировании не загрузочного раздела. Однако данный трюк не поможет в том случае, если ошибка возникла из-за попытки воздействия на загрузочную область.

Шаг 1: Перезагрузите систему и нажмите клавишу OPTION во время перезагрузки.

Шаг 2: Выберите опцию «Recovery partition».

Шаг 3: На экране выбора действия выберите «Disk Utility».

Шаг 4: Откройте «First Aid» и проверьте диск на ошибки (и исправьте их) либо отформатируйте диск.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • Mac os uninstall postgresql
  • Mac os turbo boost
  • Mac os ttl beeline
  • Mac os transformation pack для windows 10
  • Mac os time tracker