Pergunta

When trying to shrink the size of a partition, the period before the actual resizing happens (where Disk Utility says "Preparing to partition disk") hangs forever. I dug into Console to see what was going on and I came across this error, which is 100% reproducible for me as soon as I click "Apply" to resize the partition:

8/1/14 8:48:48.299 AM Disk Utility[631]: *** setObjectForKey: object cannot be nil (key: FilesystemName)
8/1/14 8:48:48.301 AM Disk Utility[631]: (
    0   CoreFoundation                      0x00007fff879eb25c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff82c08e75 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff878e622e -[__NSDictionaryM setObject:forKey:] + 1102
    3   Partition                           0x000000010681cdcc Partition + 110028
    4   Partition                           0x0000000106814883 Partition + 75907
    5   AppKit                              0x00007fff8834c06d -[NSAlert didEndAlert:returnCode:contextInfo:] + 90
    6   AppKit                              0x00007fff8834ba9a -[NSWindow endSheet:returnCode:] + 368
    7   AppKit                              0x00007fff8834b66d -[NSAlert buttonPressed:] + 107
    8   AppKit                              0x00007fff88210260 -[NSApplication sendAction:to:from:] + 327
    9   AppKit                              0x00007fff882100de -[NSControl sendAction:to:] + 86
    10  AppKit                              0x00007fff8825cc4d -[NSCell _sendActionFrom:] + 128
    11  AppKit                              0x00007fff88276655 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2316
    12  AppKit                              0x00007fff88275a27 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 487
    13  AppKit                              0x00007fff8827513d -[NSControl mouseDown:] + 706
    14  AppKit                              0x00007fff881f6a58 -[NSWindow sendEvent:] + 11296
    15  AppKit                              0x00007fff881955d4 -[NSApplication sendEvent:] + 2021
    16  AppKit                              0x00007fff87fe59f9 -[NSApplication run] + 646
    17  AppKit                              0x00007fff87fd0783 NSApplicationMain + 940
    18  Disk Utility                        0x0000000100e18867 Disk Utility + 6247
    19  libdyld.dylib                       0x00007fff8496a5fd start + 1
    20  ???                                 0x0000000000000001 0x0 + 1
)

I found this link which describes pretty much the same issue, but does not contain any useful suggestions for workarounds.

In case it is helpful, here is an image of Disk Utility at that moment. Note that I am dual-booting Mac OS and Ubuntu -- I assume the reason the FilesystemName is nil is the same reason that the ext4 Ubuntu partition shows up as disk0s4.

Disk Utility hanging prior to performing partition shrink

Note: This is on 10.9.4 (Mavericks).

Foi útil?

Solução 3

Not sure if this fix will universally fix the error I ran into, but thought I should share what worked for me.

  1. Try to "Verify" the partition I was going to resize. If your issue is the same as mine, this will fail and ask you to "Repair" the partition.
  2. Repairing the partition will not work until you boot from your recovery partition, so reboot and hit the "Option" (or "Command-R" in more recent versions of OS X) key as the computer starts back up so you can choose the recovery partition.
  3. Click "Disk Utility" and then do the "Verify" / "Repair" from here instead. It should succeed.
  4. Now it will let you shrink your boot partition, so do that.
  5. Reboot again using your normal boot partition. Its size should be smaller now.
  6. (optional) If you were dual-booting into a Linux system you were probably using GRUB as your primary bootloader, but the previous process may have set the Mac OS X bootloader to come first. To fix this I used the same process as I originally used to set GRUB to run first (I ran that from a Linux USB drive).

Outras dicas

Yeah I do encounter this problem sometimes also, but I don't know why is it happening. For some verifying and repairing solves the problem, but for those that doesn't get solved, the command line tool diskutil often does the job.

You can just use

diskutil resizeVolume $1 $2

where

  • $1 is the Mount Point or Disk Identifier or Device Node of the disk you are trying to resize (obtained with diskutil list).
  • $2 is the size in decimal with suffix of B, S(512 byte blocks), K, M, G, T, P, or percentage of the current size(%).

e.g. diskutil resizeVolume disk0s6 100G will resize the volume disk0s6 to 100 GB.

If your end goal is to repartition, given that you can't in OSX, I'd try a linux livecd using gparted.

Something like this: gparted tutorial

You can boot your mac with a linux live USB key and use gparted to repartition, then boot back into OSX.

I had the exact same problem and searched the web until I found this easy little fix, so I thought I should share it.

First I made a backup of my primary drive with Carbon Copy Clone on an external drive.

Then I restarted the computer, as it starts hold CommandS for just a moment until it starts to boot. At the prompt enter fsck -fy.

Then let it do its thing for about 3-5 minutes and eventually it will be done.

At that point type reboot and plug in your external drive. You have to now boot from your external drive to make any permanent changes to your internal drive.

I was now able to go into disk utility and use all of the functions to change sizes or repartition the drive.

I hope this works for you, I tried many things before I was able to get this to work.

Partition Mac HD again as small as u can. Once that is complete hit the revert key then the unerasable portion will be able to b deleted by clicking the minus button underneath. Wait for that process to be complete. It will look like nothing happened at first. Leave the screen by clicking the first aid button. Then go back and all partitions should be gone and back to normal.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a apple.stackexchange
scroll top