PDA

View Full Version : attempting to remove linux partition without success


AppleBoy
6th March 2008, 01:45 AM
tl;dr version:
have a macbook pro, attempted to delete partition3, can no longer boot to windows partition

Primary goal: be able to boot back to windows

what would be gravy:
be able to delete partition 3, extend partition 2 (os x) over the partition 3 space, and still be able to boot into windows

current partition setup:
disk0s1: EFI
disk0s2: OS X tiger
disk0s3: messed up partition spot
disk0s4: windows XP

background:
so a two days ago I wanted to remove disk0s3 and extend OS X tiger over the space. originally s3 was going to be a linux partition but I just haven't had a need to install gentoo and so I never used that partition. In my gungho style I deleted the partition under Windows with the built in disk utilities without really thinking about it (bad idea).

I booted into OS X and after some research, etc. I found that it's not very easy to just extend the partition as tiger doesn't allow live partition editing, diskutil eraseVolume will only let me reformat it as a fat32 partition at the same time, and I'm trying to do more research before I do anything to drastic. On top of that, EFI started listing windows as partition 3 instead of partition 4, and setting boot.ini to partition 3 or 4 doesn't make a difference.

Partition 3 has since then been recreated as a FAT32 partition using Apple's diskutil, originally thinking that maybe it would fix itself, didn't. I then used rEFIt's partition tool to fix the mbr and rEFIt lists windows as partition 4 again, but I still can't boot to windows (see below for errors).

When I boot to windows I get to the menu to choose between safe mode, etc. but when I select any of them this is what I get:

multi(0)disk(0)rdisk(0)partition(4)\WINDOWS\system 32\ntoskrnl.exe
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS\system 32\hal.dll
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS\system 32\KDCOM.DLL
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS\system 32\BOOTVID.dll

Windows could not start because of an error in the software.
Please report this problem as :
load needed DLLs for kernel.

It took me many hours to get the windows partition just the way I want, fully tweaked, tons of software installed for work with manual registry editions, etc. and reinstalling everything is the last thing I want to do. Any ideas?

AppleBoy
6th March 2008, 02:26 AM
update: managed to get it to boot to windows! ntoskrnl.exe and hal.dll somehow managed to change their version numbers or something. not entirely certain. I copied both files over from my school computers, next boot it decided to delete hal.dll o_O then recopied yet again. I can now boot to it again :). Only downside is it seems to take twice as long to boot now :(

Moving beyond that, would still like to be able to delete partition 3 and extend partition 2 over it if anyone has any suggestions.

zarmanto
6th March 2008, 02:29 PM
One of the most important steps you took in getting yourself functional again under Windows was to use rEFIt to re-sync the partition tables; as you've already suspected, you corrupted things a bit when you deleted disk0s3 using Windows. The only way to correctly create and delete multi-platform compatible partitions on a Mac is to use Apple's GPT tool (http://forum.onmac.net/showthread.php?t=2687), because it generates both the GUID table and the MBR table simultaneously.

Incidentally, another way that you might have been able to fix the hal.dll file would have been with the XP install disk's repair option -- and in fact, that may yet be the final step to getting you where you want to be, depending upon which one of my suggestions you decide to go with. In both cases below, you're going to want to minimize the number of times you attempt to boot into Windows during the process, as I think that boot lag you mentioned might be a side effect of repeatedly corrupting and repairing your Windows installation. Also note that I'm making an educated guess here, as I haven't actually tried to do this before -- so tread with caution, and triple-check your volume sizes before each step.

First suggestion:
Point the boot.ini file back at disk0s3 again. Then try to re-absorb disk0s3 into disk0s2 -- but this time, do it from a terminal under MacOS X, using GPT (http://forum.onmac.net/showthread.php?t=2687). (The thread in that link is actually targeted at removing all non-Mac partitions, but the same general premise applies; you'll just need to remove a few steps and tweak one or two other steps to get rid of only disk0s3.) Once you've accomplished that, boot from your Windows install disk, and use the repair option to finish up.

Second suggestion:
If that first suggestion seems too risky to you, then you could adjust the steps a bit... Don't touch boot.ini at all. Instead, re-absorb disk0s3 into disk0s2 using GPT -- and then repartition it back out again, as a negligible volume... like say, similar in size to the EFI volume. This should effectively fool Windows into thinking that nothing has changed, while returning the vast majority of the usable space back to your MacOS X volume. What's more, if you decide later that you want to reverse the process to install another OS on disk0s3, then you should be able to do so without causing any further hic-ups in Windows.

AppleBoy
6th March 2008, 04:59 PM
so just to double check before I do this

1) boot to tiger CD and get to terminal
2) diskutil unmount disk0s2
3) diskutil unmount disk0s3
4) diskutil unmount disk0s4
5) gpt remove -i 3 disk0
6) diskutil unmount disk0s2
7) diskutil resizeVolume disk0s2 limits
8) diskutil resizeVolume disk0s2 (max size limits shows)B
9) reboot and enjoy bigger partition
10) repoint boot.ini and rebuild mbr
11) reboot to windows and pray it still works

does that seem right?

zarmanto
7th March 2008, 03:17 AM
Looks about right to me. Post back with your results; I'd be very interested in knowing how things worked out, as I have a partition with Vista on it that I haven't booted into for more then maybe three or four hours total since I finished installing it over a year ago, and I'm thinking I might just want to do this myself as well.

AppleBoy
22nd March 2008, 05:40 AM
short version:
- I strongly recommend that people keep testdisk 6.9 (free) handy for recovering lost MBRs
- I can't stress how helpful getting the apple care protection plan is, even if it is another 300 bucks or whatever.
- don't use partition magic, you'll regret trying it.

long version:
just as a little update to my adventure and why I haven't posted back yet about my results. What a little tale this is

first to go: battery comes close to exploding! it started to bulge quite a bit and was starting to separate, apple was quick to replace for free :)

second up: I wanted to move the partitions around on my external 750GB external drive, so I fired up partition magic 8 with the hope that maybe it would just let me resize, etc. like the program is meant to. no dice, in fact I screwed up the mbr then realized I forgot to backup some of my important data :(
Took a little while, but with the help of testdisk 6.9 I got it back :) Wonderful program to have to fix lost mbr's. I recommend everyone keep it handy, and it's free.

bad things happen in threes?: was trying to burn gparted to a cd-r after I bought a new bundle from newegg, along with dvds. Turns out, after plenty of testing, that my superdrive was broken. Off to the Apple store! 5 hours later and a new superdrive is installed and the palm rest cover thingy, don't know a good word for it and apple just has it listed as top case assembly, was replaced free of charge. That protection care package is a life saver.

Why it should be bad things happen in fours: a bit out of order, but before my superdrive went out I installed vmware fusion because I was sick of booting into windows just to do assembly programming for my compsci class when I still want to use OS X for everything else at the same time. I noticed while working on creating a virtual drive that I could boot my bootcamp partition in vmware and tried it. whoops. I recommend nobody does that. I'm still not sure how I managed to be able to reboot to it, took some messing around with the windows XP install disk is all I can remember. Worst disaster ever, couldn't boot to windows anymore and I couldn't see into or write into most of my directories on the windows partition. Oh, and vmware thought it was a good idea to unmount the windows partition to boot to it even when it was in use by the backup program :/.

But, my macbook pro is back in working order so all is good (I hope)

Just had a baby colt (horse) born on the 18th which is what the dvd is of so between that and the macbook pro mishaps I've had my hands full. Will attempt the gparted stuff as soon as I finishing backing everything up properly to my external drive.