LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 10-31-2008, 01:58 PM   #1
shickidyshade
LQ Newbie
 
Registered: Sep 2008
Posts: 25

Rep: Reputation: 15
Boot grub problem


On my laptop I have Windows XP installed and fc9. I was attempting to install ubuntu on a flash drive to use as a portable distro for computers around school etc. However the boot grub in sda is no longer linked to the grub in fedora. Attached is my fdisk -l

Code:
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc232459c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5100    40960000    7  HPFS/NTFS
/dev/sda2            5101        5125      200812+  83  Linux
/dev/sda3            5126        7296    17438557+  8e  Linux LVM
Any help would be appreciated
 
Old 10-31-2008, 02:12 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I am guessing that you installed boot code (GRUB) to the MBR when you installed Ubuntu. If so, that accounts for the broken linkage to Fedora. (GRUB stage1--in the mbr--gets "hard-coded" to point to the partition with its config file)

to fix: Boot up from any LiveCD version of Linux and run the GRUB installer from there. In a terminal:
fdisk -l ##to confirm how the drive/partition is seen from the live Linux.
root (hd0,1) ##This assumes that your Fedora Linux /boot directory is on /dev/sda2---adjust as required (remember that grub alwasy counts from 0.)
setup (hd0)

Now when you re-boot, GRUB will be back talking to the Fedora system.

By the way, where is your Linux Swap partition?
 
Old 10-31-2008, 05:19 PM   #3
shickidyshade
LQ Newbie
 
Registered: Sep 2008
Posts: 25

Original Poster
Rep: Reputation: 15
I went in with the fedora live cd and this is what i got for fdisk -l

Code:
Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc232459c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5100    40960000    7  HPFS/NTFS
/dev/sda2            5101        5125      200812+  83  Linux
/dev/sda3            5126        7296    17438557+  8e  Linux LVM

Disk /dev/dm-0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/dm-2: 15.7 GB, 15737028608 bytes
255 heads, 63 sectors/track, 1913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-2 doesn't contain a valid partition table

Disk /dev/dm-3: 2080 MB, 2080374784 bytes
255 heads, 63 sectors/track, 252 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-3 doesn't contain a valid partition table
 
Old 10-31-2008, 05:56 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Code:
Disk /dev/dm-0 doesn't contain a valid partition table
This is normal.

A menu.lst entry might look something like this:
Code:
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.25.18-0.2 (default)
    root (hd2,0)
    kernel /vmlinuz-2.6.25.18-0.2-default root=/dev/system/rootvol resume=/dev/sda2 splash=silent showopts vga=795
    initrd /initrd-2.6.25.18-0.2-default
From what you posted, your root line should probably be: "root (hd0,1)". Grub starts counting with 0, so you subtract 1 from what fdisk -l says.

Try mounting /dev/sda2 somewhere and see if you still have your original /boot/grub/menu.lst file. If it is, you can reboot and load it in the grub shell. Then enter "boot" to bring up your orignal grub menu. If this is successful, you can rerun grub-install to get things back to where they were before.

I'm betting that you replaced the mbr on your fixed drive by mistake to boot to the pendrive, instead of installing grub and the new mbr to the pendrive.

Just so I'm clear, what I have recommended so far is booting up with the live distro to get access to the grub menu, but booting up with the kernel and initrd file on your hard drive.

You can also enter "kernel (hd0,1)/vmlinux-<version>" and "initrd (hd0,1)/initrd-<version>" lines manually in the grub shell. Use tab competion to help with locating the kernel and typing it in correctly. Then on the third line enter "boot". This should boot you up to your normal system.


---

To mount the other system partitions (only if you need to) from your live distro, you may need to run "vgmknodes" to create the device nodes for the lvm logical volumes. But since the boot partition is on /dev/sda2, if you can boot up with your systems kernel and initrd ramdisk, the kernel will detect the logical partitions for you.

Last edited by jschiwal; 10-31-2008 at 05:58 PM.
 
Old 10-31-2008, 09:21 PM   #5
shickidyshade
LQ Newbie
 
Registered: Sep 2008
Posts: 25

Original Poster
Rep: Reputation: 15
Got it to finally work thanks for the help.
 
  


Reply



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
Why /boot/grub/grub.conf is symlinked to /boot/grub/menu.lst raj_hcl1986@rediffma Linux - Newbie 2 10-19-2008 02:19 AM
boot to GUI problem want grub boot to single user mode. hocheetiong Linux - Newbie 1 09-26-2007 06:41 PM
GRUB dual boot problem: Boot "other" (windows) just restarts GRUB! stevod333 Linux - Software 13 04-06-2006 05:26 AM
need to access /boot/grub/menu.lst and /boot/grub/device.map neouto Linux - Newbie 8 09-04-2005 11:45 AM
Grub setup problem (/boot/grub/stage1 not found) davidas Debian 2 04-28-2004 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration