Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This 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!


  Search this Thread
Old 01-23-2011, 10:40 AM   #1
LQ Newbie
Registered: Jan 2011
Posts: 9

Rep: Reputation: 0
recover grub after changing a partition

I moved my NTFS partition with XP and after restarting got the grub> prompt.
ls,grub-install and mount are not recognized.
find /boot/grub/stage1

how can I recover? my *nix is osol and I have grub 0.97 (legacy)

I have both a osol and ubuntu cds, but it seems I should be able to load from the grub prompt.

thanks everybody.

Last edited by stephenbbb; 01-23-2011 at 10:45 AM.
Old 01-23-2011, 10:55 AM   #2
Senior Member
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
This problem happens when GRUB in the MBR cannot find the rest of its files in the partition it expects to find them. Either you moved XP onto the osol partition, thus overwriting it, or you changed the partition numbering.

You are the only person who knows what actually happened. You may have made a mistake. You may need to investigate the contents of the disk partitions. You can do this by booting a live Linux CD and looking at the contents of the disk partitions.

Once you know which partition contains the GRUB files you can tell GRUB to look there during system startup.

Last edited by stress_junkie; 01-23-2011 at 10:57 AM.
Old 01-23-2011, 11:01 AM   #3
Registered: Aug 2010
Location: Idaho
Distribution: Arch, Ubuntu, Fedora
Posts: 114
Blog Entries: 2

Rep: Reputation: 10
Boot rescue mode off of one of your discs
The following will resetup grub and do nothing with the winloader - FYI
Once everything loads and you get to sh
chroot /mnt/sysimage

*start grub command

*fnd grub files
grub> find /boot/grub/stage1 or find /grub/grub.conf or find /grub.conf or find /menu.lst

*it will display something like this

*root the partition
grub>root (hd0,x)

*setup grup there
grub>setup (hd0)

grup> quit
reboot and you should be good to go

Last edited by Vegan; 01-23-2011 at 11:05 AM.
Old 01-23-2011, 11:02 AM   #4
LQ Newbie
Registered: Jan 2011
Posts: 9

Original Poster
Rep: Reputation: 0
grub finds stage1

after running findroot it actually recognized zfs. I was able to cat /boot/grub/menu.lst and just ran the commands for loading osol as in the menu.lst

I am in osol now. how do I setup grub, so it can boot normally? I looked at /boot/grub/menu.lst and it does not look like what it should be. the one I saw from grub> was very different and the one visible from osol will definitely not work.
becoming su and trying grub does not work.
scb@Constantine:~# grub
bash: grub: command not found

this is what I see from fdisk
Total disk size is 60800 cylinders
Cylinder size is 16065 (512 byte) blocks

Partition Status Type Start End Length %
========= ====== ============ ===== === ====== ===
1 Other OS 0 0 1 0
2 IFS: NTFS 21568 32035 10468 17
3 Active Solaris2 32036 33994 1959 3
4 EXT LBA 1 19241 19241 32
it looks like the stupid partitioning program I used to shrink the size of NTFS did that and also re-numbered my partitions just out of spite to create problems for me. GRUB seems to be installed on the NTFS partition and not on the osol partition. so maybe I need to direct grub to the proper partition??
I discovered that the active menu.lst is under /rpool/boot/grub/menu.lst
this is the contents which does not work on auto, but works after I do findroot /boot/grub/stage1

scb@Constantine:~$ cat /rpool/boot/grub/menu.lst
splashimage /boot/grub/splash.xpm.gz
background 215ECA
timeout 30
default 1
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
#---------------------END BOOTADM--------------------

#title OS/2
# rootnoverify (hd0,0)
# chainloader +1

# Unknown partition of type 15 found on /dev/rdsk/c8d0p0 partition: 2
# It maps to the GRUB device: (hd0,1) .

title Windows
rootnoverify (hd0,2)
chainloader +1
title opensolaris-4
findroot (pool_rpool,3,a)
bootfs rpool/ROOT/opensolaris-4
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
#============ End of LIBBE entry =============

what do I need to edit to make it work? or do I need to overwrite the MBR with installgrub? if yes which device?

pls comment.

Last edited by stephenbbb; 01-23-2011 at 02:14 PM. Reason: update


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recover grub with /boot on a separate partition. werepacman Linux - Newbie 1 09-14-2010 10:35 PM
Accidently deleted the linux partition(root partition) how to recover it? sanues Linux - Newbie 7 11-30-2009 01:55 PM
Changing GRUB-GRUB, GRUB-LILO and vice versa andreas_skw Linux - Newbie 1 06-05-2008 06:40 AM
Grub loader not loading Windows XP or Fedora Core 1 after changing partition size. zetafunc Fedora - Installation 17 06-12-2005 01:27 AM
recover grub j0hn_galt Linux - Newbie 3 06-11-2005 01:26 AM

All times are GMT -5. The time now is 01:30 PM.

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