Can't delete partition in Disk Utility? (Lion)

Discussion in 'Mac Basics and Help' started by rekhyt, Sep 2, 2011.

  1. rekhyt macrumors 65816

    Joined:
    Jun 20, 2008
    Location:
    Part of the old MR guard.
    #1
    How do I remove the partition? It's completely empty now and I've cleared it by formatting it but I want to completely remove the partition and merge the free space back into the bigger partition.

    (I've tried doing this but it doesn't work (in Terminal).)

    It didn't work -

     
  2. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #2
    Is your partition encrypted? CoreStorage is used for FileVault. If so, try disabling it, then see if you can remove the partition.

    Is this your startup disk? You should have a backup, in any case, but especially for your startup disk. If you already have, then disregard. So many don't; it's easy to make the assumption. :eek:

    Also, if you aren't familiar with using diskutil... well, that's even more reason to have a full backup. Things can go very badly if a command is improperly used or a slight mistake made. "eraseVolume" won't affect the partition table - it will only affect its formatting.
     
  3. rekhyt thread starter macrumors 65816

    Joined:
    Jun 20, 2008
    Location:
    Part of the old MR guard.
    #3
    The disk is a 500GB hard drive, with 70GB allocated to a CarbonCopyCloner copy of Windows Vista, done before I upgraded to Lion. The other 430GB is an encrypted Time Machine backup. I don't have FileVault enabled and the (now) erased, but still there (but empty) partition used for the CCC Windows Vista backup does not have any encryption applied to it.

    It's an external drive so it's not the startup disk. This is a little peculiar because I have not enabled any disk encryption on it. What should I do?

    Yea, first time using diskutil in Terminal. I spent ~30 minutes going through help (man diskutil) and then piecing up the commands together. I did do several precautions though (Testing the commands through renaming first to check whether I had the correct disk or not.).

    eraseDisk erases the whole hard drive, doens't it?
     
  4. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #4
    Glad you are the cautious type and did some research, too. Yes, eraseDisk will remove all volumes and replace it with a single new one.

    I believe when you encrypt Time Machine, the whole partition becomes encrypted. That's why there's a coreStorage partition type. You can use the command diskutil list to show all partitions on attached devices. I'm guessing the partition containing the encrypted Time Machine backup will be coreStorage. (I really should encrypt one of my volumes so I have a first-hand reference.)

    You should be able to revert the TM partition to an unencrypted partition by going to the TimeMachine pref pane (in System Preferences), selecting your current TM partition and unchecking the "encrypt..." option. Not having done that myself, I would suggest, if at all possible, making a backup of your TimeMachine backup. Though, OTOH, it does sound like you're willing to start fresh and erase it. That point does remove some risk ;).

    Hope this helps point you in the right direction, in any event.

    Btw, if for some reason the TM pref pane doesn't remove the encryption, take a look at the diskutil coreStorage revert command - though it has some limitations regarding how the coreStorage encrypted partition was created. For the most part, as you might have guessed, DiskUtility is the GUI front end for diskutil, and several other tools.
     
  5. rekhyt thread starter macrumors 65816

    Joined:
    Jun 20, 2008
    Location:
    Part of the old MR guard.
    #5
    Thanks. :) I'm glad someone with such a long history of using Macs is helping me. (According to the signature. I'm quite new compared to some people on the forums (Only started in 2007 with the purchase of a MacBook. Started in 2004, officially, if acquiring an iPod Nano as a present counts.)

    I've noticed that the commands listed in man are not organised alphabetically, for some reason. Is this meant to be? (I've always made researching a habit, but did this especially because 1) I am interested in how Terminal/command-line works. 2) I've heard about the perils of using Terminal accidentally or unintentionally, with the famous -rf rm trick that some people play.)

    I've looked through using the command diskutil corestorage list and it only shows the partition with Time Machine (Let's say Partition A) that's encrypted and has no mention of Partition B, the 70GB partition with nothing in it that refuses to be deleted.

    Encryption takes quite a long time (Took ~3 hours, I think, for 15GB. :|), for some reason so undoing the encryption is the last resort.

    I've noticed that the partitions using Core Storage have a different type of identifier - instead, it's lvUUID or something like that.

    I've done
    diskutil corestorage revert disk1s4

    but it says that disk1s4 is not a CoreStorage Logical Volume. Hmm. Unusual, since on Disk Utility, it says that it is.
     
  6. rekhyt thread starter macrumors 65816

    Joined:
    Jun 20, 2008
    Location:
    Part of the old MR guard.
    #6
    Thanks for all the help. I've solved the problem now - I've read the error again and now I've solved the problem.

    '...cannot modify this disk because it contains CoreStorage physical volumes...'

    Now I understand. :) :D

    But now I've got a long night ahead of me, decrypting and removing the partition and merging it back in and encrypting it again. :( :|
     
  7. gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #7
    At least the decrypt, removing the small partition, merging, are all quick. Then, you can enable the encryption again and say good-night to it. :)

    Glad you have it worked out!
     
  8. OverSpun macrumors 6502a

    OverSpun

    Joined:
    Sep 12, 2006
    Location:
    California
    #8
    Sorry to bump this thread since I used time machine to encrypt 2 partitions on a 2tb drive that holds a bunch pictures that I took, but I'm afraid to lose all the non-time machine partitions.

    Its mainly that I don't really know enough to use terminal or diskutil.

    Thanks!
     
  9. Rizvi1 macrumors 6502a

    Joined:
    Mar 29, 2006
    Location:
    Laurel, MD (Baltimore, MD / Washington, DC area)
    #9
    I think I'm on the same boat:

    When I replaced my mid-2010 MacBook Pro's 320gb hard drive with a 750gb Hard Drive, I moved the contents of the original HD onto the new HD via Carbon Copy Cloner. Then I found out that if I wanted a recovery partition, I couldn't just move files back and forth, I had to install Lion first. So I added a new partition, installed Lion on it (and got the Recover Partition created that I wanted), and then moved all the contents over. Then I deleted the first partition and tried to merge the contents and couldn't because of the "Disk Utility cannot modify this disk because it contains CoreStorage physical volumes. Use command line diskutil instead."

    So if I understand correctly, I need to just turn off filevault and then I should be able to merge the partition and the Free Space of the old partition.

    Below is a screenshot of my partitions if it helps. There's another little slab of 650gb which I believe is the Recovery Partition. I have another 100gb area on the Hard Drive which will not have filevault on it.
     

    Attached Files:

  10. Rizvi1 macrumors 6502a

    Joined:
    Mar 29, 2006
    Location:
    Laurel, MD (Baltimore, MD / Washington, DC area)
    #10
    The good news is Filevault is now turned off and I can resize. The bad news is that the Free Space is "above" the Main partition which means I can't just expand into it. I have to install Lion on that "first" partition, move the data over from this partition to that one, then delete this partition, and then merge this space over.
     

    Attached Files:

  11. Babyboi macrumors regular

    Joined:
    Mar 16, 2008
    #11
    i, too, would like to know how to merge the free space into an existing partition. it seems like if we create a partition, we're stuck with it. We can format it, but the free space will just be floating around with no way to merge.
     
  12. Sirmausalot macrumors 6502a

    Sirmausalot

    Joined:
    Sep 1, 2007
    #12
    There are tools to merge the partitions. But they cost money. You can Google for them, but I can't vouch for any of them.
     

Share This Page