Questions tagged [diskutil]

diskutil is a command line tool for modifying, verify and repairing disks.

Filter by
Sorted by
Tagged with
0 votes
1 answer
25 views

How can I mount a TimeMachine Backup snapshot in the Terminal via mount_apfs?

I backup my Apple Silicon Mac (running macOS Sonoma) to an external, directly attached drive via Time Machine. All backup snapshots on that external drive I can list via $ ls -1 /Volumes/.timemachine/...
halloleo's user avatar
  • 1,345
2 votes
1 answer
46 views

Why are certain mounted volumes not listed by diskutil?

mount and df show that disk1s5 is a mounted volume: bash-3.2$ mount /dev/disk1s4s1 on / (apfs, sealed, local, read-only, journaled) devfs on /dev (devfs, local, nobrowse) /dev/disk1s2 on /System/...
mmmmmmmmmmmmmmmmmmmmmmm's user avatar
0 votes
1 answer
47 views

What's wrong with my disk and apfs volumes?

I'm learning/trying diskutil, newfs_apfs and other disk command on macOS. My idea is actually this: a) Create a 1 GiB container b) Add 5 volumes of 200 MiB size in the 1 GiB container I run these ...
elbarna's user avatar
  • 117
0 votes
2 answers
35 views

How to create two APFS containers with same size?

I have a virtual disk of 1 GB, on which I want to create two volumes of 400 MB. With diskutil partitionDisk /dev/disk0 2 GPT APFS VOLUME1 400M APFS VOLUME2 400M it created one APFS container of 400 ...
elbarna's user avatar
  • 117
0 votes
0 answers
29 views

Reformat USB to remove "FDisk_partition_scheme"

I'm trying to reformat a USB Flash Drive so that it is readable by a tv. I have a USB that can be read and another that cannot be read. It seems the issue is the second drive has a "...
brad p's user avatar
  • 1
0 votes
0 answers
23 views

Deleted the partition on a MacBook using the Terminal but now unable to create new partition

I deleted the partition container by using the Terminal. Now I'm unable to create a partition. Photo of a System Recovery Terminal window showing the output of 'diskutil list': How can I delete all ...
Nadeem Ahmad's user avatar
1 vote
1 answer
115 views

How to initialize and format external SSD in commandline?

How can an external disk be initialized, partitioned and formatted in macos Sonoma commandline? I tried checking out my external drive with the command diskutil list: ... /dev/disk2 (external, ...
Human's user avatar
  • 697
1 vote
1 answer
101 views

Failing to resize partition with diskutil

I wish to resize my main macOS (High Sierra, HFS+) partition to use free space on the disk. I use console in Recovery Mode, as I suspect I won't be able the change the disk in use in standard mode. I ...
Maguy IB's user avatar
0 votes
0 answers
45 views

Volume based encryption for different OS sharing the same disk

On my macbook M1, I created two volumes (one for my professional activity and one for my personal activity). Each volume has it's own macOS. The goal is to prevent remote administrators of one of the ...
Jav's user avatar
  • 103
0 votes
0 answers
40 views

The attached disk cannot be read from this computer. No treatment/recovery. Is there a way to fix an external hard drive without data loss?

Currently I'm using 1TB of SanDisk Proportable SSD. Actually, this SSD had a lot of problems. At first, it was used as exFAT, but an unrecognized situation occurred on the Mac, so it was recovered ...
LEE 's user avatar
  • 1
1 vote
1 answer
85 views

Interrupted a `diskutil resizeContainer diskX 0` attempt to recover unpartitioned space - ended up with a startup snapshot and a Data volume

After I got done test driving Asahi Linux on my M1 Max, I decided to remove it and recover the allocated space, 500 GB (out of a total 2TB). I uninstalled Asahi Linux from my Mac using the commands ...
noon-ng's user avatar
  • 13
0 votes
0 answers
546 views

External APFS ecnrypted volume cannot be mount, error 49218

I accidentally unplugged the cable of an external disk while it was mounted on the system, but not in a copy or read operations. I use APFS encrypted partition on that disk After I reattached it to ...
user3756354's user avatar
0 votes
1 answer
62 views

Simple method to mount a named drive from the command line?

To unmount a named drive from the command line I wrote a bash function which just tells the Finder via AppleScript to eject the drive: eject () { osascript -e "tell application \"Finder\&...
Paul R's user avatar
  • 1,115
0 votes
0 answers
21 views

Existing AFPS Time Machine, adding identical drive to create RAID1, possible to do without reformatting?

I did a lot of research already and it seems like this was definitely possible before AFPS (see http://hints.macworld.com/article.php?story=20041013121106176). The command diskutil appleRAID enable ...
Max's user avatar
  • 113
1 vote
1 answer
91 views

Unable to reclaim free space after bootcamp uninstall [duplicate]

I'm unable to reclaim free space after uninstalling Boot Camp (done through the Boot Camp Assistant). Here are some screenshots from Disk Utility and results from diskutil: $ diskutil list /dev/disk0 ...
raphaelmsx's user avatar
1 vote
0 answers
166 views

Make external SSD appear in Finder

I bought a new external SSD, but when I connected it to my MBP (14" 2021 Ventura 13.0.1, Apple M1 Pro), it did not show up in the Finder (sidebar or anywhere else). How I can make it show up? ...
Abdirizak's user avatar
2 votes
2 answers
860 views

Inaccessible APFS Partition - no gpt scheme

In an attempt to recover a different external drive altogether, my drive "Libraries" was compromised. Just for it being connected at the same time. I'll be sure to disconnect drives I'm not ...
CyX SenZe's user avatar
1 vote
0 answers
114 views

How to delete (leftover) Windows partition on macOS Catalina?

I just bought a MacBook Pro Mid 2012 Unibody. It seems to run a fresh Catalina install though I encountered a Bluetooth issue the other day (wouldn't find the Bluetooth device) and decided to clear ...
Trainwreck990's user avatar
1 vote
1 answer
80 views

I have 1 TB disk but I'm only seeing 747 GB. How to recover the 253 GB missing?

I am not sure how to solve this. I used to have macOS Monterey on my iMac late 2015 and it was running a bit slow. So I removed it, formatted the drive and did a fresh install of macOS Mojave, which ...
Dani Szwarc's user avatar
6 votes
0 answers
651 views

Creating a non-TM snapshot of an external APFS volume

I have an external HDD with several APFS volumes containing all my files. I want to preserve a copy of the files at a given time, in case they get accidentally modified or deleted. Creating manual ...
Rafal's user avatar
  • 225
1 vote
0 answers
25 views

Network Recovery doesn't always load the latest compatible Recovery partition

I am using the Command-Option-R key-combination at start up to load up the latest Recovery Partition online, and then proceed to cloning disk-images using asr and diskutil in terminal. Normally after ...
EddiKh's user avatar
  • 43
0 votes
0 answers
83 views

Need help to fix mac partition with APFS

For some unknown reason, the controller for my USB drive failed and now I'm unable to access the drive. I've tried to do something with gpt, but I guess I only screwed it up. Could someone help me to ...
WasabiJoe's user avatar
1 vote
0 answers
162 views

Why can I unlock a volume from the terminal but not the unlock prompt?

When I try to mount an encrypted image from Finder, it pops up with a password prompt. I am unable to unlock it using that for some reason. It's not that I don't have the password because I can unlock ...
NeRoboto's user avatar
  • 111
8 votes
1 answer
5k views

All of a sudden can't open .dmg files on Monterey

My MacBook Pro 13" M1 crashed last night, I think because I switched off my external USB-C monitor. I logged in as normal but since then I am not able to open .dmg files. When I try to open using ...
Hackeron's user avatar
  • 266
0 votes
1 answer
1k views

One partition on external HDD not mounting, disk not ejecting

I have a problem with my external HDD from Seagate. It was working fine and I was transferring files from it to another external SSD on my MacBook Air (running macOS Monterey). However, the battery on ...
damaihati's user avatar
  • 399
1 vote
1 answer
378 views

Recover "free space" on hard drive

How can I merge the free space on my MacBook with the rest of my hard drive? I tried to run Asahi then removed it
Senior's user avatar
  • 11
0 votes
1 answer
342 views

How to get full "Media name" from the command line

From the Disk Utility GUI I can pick a physical disk and then click info and I get a Media name of ST325062 4NS Media (this happens to be disk4) From the command line I can do diskutil info disk4 and ...
pedz's user avatar
  • 443
0 votes
1 answer
674 views

Hard drive not showing in Recovery Mode despite reformat in HFS+

Same issue as related in this thread but I already did the following: Re-created a new GPT (GUID) partition table (using GParted, Ubuntu) Created an HFS+ partition specifically for my MacOS Re-...
James69's user avatar
  • 67
0 votes
0 answers
765 views

APFS Container lost after crash and reboot

My 15" MacBook Pro Late 2016 with a 500GB SSD was occasionally rebooting (but only) during MS-Teams meetings. Anyway, the last crash was destructive and now I get flashing "?" when it ...
Onur's user avatar
  • 101
2 votes
1 answer
941 views

How to know what the different `roles` do in `diskutil apfs` shell command

I wish to know what these mean, which one I should use, when specifying the <roles> as shown here. $diskutil apfs addVolume Usage: diskutil apfs addVolume <containerRefDisk> <fs> &...
massisenergy's user avatar
0 votes
2 answers
720 views

What happens when you delete GUID_Partion_Scheme?

/dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *121.3 GB disk0 1: ...
Mage's user avatar
  • 1
1 vote
2 answers
3k views

APFS disk plugged in newer system gives "Incompatible Disk" warning in original OS

If you plug an external macOS system disk using APFS into a newer version of macOS you will get a warning afterwards back in your original macOS saying: "Incompatible Disk. This disk uses ...
Adrian Zaugg's user avatar
0 votes
0 answers
398 views

diskutil unmountDisk fails, but lsof shows no processes using the disk

I have a number of external hard drives with multiple partitions each. Since getting a new Macbook Pro and updating to Monterey, running diskutil unmountDisk on two of these HDs fails with an error ...
msailor's user avatar
  • 223
2 votes
2 answers
367 views

Merge partition on external hard drive

I wanted to format and merge 2 partitions on my external hard drive. I used the command : diskutil erasevolume "Free Space" "" /dev/disks4s4. But now I lost 30go on 2TB and I can'...
DD11's user avatar
  • 21
3 votes
1 answer
3k views

diskutil no longer gives PID of dissenting process?

I recently got a new mac and simultaneously upgraded from Mojave to Monterey. Formerly, when I ran diskutil unmountDisk <disk here>, if there was a dissenting process, it would provide me with ...
msailor's user avatar
  • 223
1 vote
1 answer
64 views

Internal NVMe SSD missing 65GB after uninstalling Boot Camp with Boot Camp Manager [duplicate]

I am attempting to reclaim the 65GB or so I previously partitioned using Boot Camp Assistant. I have tried another answer listed before to the same problem however I could not get it to work. I have a ...
imEthan's user avatar
  • 21
2 votes
2 answers
522 views

Is there an open source alternative to diskutil available for macOS?

Is there an open source alternative to diskutil available for macOS? I am hoping to find a command line program that perform the same core functions like: verify disk or volume repair disk or volume ...
forgodsakehold's user avatar
1 vote
2 answers
158 views

Macbook Air Can Not Start After Trying to Remove Ubuntu

I was trying to remove Ubuntu (dual boot) from my 2017 Macbook Air. Now my computer can not start successfully in either macOS or Linux. When I restart it, it now opens refind, then gnu rnu in both ...
Gizem Kaya's user avatar
-1 votes
1 answer
51 views

Creating new gpt header for broken SD-Card [closed]

I have a broken SD Card. It is detected by mac OS, but I cannot mount it or store data on it. When using gpt -r show and got this: /dev/disk8 (external, physical): #: TYPE ...
user234458's user avatar
0 votes
1 answer
173 views

Unable to Expand APFS Container [closed]

I'm having a problem similar to this one, where I can't expand an APFS container to fill all available space. Here's my disk layout in Catalina: % sudo diskutil list ...
Aaron Vegh's user avatar
0 votes
0 answers
148 views

Trying to disable “ignore ownership” option on NTFS partition, not much going right

Cloned a Boot Camp partition from my old Mac with dd (both thus being NTFS), but, unlike the original, it does not show in the boot menu. Research suggests this is because ownership is disabled. Thus ...
Mars's user avatar
  • 31
0 votes
1 answer
148 views

Unable to allocate free space at end of disk to Mac

As per screenshot below, my Mac has 1TB storage, but the actual capacity shown in Disk Utility only 816GB. There is 200GB categorised as "free space" when I performed a diskutil list, ...
Kimllee's user avatar
0 votes
1 answer
2k views

can't claim free space to my container disk

I have a 500gb ssd and I have 1 container which its size is only 70gb. I can't add the remaining 430gb of storage to this container using disk utility for some reason I tried adding the remaining ...
tal mayron's user avatar
0 votes
2 answers
295 views

Script to mount exfat drive

hope you are doing great. I´m using a Macbook pro 2019 with Big Sur and I have all my photos and videos in a external drive formatted in ExFat. Each time I have to mount the disk I need to run this ...
Nacho Gonzalez's user avatar
1 vote
1 answer
2k views

How to properly unmount image (dmg / sparsebundle)

[macOS Mojave 10.14.6] I've recently discovered r/w disk images and the particularly fascinating sparse bundle. As I understand it, an image (the .dmg or .sparsebundle itself) is "attached" ...
caffeinatedbits's user avatar
1 vote
0 answers
83 views

Lost macOS boot option after using EaseUS partition to resize Windows partition

I am using a Macbook Air. After I installed Windows 10, I wanted to resize the Windows Partition and create a new partition to use data. After that, Windows informs me that a recovery error - cannot ...
Vu_takeshi's user avatar
0 votes
1 answer
690 views

Does "gpt remove" command delete files along with partition? Trying to recover a Mac OS partition Vol Type FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF

I have a Macbook Pro with Big Sur on it, and I installed Linux Mint. I then resized the encrypted Mac OS APFS partition in order to grant Linux more space. After that I created another smaller Linux ...
SH10151's user avatar
  • 113
0 votes
2 answers
606 views

APFS Volume does not increase in size

I have an issue with an APFS volume that resides inside a SparseBundle. I tried to increase its size (similar to this: Is it possible to increase size of an APFS volume?), but failed. Unfortunately, I ...
Dietrich's user avatar
  • 201
1 vote
0 answers
329 views

Recover Apple CoreStorage Volume, LVG, Logical Volume Group -container / partition / volume

I wasn’t able to mount the disk on my MacBook (I had removed both hard drives from iMac, since it’s logic board went bad and I thought not to put more money on Apple products due to such bad hardware ...
Anonymous's user avatar
1 vote
2 answers
11k views

How to make remove free space and make APFS container take it up

I am on 11.1 Big Sur beta. I have a partition with no disk identifier called (free space) I would like to remove this, and then make the APFS container take up the free space. Here is a screenshot of ...
user avatar