This question, possibly the same question, has been asked: Couldn’t open device
However, my question hopefully demonstrates a more specific scenario as the situation in which caused the error explicitly known:
The following done as a root user:
- I plugged in my SD card and ran
diskutil listto grab the internal device node (/dev/disk2) - I ran
diskutil partitionDisk /dev/disk2 GPT UFSD_EXTFS4 New 100%(UFSD_EXTFS4 is ext4 provided by Paragon) - I saw that it was working, so I interrupted the process at step 2.
- I attempted to rerun the command with the number of partitions explicitly stated
diskutil partitionDisk /dev/disk2 1 GPT UFSD_EXTFS4 New 100%
I get the message:
Started partitioning on disk2
Unmounting disk
Error: -69877: Couldn't open device
Running gpt show -l /dev/disk2 yields
start size index contents
0 7741440
Running gpt destroy /dev/disk2 yields
gpt destroy: unable to open device '/dev/disk2': Permission denied
It seems to me there is some lock on device disk2. I just need to figure out how to release it.
I was able to release it by rebooting into safe mode (holding shift key during boot) and then rebooting back into normal mode. I would like to know, however, what exactly could be done to release this lock without rebooting.
This question, possibly the same question, has been asked: Couldn’t open device
However, my question hopefully demonstrates a more specific scenario as the situation in which caused the error explicitly known:
The following done as a root user:
- I plugged in my SD card and ran
diskutil listto grab the internal device node (/dev/disk2) - I ran
diskutil partitionDisk /dev/disk2 GPT UFSD_EXTFS4 New 100%(UFSD_EXTFS4 is ext4 provided by Paragon) - I saw that it was working, so I interrupted the process at step 2.
- I attempted to rerun the command with the number of partitions explicitly stated
diskutil partitionDisk /dev/disk2 1 GPT UFSD_EXTFS4 New 100%
I get the message:
Started partitioning on disk2
Unmounting disk
Error: -69877: Couldn't open device
Running gpt show -l /dev/disk2 yields
start size index contents
0 7741440
Running gpt destroy /dev/disk2 yields
gpt destroy: unable to open device '/dev/disk2': Permission denied
It seems to me there is some lock on device disk2. I just need to figure out how to release it.
I was able to release it by rebooting into safe mode (holding shift key during boot) and then rebooting back into normal mode. I would like to know, however, what exactly could be done to release this lock without rebooting.
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
Disk Utility (macOS Catalina 10.15.2) fails to erase my USB drive (64GB key, currently formatted in exFAT).
/dev/disk2 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *64.1 GB disk2
1: EFI EFI 209.7 MB disk2s1
2: Microsoft Basic Data Lexar 63.9 GB disk2s2
I’ve tried a bunch of commands that I’ve found here and there in the terminal, but none of them worked, like:
➜ ~ diskutil eraseVolume exFAT MyName /dev/disk2
Started erase on disk2
Unmounting disk
Error: -69888: Couldn't unmount disk
➜ ~ diskutil eraseVolume exFAT MyName /dev/disk2s2
Started erase on disk2s2 Lexar
Unmounting disk
Erasing
Error: -69760: Unable to write to the last block of the device
➜ ~ diskutil eraseDisk FAT32 MYSD MBRFormat /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device
➜ ~ diskutil eraseDisk free EMPTY /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Error: -69877: Couldn't open device
My USB drive appears as read only when i do CMD+I, I tried repairing the permissions but that failed too.
➜ ~ diskutil resetUserPermissions /dev/disk2 `id -u`
Ready to reset user permissions on disk2
Error encountered attempting to reset permissions for user 501 home directory on disk2: Permissions are not enabled on the disk (-69861)
Thx in advance for the help 🙂
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?