As a Mac user, you may have encountered the “Couldn’t open device.: (-69877)” error while attempting to erase a disk in Terminal or Disk Utility. This error message can appear when you try to erase an internal hard drive or an external storage device, such as an SD card, USB flash drive, or external hard drive.
In this article, I’ll provide a thorough analysis of the potential causes of the “couldn’t open device.: (-69877)” error and offer a range of solutions that you can try to resolve it.
Why Error: -69877: Couldn’t Open Device Occurred?
Below are the most frequent reasons why Couldn’t open device.: (-69877) error occurs:
Disk Is in Use and Cannot Be Unmounted
If other programs or processes are accessing the disk, it may be impossible to unmount the disk, and an error message like “couldn’t open device 69877” may be displayed. One example of this is when the disk is being used by FileVault, which is a security feature that encrypts the contents of your hard disk.
No Write Access to The Drive
In order to modify the contents of a drive, you need to have write access to it. If you don’t have the necessary permissions, you may encounter the “couldn’t open device 69877” error when attempting to make changes to the drive.
Physical Issues with The Drive or It Being Locked
If the drive itself is damaged or physically locked, it may be impossible to access it and the “couldn’t open device 69877” error may be displayed.
Hardware Issues with The Drive
If there are issues with the hardware of the drive, it may be unable to be accessed and the “couldn’t open device 69877” error may be displayed.
5 Potential Solution to Fix the Error “Couldn’t open device.: (-69877)”
Below are the potential solutions to counter this error:
Solution# 1: Allow Sharing and Permission
I recommend you first check and configure the drive’s permissions. To do this, follow these steps:
- On the desktop, locate the icon representing the drive, right-click it, and pick the “Get Info” option.
- In the box labeled “Get Info,” locate the “Sharing & Permissions” section and click on it.
- If the “Read & Write” access for the disc has not been granted to your account, click the lock icon in the lower right corner of the window and enter your administrator password.
- After that, set your account’s privilege to “Read & Write.”
- Now, close the “Get Info” screen, then make another attempt to delete everything on the disc.
Solution# 2: Restart your Mac in Safe Mode
While your Mac is starting, hit the shift key to restart it in Safe Mode. This will prevent third-party extensions from loading and may resolve the issue.
Solution# 3: Unmount The Drive in the Terminal
- Launch the Terminal application by navigating to the Applications > Utility folder on your computer.
- In Terminal, enter the command:
diskutil list
- Make a note of the identifier for the drive you want to erase, such as “disk2.”
- To unmount the drive, enter the following command, replacing “disk_identifier” with the identifier for the drive:
diskutil unmountDisk /dev/disk_identifier
- To erase the drive, use the following command, replacing “file_system,” “disk_name,” and “disk_identifier” with the desired file system, name for the drive, and the identifier of the drive, respectively:
diskutil eraseDisk file_system disk_name /dev/disk_identifier
- For example, if the drive identifier is “disk2,” you want to name the drive “Storage,” and reformat it as ExFAT, you should use this command:
diskutil eraseDisk ExFAT Storage /dev/disk2
If the error persists, you may want to try formatting the drive with a different file system like MS-DOS (FAT) first, and then reformatting it with the desired format.
Solution# 4: Use macOS Recovery to Erase the Drive
One way to fix the “Couldn’t open device.: (-69877)” error when trying to erase a drive on a Mac is to use macOS Recovery Mode.
The process for doing this is as follows:
- Enter Recovery Mode on your Mac. On an Intel-based Mac, restart the computer and hold down the Command + R keys when the screen turns black
- Press and hold the power button on an Apple Silicon Mac until the message “Loading startup options” appears, then choose Option> Continue
- From the screen labeled macOS Utilities, choose the Disk Utility option
- Select the external drive you want to wipe from the list on the left
- Select the Erase option
- Choose the file system and name of the drive
- Click Erase again to begin the process
Solution# 5: Disable FileVault Temporarily
- Launch the System Preferences
- Select the Security & Privacy button
- Choose the Filevault tab
- To make changes, click the lock icon that is located in the bottom left corner of the screen.
- Enter your password to access FileVault configuration options
- To deactivate FileVault, choose the option to “Turn Off FileVault” from the menu.
- Provide your login password when asked.
- Restart your Mac
After these steps, FileVault will be disabled temporarily. You can then try erasing the disk again to see if the error message has been resolved. If the error persists, there may be other issues causing the problem.
Summary
The “Couldn’t open device.: (-69877)” error can occur when trying to erase a disk in Terminal or Disk Utility on a Mac. This error can be caused by various factors, such as the disk being in use, a lack of write access to the drive, physical issues with the drive, or hardware issues with the drive. To fix the error, you can try allowing sharing and permissions, unmounting the drive in the Terminal, or using macOS Recovery Mode to erase the drive. If none of these alternatives work, the drive may need to be repaired or replaced.
Disk Utility (macOS Catalina 10.15.2) fails to erase my USB drive (64GB key, currently formatted in exFAT).
I’ve tried a bunch of commands that I’ve found here and there in the terminal, but none of them worked, like:
My USB drive appears as read only when i do CMD+I, I tried repairing the permissions but that failed too.
Thx in advance for the help 🙂
Содержание
- 1 Answer 1
- Can’t Access the Device
- Fixing the Device
- 6 Answers 6
- Исправляем ошибки форматирования диска
- Файлы устройств в OS X
- Нет доступа к устройству
- Ремонт устройства
- * Существующие вопросы / ответы
1 Answer 1
This is an attempt to write a canonical QA for this issue, as per the Meta post: Where is the list of canonical questions stored for Ask Different? This answer is based off a number of pre-existing answers expect it to be periodically edited with the goal of becoming a comprehensive information resource. *
Can’t Access the Device
If you’re having an issue where you can’t access the device there are a couple things to check first:
Check for write protection.
On USB flash drives, there may be a physical switch or it may be write protected from via a write protect bit, or the chip may be modified from the factory.
Make sure you have the correct privileges. Sometimes the drive may have had user privileges assigned to them. Using an Admin account will usually get around this.
Fixing the Device
There are a few steps you can take, but all are destructive to the data on the device.
Erase Disk. As the name implies, this does a simple erase of the disk and marks the free space as «empty» with no file system or partition scheme.
Re-partitition the Disk. I like to force a rewrite of the partition map to something that macOS is familiar with like a GPT partition and HFS+ file system. You can use MS-DOS with MBR as well. use diskutil listfilesystem to get a full list of supported file systems.
Zero out the disk. Using this command writes zeros to every block of the raw device, meaning you’re bypassing everything and accessing the device itself. This is the nuclear option because it will overwrite every single spot on the device with a zero. Triple check the device name!
If none of the above works, it’s likely the device has failed. On SD cards, this is actually quite common. Ask any photographer and they’ll tell you that SD cards fail usually in the middle of paid gig which is one of the reasons they now make D-SLRs with dual memory slots
Источник
I have a PNY 128gb flash drive that I can no longer modify (can’t delete files). I’ve tried to reformat it using Disk Utility but I get the following message and my usb is unmounted:
I’ve followed the solutions found from these two postings with no luck.
When I type in ‘diskutil eraseDisk free EMPTY /dev/disk2’ into terminal my usb is unmounted just like before and I get this message:
Any ideas on what I can do to erase and reformat my USB drive? Any help is much appreciated. Thanks!
6 Answers 6
Before trying anything more radical, do make sure (if you’re using a microSD-SD adapter) that the adapter isn’t write protected / locked. D’oh! It can be missed easily.
When nothing else works, you can try reinitializing the flash drive back to the conditions similar to when it was manufactured.
First, you need to determine the file name for the flash drive. Insert the flash drive in a USB port and execute the following Terminal application command.
I had a SanDisk USB stick that was giving me this issue when trying to build a bootable disk in Disk Drill. I was able to fix it by doing this:
After this I was able to use the disk to create a bootable USB. Hopefully this will fix the issue for you as well.
I had a similar problem with a Sandisk 32GB SD card. I solved it with the Windows management disk. I erased all partitions of the disk and then created a fat32. Initially no drive letter was assigned but then from My Computer, format the drive without problems. My SD card had this problem after using it for a raspberry pi.
I had this with a Sandisk card because I wasn’t using the microSD to SD converter it came with, but one I had from a Raspberry Pi. As soon as I used the official one it worked fine.
I just faced the same issue on OSX Mojave with a Western Digital 2TB USB external drive. It started happening after I was trying to create multiple partitions using Disk Utility.. it kept hanging and becoming unresponsive. Even after rebooting the problem would continue. I then tried using the command line and ran into the error above.
What worked for me is I booted into Windows 10 and from there I was easily able to delete all the partitions on my drive and format it as ex-fat. Then I booted back into OSX and I was able to format that partition was JHFS+. I then continued to run into problems trying to create multiple partitions. I had to repeat the above cycle and finally I was able to create all my partitions by creating them one at a time.
Источник
Исправляем ошибки форматирования диска
Благодаря преимуществам журналируемой файловой системы в Mac OS X, вероятность повреждения и потери данных довольно мала, но всё же бывают случаи, когда доступ к диску получить не удается. Обычно возможностей Дисковой утилиты вполне хватает, чтобы обнаружить и исправить ошибки диска, или, как крайнее средство, отформатировать его, но всё же иногда и этого оказывается недостаточно.
При появлении подобных проблем ваш диск может отображаться в Finder, но его содержимое будет недоступно, или же он может присутствовать только в окне Дисковой утилиты, а при попытке его подключить или взаимодействовать с ним иным образом возникают различные сообщения об ошибках, например, «ресурс занят» или «не удалось отключить диск».
К сожалению, во многих случаях такое поведение может означать, что диск неисправен и его необходимо заменить. Однако, если диск работал и продолжает работать бесшумно, и не проявляются иные признаки аппаратных неисправностей, можно предположить, что проблема заключается в ошибках форматирования. В этом случае можно воспользоваться другой операционной системой для форматирования диска. Для этого подойдет Windows, установленная на ваш Mac через Bootcamp, виртуальная машина, если вы пользуетесь Parallels Desktop или иными похожими программами, или же вы можете подключить диск как внешний к персональному компьютеру под управлением Windows. Однако, не у всех под рукой есть устройство или виртуальная машина под управлением другой операционной системы.
Второй вариант предусматривает использование Терминала, через который можно взаимодействовать со специальными файлами, соответствующими вашему проблемному диску.
Файлы устройств в OS X
Файлы устройств в OS X — это наборы драйверов для определенных устройств, которые хранятся в в скрытой папке «dev». С их помощью осуществляется взаимодействие с этими устройствами посредством наборов соответствующих команд (открытие, чтение, запись, закрытие и прочие). Это позволяет программам обращаться к устройствам без необходимости пользователю инициировать каждое действие вручную и дает возможность пользоваться более удобными инструментами (к примеру, файловыми менеджерами или Дисковой утилитой). Загрузочный диск в вашем устройстве всегда будет пронумерован в первую очередь, поэтому соответствующему ему файлу будет присвоено имя «disk0», а полный путь к нему будет выглядеть так: «/dev/disk0». Вы всегда можете посмотреть список накопителей подключенных к вашему компьютеру, введя в Терминале команду diskutil list А узнав имя файла интересующего вас диска вы можете запросить информацию о нем при помощи команды diskutil info /dev/disk1
В OS X, как и в остальных Unix системах, существуют специальные файлы, которые, вместо того чтобы предоставлять доступ к определенным устройствам, дают дополнительные возможности. Например, «/dev/null» удаляет все данные которые будут ему отправлены (часто используется при написании скриптов и программ), а «/dev/random» при обращении к нему выдает случайные данные. Вы можете посмотреть, как работает «/dev/random», введя в Терминале команду cat /dev/random Для отмены команды зажмите сочетание клавиш Control + C
Если с вашим диском возникли проблемы, связанные с форматированием, можно попробовать воспользоваться этим генератором случайных данных, чтобы принудительно переписать содержимое накопителя. Таким образом разметка диска и все данные на нем будут удалены, а сам накопитель отобразится в системе как пустой. Это может помочь избежать возникновения ошибок системы при обращении к проблемному диску.
Весьма вероятно, что после ввода последней команды возникнет ошибка с сообщением, что запрашиваемый ресурс уже используется. Часто это означает, что система успела подключиться к устройству и, вероятно, «застопорилась» в процессе его монтирования.
Получиться может не с первого раза, поэтому стоит попробовать несколько раз, пока курсор не переместится на новую строку, которая останется пустой.
Вы можете попробовать отключить и подключить диск через Терминал, что может быть полезно, если проблема связана не с внешним, а с внутренним диском.
Для того чтобы отключить диск введите команду diskutil unmountDisk /dev/disk1 заменив /dev/disk1 на файл проблемного устройства
Подключить диск можно командой diskutil mountDisk /dev/disk1
Вы также можете объединить эти две команды и добавить команду на запись произвольных даных на диск diskutil unmountDisk /dev/disk1;diskutil mountDisk /dev/disk1;cat /dev/random > /dev/disk1
Стоит заметить, что такой способ срабатывает не всегда и иногда проще подключить диск, как внешний, и воспользоваться инструкцией, приведенной выше.
После этого подождите 2-3 минуты и нажмите сочетание клавиш Control + C, чтобы прервать выполнение команды. В результате, если проблема действительно заключалась в ошибках форматирования, проблемный диск должен отобразиться в Дисковой утилите как пустой, и вы сможете отформатировать его и при необходимости разбить на разделы, чтобы подготовить к дальнейшему использованию с Mac OS X.
За оригинальный материал, послуживший основой при написании данной статьи, в очередной раз благодарим Кристофера Кесслера.
Источник
Был задан этот вопрос, возможно, тот же вопрос: Не удалось открыть устройство
Однако мой вопрос, надеюсь, демонстрирует более конкретный сценарий, как ситуацию, в которой явно известна ошибка:
Следующие действия выполняются как пользователь root:
Я получаю сообщение:
Бег gpt destroy /dev/disk2 дает
Мне кажется, на устройстве disk2 есть какая-то блокировка. Мне просто нужно придумать, как его выпустить.
Я смог освободить его, перезагрузившись в безопасном режиме (удерживая клавишу Shift во время загрузки), а затем перезагрузившись в нормальный режим. Однако я хотел бы знать, что именно можно сделать, чтобы снять эту блокировку без перезагрузки.
Раньше я сталкивался с чем-то подобным, и я выполнил команду:
diskutil unmountDisk /dev/diskxx
Что вы делаете при выключении и перезагрузке, даже в безопасном режиме, так это сначала размонтируете все свои диски.
Для всех, кто ответит на этот вопрос после поиска в Интернете, убедитесь, что вы подтвердили, что ваша SD-карта не смонтирована как доступная только для чтения! Есть физическая вкладка, которую вам, возможно, придется переместить:
Я обнаружил это сообщение об ошибке при попытке переформатировать свой зашифрованный Портативный накопитель Seagate, следуя руководству официального сайта.
Вы можете узнать, зашифрован ли жесткий диск, с помощью команды «Получить информацию», щелкнув его правой кнопкой мыши в Дисковой утилите. Мне не удалось его расшифровать, хотя у меня есть правильный пароль, так как по некоторым причинам функция была недоступна в меню правой кнопки мыши Finder.
Я решил это, удалив объем сначала, а затем приступил к стиранию водить машину в Дисковой утилите. Очевидно, сделайте копию всего, что вы хотите сохранить, перед стиранием.
Источник
Дисковая утилита (macOS Catalina 10.15.2) не может стереть мой USB-накопитель (ключ 64 ГБ, в настоящее время отформатирован в exFAT).
Я пробовал кучу команд, которые я нашел кое-где в терминале, но ни одна из них не сработала, например:
Когда я делаю CMD +, мой USB-накопитель отображается как доступный только для чтения. Я попытался восстановить разрешения, но это тоже не удалось.
Заранее спасибо за помощь 🙂
Это попытка написать канонический QA для этой проблемы, согласно мета-сообщению: где хранится список канонических вопросов, хранящихся для Ask Different? Этот ответ основан на ряде ранее существовавших ответов, ожидающих, что он будет периодически редактироваться с целью стать всеобъемлющим информационным ресурсом.. *
Нет доступа к устройству
Если у вас возникла проблема, из-за которой вы не можете получить доступ к устройству, сначала проверьте несколько вещей:
Проверьте защиту от записи.
На SD-картах есть физический переключатель блокировки записи, который может быть включен. Убедитесь, что он находится в верхнем положении. Если он защищен от записи на каждой SD, у вас может быть проблема с самой материнской платой.
На USB-флеш-накопителях может быть физический переключатель, или он может быть защищен от записи с помощью бита защиты от записи, или чип может быть модифицирован на заводе.
Убедитесь, что у вас есть необходимые права. Иногда накопителю могли быть назначены права пользователя. Использование учетной записи администратора обычно позволяет обойти это.
Ремонт устройства
Вы можете предпринять несколько шагов, но все они разрушительны для данных на устройстве.
Стереть диск. Как следует из названия, это просто стирает диск и помечает свободное пространство как «пустое» без файловой системы или схемы разделов.
Переразбейте диск. Мне нравится принудительно переписывать карту разделов во что-то знакомое macOS, например раздел GPT и файловую систему HFS +. Вы также можете использовать MS-DOS с MBR. использовать diskutil listfilesystem чтобы получить полный список поддерживаемых файловых систем.
Если ничего из вышеперечисленного не работает, скорее всего, устройство вышло из строя. На SD-картах это довольно распространенное явление. Спросите любого фотографа, и он скажет вам, что SD-карты обычно выходят из строя во время оплачиваемого концерта, что является одной из причин, по которой они теперь делают цифровые SLR с двумя слотами памяти.
* Существующие вопросы / ответы
Источник
Hello
I am really struggling to fix a problem I seem to have created after trying to help a friend install Windows 10 using Bootcamp (after he complained that BootCamp assistant would throw an error stating it couldn’t locate a Windows partition.
Effectively the issue is that I seem to be stuck with my main HDD formatted in Windows NTFS and unable to erase the disk (using ‘DiskUtil’ in Mac Recovery Mode) as it throws an error:
(-69877: Couldn’t open device)
The Mac is a 2015 Model 32GB iMac which has a 1TB HDD (disk1) and SSD Drive (disk0)
diskutil list
diskutil info disk1
diskutil info disk1s1
Here it looks like the disk has been successfully unmounted
diskutil unmountDisk force disk1
I then try to erase disk1 however this throws up the aforementioned error code -69877
diskutil eraseDisk apfs MAC-HD /dev/disk1
From the above, it’s just not clear what my next move is, as I have tried to remove the disk volume (disk1s1) separately to no avail & I have also tried to re-partition disk1 using a different format:
diskutil partitionDisk /dev/disk1 GPT APFS MAC-HD R
If anyone has any suggestions on what I could try next to resolve this, I would be externally grateful.
Thanks in advance
Matt
I am having issue converting a new SanDisk 128GB microSD card from ExFAT
to FAT32
$ diskutil info /dev/disk2
Device Identifier: disk2
Device Node: /dev/disk2
Whole: Yes
Part of Whole: disk2
Device / Media Name: Built In SDXC Reader
Volume Name: Not applicable (no file system)
Mounted: Not applicable (no file system)
File System: None
Content (IOContent): FDisk_partition_scheme
OS Can Be Installed: No
Media Type: Generic
Protocol: Secure Digital
SMART Status: Not Supported
Disk Size: 127.9 GB (127865454592 Bytes) (exactly 249737216 512-Byte-Units)
Device Block Size: 512 Bytes
Read-Only Media: Yes
Read-Only Volume: Not applicable (no file system)
Device Location: Internal
Removable Media: Removable
Media Removal: Software-Activated
Virtual: No
Here is the mounted partition
$ diskutil info /dev/disk2s1
Device Identifier: disk2s1
Device Node: /dev/disk2s1
Whole: No
Part of Whole: disk2
Volume Name:
Mounted: Yes
Mount Point: /Volumes/Untitled
Partition Type: Windows_NTFS
File System Personality: ExFAT
Type (Bundle): exfat
Name (User Visible): ExFAT
OS Can Be Installed: No
Media Type: Generic
Protocol: Secure Digital
SMART Status: Not Supported
Volume UUID: 555AF300-2369-3CE8-B4E1-D8F976CE9C86
Partition Offset: 16777216 Bytes (32768 512-Byte-Device-Blocks)
Disk Size: 127.8 GB (127848677376 Bytes) (exactly 249704448 512-Byte-Units)
Device Block Size: 512 Bytes
Volume Total Space: 127.8 GB (127831900160 Bytes) (exactly 249671680 512-Byte-Units)
Volume Used Space: 393.2 KB (393216 Bytes) (exactly 768 512-Byte-Units) (0.0%)
Volume Free Space: 127.8 GB (127831506944 Bytes) (exactly 249670912 512-Byte-Units) (100.0%)
Allocation Block Size: 131072 Bytes
Read-Only Media: Yes
Read-Only Volume: Yes
Device Location: Internal
Removable Media: Removable
Media Removal: Software-Activated
First I unmount:
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Then I erase the disk and format it to FAT32
$ diskutil eraseDisk FAT32 NEW_NAME /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device
How can I erase the disk and format it to FAT32
without using third-party applications?
-
#1
Long story short, reinstalled Windows to do the steps to get the PowerPlayTables for my 6900XT for Monterey 12.3. Got that sorted fine so decided to make a clean reinstall of Monterey. Never had this error before and with googling I can’t find any error references in regards to a hackintosh..
Disk Utility: Error -69877: Couldn’t Open Device xxx
-
#2
If you are doing a clean install on a separate disk, you can try this… in Windows do a quick re-format of the disk (FAT or NTFS). Then boot into the macOS installer and use disk utility and re-format to APFS.
The other thing I can think of (while in the installers disk utility) is to un-mount the drive that has Monterey and all it’s containers and see if you can erase or reformat it from there.
-
#3
Doing a deeper dive into this.. I must have something wrong in my config but I’m not sure what. All of my drives (NVME and external USB, don’t have any SATA) are Not Writable in Disk Utility. I’ve tried a
DISKPART> attributes disk clear readonly
just to make sure those aren’t set, everything appears fine. I can nuke (DISKPART> clean) and create partitions in Windows just fine, but nothing is working in Disk Utility.
-
#4
Doing a deeper deeper dive into this, I think Apple has done something sneaky and changed the recovery installer starting with 12.3. Pretty sure it’s not my config after all.
Using an older Monterey recovery I have no problem nuking the Windows drive (I think the old one corresponds to 12.1 release but not 100% sure). With the new recovery downloaded post 12.3 release I can no longer format the Windows drive and I get an error. I tried installing Windows to one of my other drives and suddenly I can no longer reformat that drive either. No problems formatting a blank drive or a drive without an OS, but with an OS — at least Windows — no longer works. To make things more interesting, I CAN reformat an APFS drive with MacOS on it.
Is this an anti-hack move? Anyone else try a fresh recovery install recently?
In short..
12.1 recovery will reformat anything you throw at it.
12.3 recovery will reformat anything except an NTFS partition with a Windows install on it.