Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I was trying to play around with my system after learning how to install and repair grub. Was enjoying it actually till now. When I execute find /boot/grub/stage1, I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,274

    [SOLVED] Darn, I Lost Grub Again. help Please


    Hi,

    I was trying to play around with my system after learning how to install and repair grub.
    Was enjoying it actually till now. When I execute find /boot/grub/stage1, I only get (hd0,4). It used to be (hd0,4), (hd0,7) and (hd0,8 ). I lost (hd0,7) AND (hd0,8 ) I would really appreciate any help for the second time and thanks for your patience

    Code:
    [root@localhost ~]# 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        1930    15502693+   7  HPFS/NTFS
    /dev/sda2            1931       15817   111547327+   5  Extended
    /dev/sda3           15818       29555   110350485    7  HPFS/NTFS
    /dev/sda4           29556       30401     6795495   82  Linux swap / Solaris
    /dev/sda5            1931        3835    15301881   83  Linux
    /dev/sda6            9778       14512    38033856   83  Linux
    /dev/sda7            3836        5224    11157111   83  Linux
    /dev/sda8            5225        9777    36571941   83  Linux
    /dev/sda9           14513       15817    10481663+  83  Linux
    
    Partition table entries are not in disk order
    [root@localhost ~]# grub
    Probing devices to guess BIOS drives. This may take a long time.
    
    
        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
    
     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]
    grub> find /boot/grub/stage1
    find /boot/grub/stage1
     (hd0,4)
     
    grub>
    Tried to repair with the following but was not able to.
    Code:
    [jun@localhost ~]$ su -
    Password: 
    [root@localhost ~]# grub
    Probing devices to guess BIOS drives. This may take a long time.
    
    
        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
    
     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]
    grub> find /boot/grub/stage1
    find /boot/grub/stage1
     (hd0,4)
    grub> (hd0,7)
    (hd0,7)
    
    Error 27: Unrecognized command
    grub> root (hd0,7)
    root (hd0,7)
     Filesystem type is ext2fs, partition type 0x83
    grub> setup (hd0)
    setup (hd0)
     Checking if "/boot/grub/stage1" exists... no
     Checking if "/grub/stage1" exists... no
    
    Error 15t: File not found
    grub>
    Want to restore my (hd0,7) since there is where my complete menu is. Thanks

    EDIT: I was able to go to my (hd0,7) grub via terminal and its still intact.

    Code:
    # menu.lst - See: grub(8), info grub, update-grub(8)
    #            grub-install(8), grub-floppy(8),
    #            grub-md5-crypt, /usr/share/doc/grub
    #            and /usr/share/doc/grub-legacy-doc/.
    
    ## default num
    # Set the default entry to the entry number NUM. Numbering starts from 0, and
    # the entry number 0 is the default if the command is not used.
    #
    # You can specify 'saved' instead of a number. In this case, the default entry
    # is the entry saved with the command 'savedefault'.
    # WARNING: If you are using dmraid do not change this entry to 'saved' or your
    # array will desync and will not let you boot your system.
    default         0
    
    ## Graphical boot menu location
    gfxmenu=/boot/gfxmenu/linuxmint.message
    
    ## timeout sec
    ## timeout sec
    # Set a timeout, in SEC seconds, before automatically booting the default entry
    # (normally the first entry defined).
    timeout         120
    
    # Pretty colours
    color cyan/blue white/blue
    
    ## password ['--md5'] passwd
    # If used in the first section of a menu file, disable all interactive editing
    # control (menu entry editor and command-line)  and entries protected by the
    # command 'lock'
    # e.g. password topsecret
    #      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
    # password topsecret
    
    #
    # examples
    #
    #
    # title         Windows 95/98/NT/2000
    # root          (hd0,0)
    # makeactive
    # chainloader   +1
    #
    # title         Linux
    # root          (hd0,1)
    # kernel        /vmlinuz root=/dev/hda2 ro
    #
    
    #
    # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    
    ### BEGIN AUTOMAGIC KERNELS LIST
    ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    ## by the debian update-grub script except for the default options below
    
    ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    ## ## Start Default Options ##
    ## default kernel options
    ## default kernel options for automagic boot options
    ## If you want special options for specific kernels use kopt_x_y_z
    ## where x.y.z is kernel version. Minor versions can be omitted.
    ## e.g. kopt=root=/dev/hda1 ro
    ##	kopt_2_6_8=root=/dev/hdc1 ro
    ##	kopt_2_6_8_2_686=root=/dev/hdc2 ro
    # kopt=root=/dev/sda8 ro
    
    ## default grub root device
    ## e.g. groot=(hd0,0)
    # groot=(hd0,7)
    
    ## should update-grub create alternative automagic boot options
    ## e.g. alternative=true
    ## should update-grub lock alternative automagic boot options
    ## e.g. lockalternative=true
    ##	lockalternative=false
    # lockalternative=false
    
    ## additional options to use with the default boot option, but not with the
    ## alternatives
    ## e.g. defoptions=vga=791 resume=/dev/hda5
    # defoptions=quiet splash
    
    ## should update-grub lock old automagic boot options
    ## e.g. lockold=false
    ##	lockold=true
    # lockold=false
    ## Xen hypervisor options to use with the default Xen boot option
    # xenhopt=
    
    ## Xen Linux kernel options to use with the default Xen boot option
    # xenkopt=console=tty0
    
    ## altoption boot targets option
    ## multiple altoptions lines are allowed
    ## e.g. altoptions=(extra menu suffix) extra boot options
    ##      altoptions=(single-user) single
    # altoptions=(recovery mode) single
    
    ## controls how many kernels should be put into the menu.lst
    ## only counts the first occurence of a kernel, not the
    ##	alternative kernel options
    ## e.g. howmany=all
    ##	howmany=7
    # howmany=all
    
    ## specify if running in Xen domU or have grub detect automatically
    ## update-grub will ignore non-xen kernels when running in domU and vice versa
    ## e.g. indomU=detect
    ##	indomU=true
    ##      indomU=false
    # indomU=detect
    
    ## should update-grub create memtest86 boot option
    ## e.g. memtest86=true
    ##	memtest86=false
    # memtest86=true
    
    ##	should update-grub adjust the value of the default booted system
    ## can be true or false
    # updatedefaultentry=false
    
    ## should update-grub add savedefault to the default options
    ## can be true or false
    # savedefault=false
    
    ## ## End Default Options ##
    
    title           ( 1 ) Mint Gloria (Linux)
    root            (hd0,7)
    kernel          /boot/vmlinuz-2.6.28-18-generic root=/dev/sda8 ro quiet splash
    initrd          /boot/initrd.img-2.6.28-18-generic
    quiet
    
    title           *******Linux Mint 7 Gloria, kernel 2.6.28-18-generic (recovery $
    root            (hd0,7)
    kernel          /boot/vmlinuz-2.6.28-18-generic root=/dev/sda8 ro single
    initrd          /boot/initrd.img-2.6.28-18-generic
    
    
    #title          Linux Mint 7 Gloria, kernel 2.6.28-11-generic
    root            (hd0,7)
    kernel          /boot/vmlinuz-2.6.28-11-generic root=/dev/sda8 ro quiet splash
    initrd          /boot/initrd.img-2.6.28-11-generic
    quiet
    
    #title          Linux Mint 7 Gloria, kernel 2.6.28-11-generic (recovery mode)
    root            (hd0,7)
    kernel          /boot/vmlinuz-2.6.28-11-generic root=/dev/sda8 ro single
    initrd          /boot/initrd.img-2.6.28-11-generic
    
    title           *******Linux Mint 7 Gloria, memtest86+
    root            (hd0,7)
    kernel          /boot/memtest86+.bin
    quiet
    
    ### END DEBIAN AUTOMAGIC KERNELS LIST
    
    # This is a divider, added to separate the menu items below from the Debian
    # ones.
    #title          Other operating systems:
    root
    
    
    # This entry automatically added by the Debian installer for a non-linux OS
    # on /dev/sda1
    title           ( 2 ) XP (Windoze)
    rootnoverify    (hd0,0)
    savedefault
    makeactive
    chainloader     +1
    
    
    # This entry automatically added by the Debian installer for an existing
    # linux installation on /dev/sda5.
    title           ( 3 ) Fedora Cambridge (Linux)
    root            (hd0,4)
    kernel          /boot/vmlinuz-2.6.27.41-170.2.117.fc10.i686 ro root=UUID=2776ef$
    initrd          /boot/initrd-2.6.27.41-170.2.117.fc10.i686.img
    savedefault
    boot
    
    # This entry automatically added by the Debian installer for an existing
    # linux installation on /dev/sda7.
    title           ( 4 ) Ubuntu Karmic Koala & Studio Hybrid (Linux)
    root            (hd0,6)
    kernel          /boot/vmlinuz-2.6.31-20-generic root=UUID=62310446-d606-4c7a-81$
    initrd          /boot/initrd.img-2.6.31-20-generic
    savedefault
    boot
    
    # This entry automatically added by the Debian installer for an existing
    # linux installation on /dev/sda7.
    #title          Ubuntu, Linux 2.6.31-20-generic (recovery mode) (on /dev/sda7)
    root            (hd0,6)
    kernel          /boot/vmlinuz-2.6.31-20-generic root=UUID=62310446-d606-4c7a-81$
    initrd          /boot/initrd.img-2.6.31-20-generic
    savedefault
    boot
    
    
    # This entry automatically added by the Debian installer for an existing
    # linux installation on /dev/sda9.
    title ( 5 ) Fedora Constantine (2.6.32.12-115.fc12.i686)
            root (hd0,8)
            kernel /boot/vmlinuz-2.6.32.12-115.fc12.i686 ro root=UUID=9ea4d6d1-b9d$
            initrd /boot/initramfs-2.6.32.12-115.fc12.i686.img
    Last edited by nujinini; 05-22-2010 at 04:12 PM.
    nujinini
    Linux User #489667

  2. #2
    Linux Engineer nujinini's Avatar
    Join Date
    Apr 2009
    Posts
    1,274
    Ooopss. Got it back. Live CD to the rescue.

    Thanks anyway
    nujinini
    Linux User #489667

Posting Permissions

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