Find the answer to your Linux question:
Results 1 to 4 of 4
i had rhel5 server on my machine and then i reinstalled my windows XP later. Now i don't see the grub screen to choose between XP and Linux. then i ...
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    15

    Exclamation problem on reinstalling windows over linux

    i had rhel5 server on my machine and then i reinstalled my windows XP later. Now i don't see the grub screen to choose between XP and Linux.

    then i booted my computer through rhel5 DVD and started it on linux rescue mode.

    it gives an error as "you don't have any linux partitions.

    then i tried to mount my partitions manually.

    sh-3.1# df -h
    /dev /dev
    /tmp/loop0 /mnt/runtime

    sh-3.1# fdisk -l

    /dev/sda1 HPFS/NTFS
    /dev/sda2 W95 Ext'd (LBA)
    /dev/sda3 HPFS/NTFS
    /dev/sda5 Linux (/boot)
    /dev/sda6 Linux (/)
    /dev/sda7 Linux (/var1)
    /dev/sda8 Linux (/backup)
    /dev/sda9 Linux Swap / Solaris
    /dev/sda10 Linux (/home)
    /dev/sda11 W95 FAT32

    even in mnt directory i don't find sysimage directory so i made one and mounted my partitions in it

    sh-3.1# mount /dev/sda6 /mnt/sysimage
    sh-3.1# mount /dev/sda5 /mnt/sysimage/boot
    sh-3.1# mount /dev/sda7 /mnt/sysimage/var
    sh-3.1# mount /dev/sda8 /mnt/sysimage/backup
    sh-3.1# mount /dev/sda10 /mnt/sysimage/home

    now it shows whole mounted disks while df -h

    now i chrooted

    sh-3.1# chroot /mnt/sysimage

    sh-3.1# /sbin/grub-install /dev/sda

    It gives an error the sda is not a block device

    Please help me out

  2. #2
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    you chrooted to /mnt/sysimage, so you are trying to install your grub image to /mnt/sysimage/dev/sda

    obviously this won't work as is. you have to mount your device directory into your chrooted environment.

    mount -o bind /dev /mnt/sysimage/dev

    THEN chroot, then grub-install
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  3. #3
    Just Joined!
    Join Date
    Jun 2009
    Posts
    15
    i have done as u said but still it gives an error on installing the grub
    the error as
    " The file /boot/grub/stage1 not read correctly. "
    so what am i supposed to do now......

  4. #4
    Just Joined! megerdin's Avatar
    Join Date
    Jul 2007
    Location
    Sylhet,Bangladesh
    Posts
    78
    Boot into any linux live CD.

    Here UBUNTU Live CD used. This can be the live installer cd or the older live session Ubuntu cds.

    When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)

    Code:
    Code:
    sudo grub
    This will get you a “grub>” prompt (i.e. the grub shell). At grub>. enter these commands

    Code:

    Code:
    find /boot/grub/stage1
    This will return a location. If you have more than one, select the installation that you want to provide the grub files.
    Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>.
    when you enter the next 3 commands)

    Code:

    Code:
    root (hd?,?)
    Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

    Next enter the command to install grub to the mbr

    Code:
    Code:
    setup (hd0)
    Finally exit the grub shell
    Code:

    Code:
    quit
    That is it. Grub will be installed to the mbr.
    When you reboot, you will have the grub menu at startup.


    let me know if its not work.

Posting Permissions

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