Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Need to restore Grub (XP, Ubuntu, messed up installation)

  1. #1
    Join Date
    Dec 2007
    Beans
    82

    [SOLVED] Need to restore Grub (XP, Ubuntu, messed up installation)

    Hi guys.

    Previously I had Windows XP and Ubuntu 10.10 installed. Today I decided to reinstall Ubuntu 10.10, so I went ahead and did the installation (simply install via CD and deleted the old Ubuntu partitions).

    I also deleted one of my NTFS drive called "Programming" which I used to store some of my programming stuff. I deleted it because I want to allocate more space for Ubuntu.

    Long story short. After the installation, I used GParted to format the unallocated space (28.1 GB) into NTFS. But it was not recgonized by Windows. I run the cheap RAID under Windows, so there are two 500GB disks.

    I deleted that free partiation afterward (from both devices, sda, sdb). When I reboot I received grub rescue. I restored my MBR and I was able to go to XP.

    Here is the result.txt generated ussing the Boot Info script:

    Code:
                      Boot Info Script 0.60    from 17 May 2011
    
    
    ============================= Boot Info Summary: ===============================
    
     => Lilo is installed in the MBR of /dev/sda.
     => Lilo is installed in the MBR of /dev/mapper/isw_bhjiaijgjj_Volume0.
    
    sda1: __________________________________________________________________________
    
        File system:       
        Boot sector type:  Unknown
        Boot sector info:  
        Mounting failed:   mount: unknown filesystem type ''
    
    sda2: __________________________________________________________________________
    
        File system:       Extended Partition
        Boot sector type:  Unknown
        Boot sector info:  
    
    sda5: __________________________________________________________________________
    
        File system:       
        Boot sector type:  Unknown
        Boot sector info:  
        Mounting failed:   mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    
    sda6: __________________________________________________________________________
    
        File system:       
        Boot sector type:  Unknown
        Boot sector info:  
        Mounting failed:   mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    
    sda7: __________________________________________________________________________
    
        File system:       
        Boot sector type:  Unknown
        Boot sector info:  
        Mounting failed:   mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    mount: unknown filesystem type ''
    
    isw_bhjiaijgjj_Volume01: _______________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows XP
        Boot sector info:   No errors found in the Boot Parameter Block.
        Operating System:  Windows XP
        Boot files:        /boot.ini /ntldr /NTDETECT.COM
    
    isw_bhjiaijgjj_Volume02: _______________________________________________________
    
        File system:       Extended Partition
        Boot sector type:  Unknown
        Boot sector info:  
    
    isw_bhjiaijgjj_Volume05: _______________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows XP
        Boot sector info:   According to the info in the boot sector, 
                           isw_bhjiaijgjj_Volume05 starts at sector 63.
        Operating System:  
        Boot files:        
    
    isw_bhjiaijgjj_Volume06: _______________________________________________________
    
        File system:       swap
        Boot sector type:  -
        Boot sector info:  
    
    isw_bhjiaijgjj_Volume07: _______________________________________________________
    
        File system:       ext4
        Boot sector type:  -
        Boot sector info:  
        Operating System:  Ubuntu 10.10
        Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img
    
    ============================ Drive/Partition Info: =============================
    
    Drive: sda _____________________________________________________________________
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    
    Partition  Boot  Start Sector    End Sector  # of Sectors  Id System
    
    /dev/sda1    *             63   167,766,794   167,766,732   7 NTFS / exFAT / HPFS
    /dev/sda2         167,766,856   974,813,183   807,046,328   f W95 Extended (LBA)
    /dev/sda5         167,766,858   587,191,814   419,424,957   7 NTFS / exFAT / HPFS
    /dev/sda6         647,194,624   651,192,319     3,997,696  82 Linux swap / Solaris
    /dev/sda7         651,194,368   974,813,183   323,618,816  83 Linux
    
    
    Drive: isw_bhjiaijgjj_Volume0 _____________________________________________________________________
    
    Disk /dev/mapper/isw_bhjiaijgjj_Volume0: 500.1 GB, 500104826880 bytes
    255 heads, 63 sectors/track, 60800 cylinders, total 976767240 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    
    Partition  Boot  Start Sector    End Sector  # of Sectors  Id System
    
    /dev/mapper/isw_bhjiaijgjj_Volume01   *             63   167,766,794   167,766,732   7 NTFS / exFAT / HPFS
    /dev/mapper/isw_bhjiaijgjj_Volume02        167,766,856   974,813,183   807,046,328   f W95 Extended (LBA)
    /dev/mapper/isw_bhjiaijgjj_Volume05        167,766,858   587,191,814   419,424,957   7 NTFS / exFAT / HPFS
    /dev/mapper/isw_bhjiaijgjj_Volume06        647,194,624   651,192,319     3,997,696  82 Linux swap / Solaris
    /dev/mapper/isw_bhjiaijgjj_Volume07        651,194,368   974,813,183   323,618,816  83 Linux
    
    
    "blkid" output: ________________________________________________________________
    
    Device           UUID                                   TYPE       LABEL
    
    /dev/loop0                                              squashfs   
    /dev/mapper/isw_bhjiaijgjj_Volume01 C08835D58835CAA4                       ntfs       
    /dev/mapper/isw_bhjiaijgjj_Volume05 8680DC0280DBF721                       ntfs       Personal
    /dev/mapper/isw_bhjiaijgjj_Volume06 214636e7-0858-4f46-804b-9682f80198c9   swap       
    /dev/mapper/isw_bhjiaijgjj_Volume07 703654c3-fe59-4cc3-8fef-135eb78d00e8   ext4       
    /dev/sda                                                isw_raid_member 
    /dev/sdc                                                isw_raid_member 
    
    ========================= "ls -R /dev/mapper/" output: =========================
    
    /dev/mapper:
    control
    isw_bhjiaijgjj_Volume0
    isw_bhjiaijgjj_Volume01
    isw_bhjiaijgjj_Volume05
    isw_bhjiaijgjj_Volume06
    isw_bhjiaijgjj_Volume07
    
    ================================ Mount points: =================================
    
    Device           Mount_Point              Type       Options
    
    /dev/loop0       /rofs                    squashfs   (ro,noatime)
    /dev/mapper/isw_bhjiaijgjj_Volume01 /media/C08835D58835CAA4  fuseblk    (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions)
    /dev/mapper/isw_bhjiaijgjj_Volume07 /media/703654c3-fe59-4cc3-8fef-135eb78d00e8 ext4       (rw,nosuid,nodev,uhelper=udisks)
    /dev/sr0         /cdrom                   iso9660    (ro,noatime)
    
    
    ====================== isw_bhjiaijgjj_Volume01/boot.ini: =======================
    
    --------------------------------------------------------------------------------
    [boot loader]
    
    timeout=30
    
    default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
    
    [operating systems]
    
    multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect
    
    --------------------------------------------------------------------------------
    
    ================= isw_bhjiaijgjj_Volume07/boot/grub/grub.cfg: ==================
    
    --------------------------------------------------------------------------------
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by 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
      set have_grubenv=true
      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
    }
    
    function load_video {
      insmod vbe
      insmod vga
    }
    
    insmod part_msdos
    insmod ext2
    set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
    search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
    if loadfont /usr/share/grub/unicode.pf2 ; then
      set gfxmode=640x480
      load_video
      insmod gfxterm
    fi
    terminal_output gfxterm
    insmod part_msdos
    insmod ext2
    set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
    search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
    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.35-28-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        linux    /boot/vmlinuz-2.6.35-28-generic root=UUID=703654c3-fe59-4cc3-8fef-135eb78d00e8 ro   quiet splash
        initrd    /boot/initrd.img-2.6.35-28-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-28-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        echo    'Loading Linux 2.6.35-28-generic ...'
        linux    /boot/vmlinuz-2.6.35-28-generic root=UUID=703654c3-fe59-4cc3-8fef-135eb78d00e8 ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.35-28-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=703654c3-fe59-4cc3-8fef-135eb78d00e8 ro   quiet splash
        initrd    /boot/initrd.img-2.6.35-22-generic
    }
    menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        echo    'Loading Linux 2.6.35-22-generic ...'
        linux    /boot/vmlinuz-2.6.35-22-generic root=UUID=703654c3-fe59-4cc3-8fef-135eb78d00e8 ro single 
        echo    'Loading initial ramdisk ...'
        initrd    /boot/initrd.img-2.6.35-22-generic
    }
    ### END /etc/grub.d/10_linux ###
    
    ### BEGIN /etc/grub.d/20_linux_xen ###
    ### END /etc/grub.d/20_linux_xen ###
    
    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        linux16    /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos8)'
        search --no-floppy --fs-uuid --set 703654c3-fe59-4cc3-8fef-135eb78d00e8
        linux16    /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###
    
    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Microsoft Windows XP Professional (on /dev/mapper/isw_bhjiaijgjj_Volume01)" {
        insmod part_msdos
        insmod ntfs
        set root='(/dev/mapper/isw_bhjiaijgjj_Volume0,msdos1)'
        search --no-floppy --fs-uuid --set c08835d58835caa4
        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 ###
    
    ### BEGIN /etc/grub.d/41_custom ###
    if [ -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    --------------------------------------------------------------------------------
    
    ====================== isw_bhjiaijgjj_Volume07/etc/fstab: ======================
    
    --------------------------------------------------------------------------------
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc            /proc           proc    nodev,noexec,nosuid 0       0
    /dev/mapper/isw_bhjiaijgjj_Volume08 /               ext4    errors=remount-ro 0       1
    /dev/mapper/isw_bhjiaijgjj_Volume07 none            swap    sw              0       0
    --------------------------------------------------------------------------------
    
    ========== isw_bhjiaijgjj_Volume07: Location of files loaded by Grub: ==========
    
               GiB - GB             File                                 Fragment(s)
    
     338.647003174 = 363.619450880  boot/grub/core.img                             1
     368.701122284 = 395.889815552  boot/grub/grub.cfg                             1
     360.792587280 = 387.398090752  boot/initrd.img-2.6.35-22-generic              2
     311.185546875 = 334.132936704  boot/initrd.img-2.6.35-28-generic              2
     338.651000977 = 363.623743488  boot/vmlinuz-2.6.35-22-generic                 1
     338.645549774 = 363.617890304  boot/vmlinuz-2.6.35-28-generic                 1
     311.185546875 = 334.132936704  initrd.img                                     2
     360.792587280 = 387.398090752  initrd.img.old                                 2
     338.645549774 = 363.617890304  vmlinuz                                        1
     338.651000977 = 363.623743488  vmlinuz.old                                    1
    
    ======================== Unknown MBRs/Boot Sectors/etc: ========================
    
    Unknown BootLoader on sda1
    
    
    Unknown BootLoader on sda2
    
    
    Unknown BootLoader on sda5
    
    
    Unknown BootLoader on sda6
    
    
    Unknown BootLoader on sda7
    
    
    Unknown BootLoader on isw_bhjiaijgjj_Volume02
    
    
    
    =============================== StdErr Messages: ===============================
    
    hexdump: /dev/sda1: No such file or directory
    hexdump: /dev/sda1: No such file or directory
    hexdump: /dev/sda2: No such file or directory
    hexdump: /dev/sda2: No such file or directory
    hexdump: /dev/sda5: No such file or directory
    hexdump: /dev/sda5: No such file or directory
    hexdump: /dev/sda6: No such file or directory
    hexdump: /dev/sda6: No such file or directory
    hexdump: /dev/sda7: No such file or directory
    hexdump: /dev/sda7: No such file or directory
    hexdump: /dev/mapper/isw_bhjiaijgjj_Volume02: No such file or directory
    hexdump: /dev/mapper/isw_bhjiaijgjj_Volume02: No such file or directory



    From what I see, the archive configuration leaves a mess there.

    I want to achieve two things:
    (1) restore Grub and clean up the mess bootloader
    (2) format the free space (28.1 GB) NTFS, and make it available (read/write/accessible) to both XP and Linux.

    May someone please help me on this?

    Thank you very much.
    Last edited by jwxie; May 31st, 2011 at 12:05 AM.

  2. #2
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,208
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    It appears that you are using Intel raid (set in bios).
    If that is the case your gparted screenshot is not normal, I think.
    In my experience when a "fakeraid" array is used /dev/sda and, in your case /dev/sdc should show as unpartitioned.
    In gparted the only device that should show partitions is (in your case) /dev/mapper/isw_bhjiaijgjj_Volume0, which should be accessible by clicking on the little arrow next to the box with /dev/sda in it.
    Does that appear?

    If not it may be that having made adjustments to your partitions on /dev/sda, you have broken the raid array. Check that in your bios, maybe.
    MacBook Pro 10,1 retina

  3. #3
    Join Date
    Dec 2007
    Beans
    82

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Quote Originally Posted by Quackers View Post
    .....

    If not it may be that having made adjustments to your partitions on /dev/sda, you have broken the raid array. Check that in your bios, maybe.
    You are very correct, Quackers. I forgot to set RAID back to 1st boot. However, that being said, I cannot use live cd to boot into Ubuntu now, because I am setting RAID-0 as 1st boot option.

    I don't know any other ways to verify your claim.
    However, I do think you are correct.

    Now if you are correct, how do I go about solving #1?
    I tried sudo grub but when I am on the live cd it gives me error said "command grub doesn't exist" (I think...)

    Thanks!

    --- EDITED
    I have asked a similar question before, but that was when I didn't have RAID0.
    Last edited by jwxie; May 28th, 2011 at 10:22 PM.

  4. #4
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,208
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Try entering your bios and then go into your RAID screen (probably by pressing ctrl+I when asked. Then look to see if your raid array reports "normal" or "failed"
    MacBook Pro 10,1 retina

  5. #5
    Join Date
    Dec 2007
    Beans
    82

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Hi Quackers,
    Indeed for me Ctrl + I does the trick!
    It said Normal and bootable.

  6. #6
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,208
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    So, in the live cd desktop open up gparted.
    Near the top right is the box which shows /dev/sda.
    If you click on the little arrow next to that is one of the options
    /dev/mapper/isw_bhjiaijgjj_Volume0
    MacBook Pro 10,1 retina

  7. #7
    Join Date
    Dec 2007
    Beans
    82

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Hi. Sorry it takes a while to boot into Ubuntu using live cd

    No, there is none, only SDA and SDC are shown. I think that's because I set BOOT BY CD as first option. I cannot boot into live cd without changing the boot order...

    sudo grub
    grub: command not found

  8. #8
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,208
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Please try something for me. I don't think it should be necessary with 10.10 but it won't do any harm.
    Please close gparted then go to synaptic package manager and install kpartx. Once installed close synaptic then re-open gparted and try that little arrow again and see if the /dev/mapper option appears.
    MacBook Pro 10,1 retina

  9. #9
    Join Date
    Dec 2007
    Beans
    82

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    HI!

    Yes. It shows up!



    All 3.

    Volume0, dev/sad, dev/sdb, all 465.76GiB

  10. #10
    Join Date
    Aug 2007
    Location
    a puddle in Manchester
    Beans
    9,208
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Need to restore Grub (XP, Ubuntu, messed up installation)

    Ok, when /dev/sda and /dev/sdb are selected do they appear as empty?
    MacBook Pro 10,1 retina

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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