Unable to repartition hard drives

Joined
May 1, 2008
Messages
2
Reaction score
0
Points
1
Alright. One day I decided to try and install Linux using Boot Camp. I downloaded the right uBuntu disk image for my kernel and put the disk in the drive and turned my macbook on. I followed the instructions and it told me to select disk space for new partition. I thought i did that with Boot Camp and it would just install the OS on the Bootcamp drive. So i selected 5G. Then it installed and I turned my mac on again. reFit didn't show up and loaded Mac OS X Leopard. So i panicked and erased the hard drives in the Disk Utility. THe hard drives I had created were, "BOOTCAMP (58.6 mb available)", "disk0s4 (5.08 GB available)", and an invisible hard drive only visible in Disk Utility called, "Linux Swap"... I tried to repartition using Boot Camp but I got an error.

"The startup disk must be formatted as a single Mac OS Extended (Journaled) volume or already partitioned by Boot Camp Assistant for installing Windows."

So I went into Disk Utility and changed the type of disk to Mac OS Extended (Journaled). Still no luck.


I don't know how to repartition the hard drives. I want to find a way to make all of these hard drives restored back to my main hard drive, "Macintosh HD."



I can give more info if needed.

Please help,
Alrik Olson
 

cwa107


Retired Staff
Joined
Dec 20, 2006
Messages
27,042
Reaction score
812
Points
113
Location
Lake Mary, Florida
Your Mac's Specs
14" MacBook Pro M1 Pro, 16GB RAM, 1TB SSD
Unfortunately, Boot Camp really isn't designed to facilitate the installation of Linux. It can be done, but the utilities and drivers supplied by Apple aren't at all geared toward it. I'd say you're in somewhat of a pickle since Disk Utility doesn't have the ability to resize Linux partitions. I would try to delete the extraneous partitions, and once gone, attempt to resize your Macintosh HD partition to fill the rest of the disk.

If you want to use Linux, you'd be better off doing so with VMWare Fusion, Parallels Desktop or VirtualBox.
 
Joined
Feb 23, 2011
Messages
1
Reaction score
0
Points
1
solution that worked for me

Okay, I know this is an old thread, but I thought I'd add a comment in case someone googles to this forum in search of a solution, like I did recently.

A week ago, I used rEFIt to install Ubuntu 10.10 onto a MBP (10.6.6).

Discovering that VirtualBox does what I need, I decided to delete Ubuntu (along with its partition) and restore my HD to its original 250GB size.

Followed rEFIt's uninstall directions and the machine still booted fine. However, recovering the remaining 50GB (Ubuntu partitions) turned out to be non-trivial.

Using Disk Utility (OS X GUI app), I ran into several problems, but using the following procedure with diskutil (command-line), I was able to restore my HD to its original 250GB size without having to backup and reinstall OS X.

1. Use Disk Utility to delete all Linux partitions, merge them all into one new Mac OS Extended (Journaled), and erase this filesystem. Note that you must jump back and forth between the entire disk for partitioning and clicking on the filesystem itself for erasing. Apparently, if you do not erase this filesystem, diskutil in step 2. below gets unhappy.

Usually, the last steps for the process involves using the minus sign to remove the extra partition of 50GB and then using the GUI to extend the original partition (in my case, from 200 GB to 250GB) in Disk Utility in the Partition tab for the whole disk. However, in my case, after running for a couple of minutes, Disk Utility fails during the verification stage and puts the partitions back.

2. This is where we use the command-line diskutil. I typed this:

sudo diskutil mergePartitions JHFS+ "Macintosh HD" disk0s2 disk0s3

where disk0s2 is my original partition called "Macintosh HD" and disk0s3 is the new partition (now JHFS+, but used to be Linux partitions, swaps, etc...). For your particular situation, use:

diskutil list

to look at your partitions before and after you run mergePartitions.

3. Run Disk Utility to verify the HD (takes a few minutes so be patient) - this time, we get a more useful message:

Invalid volume file count
(It should be 904997 instead of 904998)
Invalid volume directory count
(It should be 219084 instead of 219083)
The volume Macintosh HD was found corrupt and needs to be repaired.
Error: This disk needs to be repaired. Start up your computer with another disk (such as your Mac OS X installation disc), and then use Disk Utility to repair this disk.

Follow the instructions above and everything should be back to normal.

Bottom line: it's possible to recover your entire HD with just the built-in diskutil and Disk Utility and your original boot DVD, if you are careful - no need to pay for commercial software or to reinstall OS X. Time from start to finish is about 30 minutes. After repairing from your Snow Leopard bootup DVD, you can verify one more time from your HD if you like, just to make sure you are clean.
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Good one. Thanks for posting it. :)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top