Grub failing to load. Vista removed partition / need help restoring
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Grub failing to load. Vista removed partition / need help restoring
Hello.
Well, heres the scenario.
My notebook came with Windows Vista and no recovery CDs (HP recovery on the disk, which means I cannot recover until Windows starts to boot). I decided to free up some space on the disk to make room for Ubuntu (xubuntu). Installed Xubuntu and all was grand. Then I booted into Vista again, and resized the main partition again (C drive in Windows). Vista, or maybe I was too quick on the buttons, somehow destroyed the partition which I had xubuntu on - and I am left with a non working GRUB.
This results in an ERROR when I try to boot up the notebook. I have tried searching for /boot/grub/stage1 and alot of other paths, but all results in Error 15 File not found, from a Live CD.
How would I go about accessing GRUB on the disk (MBR?) so I can alter it to boot straight into Vista. From there I can restore the MBR.
Really need some help on this one - thanks for reading.
EDIT:
root@ubuntu:~# grub-install /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.
I have a single drive, where I assume sda is the "main".
sda1 is where Vista is installed to (drive C in windows)
sda2 is the HP PC System Recovery (drive E in Windows)
Easy to fix with a Vista CD - in your case it might be easiest to simply re-install a (any) Linux, and boot Vista from there.
I agree, but as I also wrote, Hp diden't actually give me CD's, they just created a seperate partition for the recovery system, which is only functional as you start to boot into Windows.
I'm looking through the "Manual" partition in the Ubuntu installation window, and I cannot actaully split the disc up any more, so I'll have to install ubuntu on the "whole" disc - destroying Windows. If I select New partition table on /dev/sda it tells me that all current partitions will be destroyed. I have no such option when clicking on sda1 or 2, only an option to edit mount point and delete.
If I'm not mistaken, you can boot Ubuntu from the cd as a livecd, rather that going directly to installation. If that's possible, then use partitioning tools in Ubuntu (gparted, fdisk, cfdisk, or some other) to resize the windows partition (at the back end of the partition) to create some free space. You can then create a Linux partition in the free space, create the filesystem and format it. But it isn't strictly necessary to create filesystem at this point, you can wait until you begin installation.
When you begin installation, select the free space as the place to install, and Ubuntu should create the filesystem and format the partition as part of the installation process.
If I'm not mistaken, you can boot Ubuntu from the cd as a livecd, rather that going directly to installation. If that's possible, then use partitioning tools in Ubuntu (gparted, fdisk, cfdisk, or some other) to resize the windows partition (at the back end of the partition) to create some free space. You can then create a Linux partition in the free space, create the filesystem and format it. But it isn't strictly necessary to create filesystem at this point, you can wait until you begin installation.
When you begin installation, select the free space as the place to install, and Ubuntu should create the filesystem and format the partition as part of the installation process.
That was actually a very good idea. This just keeps getting worse tho.
I started gnome partition manager, unmounted /dev/sda1 and 2, tried to resize 1 and it failed. "Checke /dev/sda1... for errors". Same deal with sda2. Hmm. Probably end up formatting the whole thing. That would leave me to buy a new Vista CD, as HP diden't provide any. Excellen!
In any case, thanks for you reply - I'll keep trying a couple of hours.
EDIT:
I sure do make alot of edits. But a breakthrough.. seems that Ubuntu had mounted them on the desktop aswell as me having mounted them in /mnt manually. I still got an error when it tried to check the sda2 partition in Gparted, but it seems the space is allocated. Attempting to instill Xubuntu on that 2gig space.
I wouldn't recommend anyone trash a system (even 'doze) unnecessarily.
I'm surprised Feisty doesn't allow a resize of the Vista partition.
If you have another machine (or a mate) get a copy of the gparted liveCD (only about 60-odd Meg), and resize the partitions as needed - then do the install into the free space.
Gparted may be unable to resize a Vista. If it succeeds the Vista may still need a re-activation or repair to its MBR.
The way I see it there is a short term cure and a long term cure. I would preserve Vista partition boundary as this OS doesn't like being touched by software outside itself. It checks the partition table every time it is booted against its own kept record and don't give it the excuse no to fire up.
Short term cure
This will be in the form of getting a Grub prompt from any of the following
(1) a Bootable Grub floppy (possibly out of question if no such drive available but it can be manufactured from a Live CD like Ubuntu)
(2) a bootable Grub CD with only stage2_eltorito inside. Just follow the steps of Chapter 3.4 of Grub Manual and manufacture it with Ubuntu Live CD.
(3) Obtain a Live CD that can give you a Grub prompt. That is a Live CD using Grub instead of isolinux to boot up the CD. At the Grub screen press the "c" key to get a Grub prompt. Most Live CDs like to impress the users by installing fgxmenu which stops the CD to offer a Grub prompt. Haven't seen many not doing it yet myself. The one I use is off Solaris. I am sure there is a few knocking around
In a Grub prompt your vista should fire up by command
Code:
root (hd0,0)
chainloader +1
boot
Long term solution
When you get Vista back on line, just use its internal resizer (in Disk Management) to squeeze a partition out, say 0.5Gb and format it into the fat filing system. Make a /boot/grub directory there too.
Boot up the Ubuntu Live CD and copy the content of its /lib/grub/i386-pc/* to the new partition's /boot/grub
If this new partition (sda3 if it is a primary or sda5 if a logical) is sda3 which is known to Grub as (hd0,2), then these lines in Ubuntu terminal will install Grub into the MBR
Code:
sudo grub
root (hd0,2)
setup (hd0)
quit
You now have a Grub prompt permanently.
If you want Grub to boot Vista permanenly and not manually every time you edit a menu.lst in /boot/grub directory of sda3 with the following entries
Code:
title My Vista in sda1 now boots by Grub
root (hd0,0)
chainloader +1
I just wish you haven't damaged Vista to the point making it impossible to be chainloaded.
If you manage to get Vista back you should always use its own resizer to make room for installing a Linux into it. Remember you don't have a Vista installation CD and your Vista is good as long as you do not alter the partition table behind its back.
Thank you for all the replies - there is something to work with.
I went to the office now, and am back on the live CD. Installing Xubuntu on the space I made failed. As Saikee mentioned, I will attempt to find a boot cd that offers a GRUB screen. There should be nothing wrong with my Vista partions, nor the HP recovery partition - it\s just the MBR thats broken as grub attemps to load the first entry (old Xubuntu).
A problem i can imagine having is actually burning the live CD, from a live CD. I noticed that whenever I do something, the live CD spins up. Using Kubuntu now. Too many buntus!
Vista does offer it\s own "MBR fixer", so when I hopefully get Vista booting again, I can use that to fix it. Then, partition again, install Linux and let GRUB do its thing as normal.
Back later.
Burning a DVD from a Live CD was obviously not a success. Removing the CD locked Kubuntu. I found some old CD\s laying around, Debian 3, Xen 3 live and an Archlinux 8 - pressing E in archlinux gives me the choice to create my own grub sequence. I forgot to write down what you were saying, so Im going to do that now.
Writing root (hd0) and pressing B was a failure - wrong sequence.
I will return, if successful - will sum up the posts for future visitors.
I'm surprised Feisty doesn't allow a resize of the Vista partition.
Hardly surprising, really. Feisty has the nasty habit of mounting partitions even if you unmounted them the second before. It's a recipe for disaster (as I have found) when using Gparted from within Feisty. Nothing better than the Gparted livecd.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.