Find the answer to your Linux question:
Results 1 to 5 of 5
Ok, so here is my problem. I had a dual boot with M$ and linux. I, as I normally do, was messing around and broke the system. That was fine. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2010
    Posts
    40

    GRUB rescue> after changing a partition table


    Ok, so here is my problem. I had a dual boot with M$ and linux. I, as I normally do, was messing around and broke the system. That was fine. I resetup the dual boot but accidentally, instead of installing over my broken linux install I added another side-by-side OS. I found this out, and went to fix it.

    I then deleted the old linux partitions, and then moved the new one back and expanded it to fill the empty space. After that, as I predicted of going to happen, grub got all confused. I then put in a few set commands and isnmod to get me back to the normal grub menu. From there, I edited an entry so I could boot into linux and then ran "grub-mkconfig -o /boot/grub/grub.cfg" so grub would regenerate the config file.

    I rebooted and got the same error message. I have looked at the entries for the windows kernel and the linux kernel and they are both good. What am I missing?

  2. #2
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    After that, as I predicted of going to happen, grub got all confused.
    How could that happen? Are you using custom GRUB? Haven't installer installed GRUB in MBR and setup dual boot itself?

    Exactly what error message are you getting?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  3. #3
    Just Joined!
    Join Date
    Feb 2010
    Posts
    40
    the exact error is:
    "error: no such partition"

    From there is goes into a grub rescue prompt. I expected this to happen though.
    I had two operating systems installed:
    Windows---Linux

    Then I added one and had three operating systems installed:
    Windows(sda1,2,3)---Linux(sda4,5)---Linux(new)(sda6,7)

    After that I deleted the first linux kernel and all of its related partitions(/dev/sda5, /dev/sda6). Next I moved the latter one back and resized its main partition to fill the space. So grub which is located on the second linux install got had its partition name changed when I deleted the first linux install(sda4,5) because then sda6,7 were changed to sda4,5.
    That would have messed up the references in the MBR and given the grub error. Right?
    Last edited by goldfish777; 09-24-2011 at 02:37 AM.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Feb 2010
    Posts
    40
    So here is the partition table as stated by fdisk:
    Code:
    Disk /dev/sda: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xe686f016
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1           6       48163+  de  Dell Utility
    /dev/sda2              19       13758   110359583    7  HPFS/NTFS
    /dev/sda3           14410       30402   128457729    5  Extended
    /dev/sda4           13759       14409     5229157+  db  CP/M / CTOS / ...
    /dev/sda5           14410       29450   120808448   83  Linux
    /dev/sda6           29450       30402     7647232   82  Linux swap / Solaris
    
    Partition table entries are not in disk order
    And here is grub.cfg:
    Code:
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #
    
    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
      load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
      set saved_entry=${prev_saved_entry}
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
    fi
    
    function savedefault {
      if [ -z ${boot_once} ]; then
        saved_entry=${chosen}
        save_env saved_entry
      fi
    }
    
    function recordfail {
      set recordfail=1
      if [ -n ${have_grubenv} ]; then if [ -z ${boot_once} ]; then save_env recordfail; fi; fi
    }
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=1024x768
      set gfxpayload=keep
      insmod gfxterm
      insmod vbe
      if terminal_output gfxterm ; then true ; else
        # For backward compatibility with versions of terminal.mod that don't
        # understand terminal_output
        terminal gfxterm
      fi
    fi
    insmod ext2
    set root='(hd0,5)'
    search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    set locale_dir=($root)/boot/grub/locale
    set lang=en
    insmod gettext
    if [ ${recordfail} = 1 ]; then
      set timeout=-1
    else
      set timeout=10
    fi
    ### END /etc/grub.d/00_header ###
    
    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    ### END /etc/grub.d/05_debian_theme ###
    
    ### BEGIN /etc/grub.d/10_linux ###
    menuentry 'Ubuntu, with Linux 2.6.38' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod ext2
    	set root='(hd0,5)'
    	search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    	linux	/boot/vmlinuz-2.6.38 root=UUID=91a5ea04-14b8-4124-b1c7-73db8e58bc85 ro   text splash nomodeset vga=791
    	initrd	/boot/initrd.img-2.6.38
    }
    menuentry 'Ubuntu, with Linux 2.6.38 (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
    	recordfail
    	insmod ext2
    	set root='(hd0,5)'
    	search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    	echo	'Loading Linux 2.6.38 ...'
    	linux	/boot/vmlinuz-2.6.38 root=UUID=91a5ea04-14b8-4124-b1c7-73db8e58bc85 ro single 
    	echo	'Loading initial ramdisk ...'
    	initrd	/boot/initrd.img-2.6.38
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    	insmod ext2
    	set root='(hd0,5)'
    	search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    	linux16	/boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    	insmod ext2
    	set root='(hd0,5)'
    	search --no-floppy --fs-uuid --set 91a5ea04-14b8-4124-b1c7-73db8e58bc85
    	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Dell Utility Partition (on /dev/sda1)" {
    	insmod fat
    	set root='(hd0,1)'
    	search --no-floppy --fs-uuid --set 07d6-0913
    	drivemap -s (hd0) ${root}
    	chainloader +1
    }
    menuentry "Windows XP Media Center Edition (on /dev/sda2)" {
    	insmod ntfs
    	set root='(hd0,2)'
    	search --no-floppy --fs-uuid --set 641C36851C3651F2
    	drivemap -s (hd0) ${root}
    	chainloader +1
    }
    menuentry "Windows NT/2000/XP (on /dev/sda4)" {
    	insmod fat
    	set root='(hd0,4)'
    	search --no-floppy --fs-uuid --set 4510-0903
    	drivemap -s (hd0) ${root}
    	chainloader +1
    }
    ### END /etc/grub.d/30_os-prober ###
    
    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###

  6. #5
    Just Joined!
    Join Date
    Feb 2010
    Posts
    40
    So I got it fixed. I don't know how exactly to fix it except maybe reinstall GRUB. I just found out that my 6 year old laptop has a 64bit processor so I reinstalled Linux with a 64bit version and with that came a fresh install of GRUB.

    Thanks, but all is well.

Posting Permissions

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