Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hello Everybody, I was editing the grub in my dual boot fedora 11/XP laptop earlier by gedit. Since the Fedora already was updated, the grub is showing me TWO choices ...
  1. #1
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229

    Erased Kernel by Accident (Grub)

    Hello Everybody,

    I was editing the grub in my dual boot fedora 11/XP laptop earlier by gedit. Since the Fedora already was updated, the grub is showing me TWO choices and since I wanted it to look "cleaner" I tried to edit using gedit. Stupid me erased everything and just just left the "Fedora" word. Now I realize I also removed the kernel. When I restarted, the grub did not show any Fedora and only Windows XP.

    Can somebody PLEASE help me reinstall, or repair this problem of mine?

    Thanks in advance!

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Its really easy to recreate grub.conf file.

    Boot up from LiveCD of any Linux distro. Mount / ( or /boot, if any ) partition and post the name of files available under /boot
    Code:
    mkdir Linux
    mount -t ext3  /dev/<partition> Linux
    cd Linux/boot
    ls
    Post the contents of grub.conf file and output of fdisk -l command too.


    Sample :
    Code:
    default=0
    timeout=10
    
    title Windows OS
    rootnoverify (hd0,0)
    chainload +1
    
    title Fedora
    root (hdx,x)
    kernel  /vmlinuz-xxxxx  ro root=/dev/xxx
    initrd    /initrd-xxxxx
    You have to replace x with correct values. Code for Windows OS will work fine without any change.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Quote Originally Posted by devils casper View Post
    Its really easy to recreate grub.conf file.

    Boot up from LiveCD of any Linux distro. Mount / ( or /boot, if any ) partition and post the name of files available under /boot
    Code:
    mkdir Linux
    mount -t ext3  /dev/<partition> Linux
    cd Linux/boot
    ls
    Post the contents of grub.conf file and output of fdisk -l command too.


    Sample :
    Code:
    default=0
    timeout=10
    
    title Windows OS
    rootnoverify (hd0,0)
    chainload +1
    
    title Fedora
    root (hdx,x)
    kernel  /vmlinuz-xxxxx  ro root=/dev/xxx
    initrd    /initrd-xxxxx
    You have to replace x with correct values. Code for Windows OS will work fine without any change.
    Hello DC,

    Thank you for your quick response and help. I have a PC linux live cd and do your instructions. I will get back soonest.

  4. #4
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Quote Originally Posted by nujinini View Post
    Hello DC,

    Thank you for your quick response and help. I have a PC linux live cd and do your instructions. I will get back soonest.


    HTML Code:
    [root@localhost Linux]# fdisk -l
    
    Disk /dev/sda: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0xc5e3f820
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        1913    15366141    7  HPFS/NTFS
    /dev/sda2            1914       30259   227689245    f  W95 Ext'd (LBA)
    /dev/sda3           30260       30402     1135800   12  Compaq diagnostics
    /dev/sda5            1914       25497   189438448+   7  HPFS/NTFS
    /dev/sda6           27411       27435      200781   83  Linux
    /dev/sda7           27436       30259    22683748+  8e  Linux LVM
    [root@localhost Linux]# mount -t /dev/sda5
    [root@localhost Linux]# ls
    [root@localhost Linux]#
    Can you kindly check if I am doing the right thing please?

  5. #5
    Super Moderator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,145
    You want to mount the Linux drive right?
    The command would be
    Code:
    mkdir /linux
    mount -t ext /dev/hda6 /linux
    Your files will be in /linux directory.
    Code:
    ls /linux/boot
    cat /linux/boot/grub/menu.lst
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Execute this
    Code:
    su -
    mkdir /media/Linux
    mount -t ext3 /dev/sda6 /media/Linux
    cd /media/Linux
    ls
    Note down filenames of vmlinuz and initrd files and execute this
    Code:
    nano /media/Linux/grub/grub.conf
    Add these contents :
    Code:
    default=0
    timeout=10
    
    title Windows OS
    rootnoverify (hd0,0)
    chainload +1
    
    title Fedora
    root (hd0,5)
    kernel  /vmlinuz ro root=/dev/sda7
    initrd    /initrd
    Replace vmlinuz and initrd with actual filenames.

    Press Ctrl+X, Y and hit Enter key to save file.

    In case it doesn't work, post the output of ls /media/Linux command.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Quote Originally Posted by MikeTbob View Post
    You want to mount the Linux drive right?
    The command would be
    Code:
    mkdir /linux
    mount -t ext /dev/hda6 /linux
    Your files will be in /linux directory.
    Code:
    ls /linux/boot
    cat /linux/boot/grub/menu.lst
    HTML Code:
    [root@localhost Linux]# mkdir linux
    [root@localhost Linux]# mount -t ext /dev/hda6 /linux
    mount: mount point /linux does not exist
    [root@localhost Linux]# mount -t ext /dev/hda6 /linux
    Hi,

    seems to have a problem...

  8. #8
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Quote Originally Posted by devils casper View Post
    Execute this
    Code:
    su -
    mkdir /media/Linux
    mount -t ext3 /dev/sda6 /media/Linux
    cd /media/Linux
    ls
    Note down filenames of vmlinuz and initrd files and execute this
    Code:
    nano /media/Linux/grub/grub.conf
    Add these contents :
    Code:
    default=0
    timeout=10
    
    title Windows OS
    rootnoverify (hd0,0)
    chainload +1
    
    title Fedora
    root (hd0,5)
    kernel  /vmlinuz ro root=/dev/sda7
    initrd    /initrd
    Replace vmlinuz and initrd with actual filenames.

    Press Ctrl+X, Y and hit Enter key to save file.

    In case it doesn't work, post the output of ls /media/Linux command.

    I think I was able to do the first step. Am going to next step

    HTML Code:
    [root@localhost ~]# mkdir /media/Linux
    mkdir: cannot create directory `/media/Linux': File exists
    [root@localhost ~]# rmdir Linux
    rmdir: Linux: No such file or directory
    [root@localhost ~]# rmdir /media/Linux
    rmdir: /media/Linux: Device or resource busy
    [root@localhost ~]# cd /media/Linux
    [root@localhost Linux]# mount -t ext3 /dev/sda6 /media/Linux
    mount: /dev/sda6 already mounted or /media/Linux busy
    mount: according to mtab, /dev/sda6 is already mounted on /media/Linux
    [root@localhost Linux]# cd /media/Linux
    [root@localhost Linux]# ls
    System.map-2.6.29.4-167.fc11.i586  initrd-2.6.29.4-167.fc11.i586.img
    System.map-2.6.29.5-191.fc11.i586  initrd-2.6.29.5-191.fc11.i586.img
    config-2.6.29.4-167.fc11.i586      lost+found/
    config-2.6.29.5-191.fc11.i586      memtest86+-2.11
    efi/                               vmlinuz-2.6.29.4-167.fc11.i586*
    elf-memtest86+-2.11                vmlinuz-2.6.29.5-191.fc11.i586*
    grub/
    [root@localhost Linux]#

  9. #9
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,229
    Quote Originally Posted by devils casper View Post
    Execute this
    Code:
    su -
    mkdir /media/Linux
    mount -t ext3 /dev/sda6 /media/Linux
    cd /media/Linux
    ls
    Note down filenames of vmlinuz and initrd files and execute this
    Code:
    nano /media/Linux/grub/grub.conf
    Add these contents :
    Code:
    default=0
    timeout=10
    
    title Windows OS
    rootnoverify (hd0,0)
    chainload +1
    
    title Fedora
    root (hd0,5)
    kernel  /vmlinuz ro root=/dev/sda7
    initrd    /initrd
    Replace vmlinuz and initrd with actual filenames.

    Press Ctrl+X, Y and hit Enter key to save file.

    In case it doesn't work, post the output of ls /media/Linux command.
    Dear Casper,

    I was able to put back "Fedora" on the grub. However, when I enter I am getting the following: Error 15: File not found.

    I hope it would not be to much to request if you can do the grub config using the info I sent earlier. Maybe I can just copy and paste it to the nano editor? I think I may be putting the wrong things..etc. Below is what I did for your info please.

    HTML Code:
      GNU nano 2.0.7        File: /media/Linux/grub/grub.conf
    
    # grub.conf generated by anaconda
    #
    # Note that you do not have to rerun grub after making changes to this file
    # NOTICE:  You have a /boot partition.  This means that
    #          all kernel and initrd paths are relative to /boot/, eg.
    #          root (hd0,5)
    #          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
    #          initrd /initrd-version.img
    #boot=/dev/sda
    default=0
    timeout=5
    splashimage=(hd0,5)/grub/splash.xpm.gz
    hiddenmenu
    title Fedora
            root (hd0,5)
            kernel  /vmlinuz-2.6.29.5-191.fc11.i586 ro root=/dev/sda7
            initrd  /initrd-2.6.29.5-191.fc11.i586.img
    
                                   [ Read 23 lines ]
    ^G Get Help  ^O WriteOut  ^R Read File ^Y Prev Page ^K Cut Text  ^C Cur Pos
    ^X Exit      ^J Justify   ^W Where Is  ^V Next Page ^U UnCut Text^T T

  10. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Try this
    Code:
    title Fedora
            root (hd0,5)
            kernel  /boot/vmlinuz-2.6.29.5-191.fc11.i586 ro root=/dev/sda7
            initrd  /boot/initrd-2.6.29.5-191.fc11.i586.img
    Or replace /boot with (hd0,5).

    Code:
            kernel  (hd0,5)/vmlinuz-2.6.29.5-191.fc11.i586 ro root=/dev/sda7
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...