How to remove Linux Partition in Vista? and broken Grub? Ouch!
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to remove Linux Partition in Vista? and broken Grub? Ouch!
Well, there you go. I shouldn't have done what I did, but I did, and now I need help recovering from it. Hope y'all can help.
I've got a Compaq Presario Laptop. 150 gig HDD. I wanted to try Linux out again, so partitioned off 28 gigs and installed Ubuntu. Worked great, except that never could get the wifi working. All was happyhappyjoyjoy until recently when I loaded a lot of material onto the Vista partition and was running out of room. So, thought I'd get rid of the Linux partition for now and give that space back to the Vista side. Apparently, I did it badly and am now deeply regretful.
I turned the Linux partition into "free space" using the Vista Manager. Then found that I couldn't put that "free space" back into the Vista partition - well, *I* couldn't figure it out. Put the computer to sleep for the night, figuring I'd try again in the morning. Which, when I booted it up this morning, I get a Grub Error 17 that I can't seemt to get past. So, I can't load anything. Obviously, I'm not as smart as I thought I was. Grrr...
So. How can I fix these problems? I want to get the "free space" back into the Vista partition and get rid of the Grub loader. For now. I'm planning on getting a dedicated Linux laptop later
The first issue is you need to put back the Windows MBR code.
If you have a Windows install CD, there is a program on it for repairing the MBR (but I forget the name of that program and how you get to it).
If you don't have a Windows install CD, the task will be quite a bit harder.
I thought Windows Vista could resize its own partition (take free space after it back into the partition). If not, you could boot a Linux liveCD and use gparted to grow the ntfs partition. That works fine with Windows XP. I'm a little less confident about doing that with Vista, but I think it works.
If you don't have a Windows install CD, the task will be quite a bit harder.
I thought Windows Vista could resize its own partition (take free space after it back into the partition). If not, you could boot a Linux liveCD and use gparted to grow the ntfs partition. That works fine with Windows XP. I'm a little less confident about doing that with Vista, but I think it works.
I'm far less than confident about it - and no, of course I don't have the CD (grrr...). Are there any other ways around this? TIA
I recently went through something similar with my girlfriend's machine, and had to fix the MBR. This MS support article ( http://support.microsoft.com/kb/927392 ) had all the info I needed. I booted the recovery CD, and used the command
Code:
Bootrec.exe /FixMbr
It wrote over the grub MBR with the original Vista MBR, and my girlfriend's computer was working again.
If you can't get your hands on a Vista CD, then you may be out of luck.
Now that I think of it, you could always repair grub to boot Vista. The Super Grub Disk may be very helpful if you want to try this.
Last edited by Telengard; 06-19-2009 at 11:57 PM.
Reason: Almost forgot to mention
I am not sure how are you going to do this without booting into the system. But one way is to install back Ubuntu and then install super grub or any third party boot manager of your choice and then delete the Ubuntu partitions from Vista.
I am not sure how are you going to do this without booting into the system.
I assume a bootable Ubuntu install CD is still available.
Quote:
But one way is to install back Ubuntu and then install super grub or any third party boot manager of your choice and then delete the Ubuntu partitions from Vista.
Grub normally is installed with a tiny part of it in the MBR and most of it in the Linux partition that contains your /boot directory.
I don't know where "super grub" lives. Can the second stage be in the NTFS partition or somewhere else that exists when there is no Linux partition?
You could put back a Linux partition (maybe much smaller) just to have a place from the second stage of GRUB, and configure GRUB to boot Windows.
Once you boot Windows once (using GRUB), I wonder if Bootrec.exe can be run within the copy of Windows it is fixing. I expect it can. So maybe you need to just temporarily put back Ubuntu.
If you know the right command, I think the running copy of GRUB on a Linux CD can transfer directly to Windows without needing to install Linux on the hard drive, so I think you could boot Windows once that way, than use Bootrec to fix the MBR, then finaly get back to the original issue of fixing the partition size.
Once you boot Windows once (using GRUB), I wonder if Bootrec.exe can be run within the copy of Windows it is fixing. I expect it can. So maybe you need to just temporarily put back Ubuntu.
A live Windows OS modifying the MBR of its own boot device? I seriously doubt it! That would be a fantastic opportunity for viruses, wouldn't it? (Then again, it is Windows :P ).
Last edited by Telengard; 06-20-2009 at 03:20 PM.
Reason: clarification
A similar problem happened to me with the wifi, as I have a HP Pavillion ZV5000 running XP that has one of those wifi buttons just above the keyboard. I pressed it, but the light on it didn't turn on. However, when I used a buffalo wifi thing (the stick), and rebooted the laptop, the wifi on linux worked. Also, I installed the Linux Mint7 CD on the laptop, but wanted to dedicate more space to it after the instal, so I deleted its partition and restarted the laptop. Not a good idea. When i deleted the linux partition, it also deleted the Grub loader! So then I used the mint disc I had created from the iso on the website, but at 60% through the instal, it said it was broken. Now the linux partition manager (linux of a disc is now all I can run) refuses to let me delete the broken linux partition! In conclusion, I can no longer run any OS of the hard drive, but I can still access my documents of a Linux boot disc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.