LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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

Reply
 
Search this Thread
Old 07-15-2007, 04:44 AM   #1
Jarru
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
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)

Last edited by Jarru; 07-15-2007 at 04:53 AM.
 
Old 07-15-2007, 05:00 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,311

Rep: Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032
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.
 
Old 07-15-2007, 05:04 AM   #3
Jarru
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by syg00
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.

/dev/sda
/dev/sda1 ntfs /media/sda1 (windows C, 111gb)
/dev/sda2 ntfs /media/sda2 (hp recovery, 6-7GB)

Is my only option destroying the partition which Windows is on?

Thanks for your reply.

EDIT:

root@ubuntu:/media# fdisk -l /dev/sda

Disk /dev/sda: 120.0 GB, 120034123776 bytes
240 heads, 63 sectors/track, 15505 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 14423 109037536+ 7 HPFS/NTFS
/dev/sda2 14423 15506 8181760 7 HPFS/NTFS

Last edited by Jarru; 07-15-2007 at 05:10 AM.
 
Old 07-15-2007, 05:16 AM   #4
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,776

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
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.
 
Old 07-15-2007, 05:23 AM   #5
Jarru
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bigrigdriver
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.

Last edited by Jarru; 07-15-2007 at 05:26 AM.
 
Old 07-15-2007, 05:38 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,311

Rep: Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032Reputation: 1032
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.
 
Old 07-15-2007, 06:30 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.

Good luck as you do need it.
 
Old 07-15-2007, 07:20 AM   #8
Jarru
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hello again!

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.

Last edited by Jarru; 07-15-2007 at 07:23 AM.
 
Old 07-15-2007, 07:45 AM   #9
Jarru
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Original Poster
Rep: Reputation: 0
Hello.

Right, back online.

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.

Regards
 
Old 07-15-2007, 08:48 AM   #10
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Quote:
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB won't load windows partition - root (hd0,0), Filesystem type unknown partition.. cillm527 Linux - Software 4 04-27-2008 06:44 AM
Triple Boot Vista,XP,Suse 10.2 Grub Can't Load Windows Maccer2007 Linux - General 3 02-14-2007 06:55 PM
WinXP, FC-5 Dual Boot, Grub failing to load FC-5 (can't mount selected partition) rcmpsc Fedora 4 09-21-2006 09:53 AM
Removed Second HD with Dual-Boot RH9/XP Box; Now Grub Won't Load MadFunk Linux - General 1 01-05-2004 06:29 PM
X failing to load; AddScreen/InitScreen failing for driver 0 weblion Linux - Software 1 08-01-2002 06:14 AM


All times are GMT -5. The time now is 11:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration