Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rekhyt

macrumors 65816
Original poster
Jun 20, 2008
1,127
78
Part of the old MR guard.
Disk Utility cannot modify this disk because it contains CoreStorage physical volumes. Use command line distil instead.

The selected partition won't be changed.

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).)

diskutil eraseVolume format name device

diskutil eraseVolume HFS+ awer disk1s4

It didn't work -

Started erase on disk1s4 asdf

Unmounting disk

Error: -69879: Couldn't open disk
 
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.
 
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.

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?
 
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.
 
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.

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.
 
Thanks for all the help. I've solved the problem now - I've read the error again and now I've solved the problem.

Disk Utility cannot modify this disk because it contains CoreStorage physical volumes. Use command line distil instead.

The selected partition won't be changed.

'...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. :( :|
 
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!
 
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!
 
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.
 

Attachments

  • Screen Shot 2012-03-24 at 1.45.51 PM.png
    Screen Shot 2012-03-24 at 1.45.51 PM.png
    231.3 KB · Views: 2,202
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.
 

Attachments

  • Screen Shot 2012-03-24 at 10.22.19 PM.png
    Screen Shot 2012-03-24 at 10.22.19 PM.png
    138.1 KB · Views: 745
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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.