Page 21 of 22 FirstFirst ... 1119202122 LastLast
Results 201 to 210 of 211

Thread: HOWTO: Purge and Reinstall Grub 2 from the Live CD

  1. #201
    Join Date
    Jan 2011
    Beans
    22

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Hi drs305,

    Sorry to bring up an old thread. I've just read all 20 pages of the thread hoping someone would have something similar. The closest was post 126 (your reply on 129) as I got the same error. However, he/she actually mounted incorrectly, when I didn't (from what I can tell).

    Here is a link to my original thread where you can find the problem: http://ubuntuforums.org/showthread.php?t=1928297

    So that you don't have to find post 126: I am following your procedure but cannot chroot. I get the error:

    Code:
    chroot: failed to run command `/bin/bash': No such file or directory
    Updated BIS after attempting your steps without finishing:
    Code:
                       Boot Info Script 0.60      [17 May 2011]
    
    
    ============================= Boot Info Summary: ===============================
    
     => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of 
        the same hard drive for core.img. core.img is at this location and looks 
        for (,msdos3)/boot/grub on this drive.
     => Syslinux MBR (4.04 and higher) is installed in the MBR of /dev/sdb.
    
    sda1: __________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows Vista/7: NTFS
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files:        /bootmgr /Boot/BCD
    
    sda2: __________________________________________________________________________
    
        File system:       ntfs
        Boot sector type:  Windows Vista/7: NTFS
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  Windows 7
        Boot files:        /bootmgr /boot/BCD /Windows/System32/winload.exe
    
    sda3: __________________________________________________________________________
    
        File system:       ext4
        Boot sector type:  Grub Legacy
        Boot sector info:  Grub Legacy (v0.97) is installed in the boot sector 
                           of sda3 and looks at sector 1166426584 of the same 
                           hard drive for the stage2 file.  A stage2 file is at 
                           this location on /dev/sda.  Stage2 looks on partition 
                           #3 for /boot/grub/menu.lst.
        Operating System:  Ubuntu 11.10
        Boot files:        /etc/fstab /boot/grub/core.img
    
    sda4: __________________________________________________________________________
    
        File system:       vfat
        Boot sector type:  Windows 7: FAT32
        Boot sector info:  No errors found in the Boot Parameter Block.
        Operating System:  
        Boot files:        
    
    sdb1: __________________________________________________________________________
    
        File system:       vfat
        Boot sector type:  SYSLINUX 4.05 2011-12-09
        Boot sector info:  Syslinux looks at sector 30570 of /dev/sdb1 for its 
                           second stage. SYSLINUX is installed in the  directory. 
                           The integrity check of the ADV area failed. No errors 
                           found in the Boot Parameter Block.
        Operating System:  
        Boot files:        /boot/grub/grub.cfg /syslinux/syslinux.cfg 
                           /efi/boot/bootx64.efi /ldlinux.sys
    
    ============================ Drive/Partition Info: =============================
    
    Drive: sda _____________________________________________________________________
    
    Disk /dev/sda: 640.1 GB, 640135028736 bytes
    255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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    *          2,048       409,599       407,552   7 NTFS / exFAT / HPFS
    /dev/sda2             409,600   830,619,647   830,210,048   7 NTFS / exFAT / HPFS
    /dev/sda3         830,619,648 1,250,050,047   419,430,400  83 Linux
    /dev/sda4       1,250,050,048 1,250,261,679       211,632   c W95 FAT32 (LBA)
    
    
    Drive: sdb _____________________________________________________________________
    
    Disk /dev/sdb: 4018 MB, 4018143232 bytes
    84 heads, 20 sectors/track, 4671 cylinders, total 7847936 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/sdb1    *          1,112     7,847,935     7,846,824   c W95 FAT32 (LBA)
    
    
    "blkid" output: ________________________________________________________________
    
    Device           UUID                                   TYPE       LABEL
    
    /dev/loop0                                              squashfs   
    /dev/sda1        1686025D86023DAD                       ntfs       SYSTEM
    /dev/sda2        D0DC4AE4DC4AC506                       ntfs       
    /dev/sda3        06064391-c4c4-44c9-a738-5f8925497cff   ext4       
    /dev/sda4        2802-C848                              vfat       HP_TOOLS
    /dev/sdb1        1AE1-1862                              vfat       PENDRIVE
    
    ================================ Mount points: =================================
    
    Device           Mount_Point              Type       Options
    
    /dev/loop0       /rofs                    squashfs   (ro,noatime)
    /dev             /mnt/temp/dev            none       (rw,bind)
    /dev/pts         /mnt/temp/dev/pts        none       (rw,bind)
    /dev/sda3        /mnt/temp                ext4       (rw)
    /dev/sdb1        /cdrom                   vfat       (rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
    
    
    =============================== sda3/etc/fstab: ================================
    
    --------------------------------------------------------------------------------
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' 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
    # / was on /dev/sda3 during installation
    UUID=06064391-c4c4-44c9-a738-5f8925497cff /               ext4    errors=remount-ro 0       1
    --------------------------------------------------------------------------------
    
    =================== sda3: Location of files loaded by Grub: ====================
    
               GiB - GB             File                                 Fragment(s)
    
                   =                boot/grub/core.img                             1
                   =                boot/grub/stage2                               1
    
    =========================== sdb1/boot/grub/grub.cfg: ===========================
    
    --------------------------------------------------------------------------------
    
    if loadfont /boot/grub/font.pf2 ; then
        set gfxmode=auto
        insmod efi_gop
        insmod efi_uga
        insmod gfxterm
        terminal_output gfxterm
    fi
    
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    
    menuentry "Try Ubuntu without installing" {
        set gfxpayload=keep
        linux    /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
        initrd    /casper/initrd.lz
    }
    menuentry "Install Ubuntu" {
        set gfxpayload=keep
        linux    /casper/vmlinuz  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --
        initrd    /casper/initrd.lz
    }
    menuentry "Check disc for defects" {
        set gfxpayload=keep
        linux    /casper/vmlinuz  boot=casper integrity-check quiet splash --
        initrd    /casper/initrd.lz
    }
    --------------------------------------------------------------------------------
    
    ========================= sdb1/syslinux/syslinux.cfg: ==========================
    
    --------------------------------------------------------------------------------
    # D-I config version 2.0
    include menu.cfg
    default vesamenu.c32
    prompt 0
    timeout 50
    
    # If you would like to use the new menu and be presented with the option to install or run from USB at startup, remove # from the following line. This line was commented out (by request of many) to allow the old menu to be presented and to enable booting straight into the Live Environment! 
    # ui gfxboot bootlogo
    --------------------------------------------------------------------------------
    
    =================== sdb1: Location of files loaded by Grub: ====================
    
               GiB - GB             File                                 Fragment(s)
    
                ?? = ??             boot/grub/grub.cfg                             1
    
    ================= sdb1: Location of files loaded by Syslinux: ==================
    
               GiB - GB             File                                 Fragment(s)
    
                ?? = ??             ldlinux.sys                                    1
                ?? = ??             syslinux/chain.c32                             1
                ?? = ??             syslinux/gfxboot.c32                           1
                ?? = ??             syslinux/syslinux.cfg                          1
                ?? = ??             syslinux/vesamenu.c32                          1
    
    ============== sdb1: Version of COM32(R) files used by Syslinux: ===============
    
     syslinux/chain.c32                 :  COM32R module (v4.xx)
     syslinux/gfxboot.c32               :  COM32R module (v4.xx)
     syslinux/vesamenu.c32              :  COM32R module (v4.xx)
    
    =============================== StdErr Messages: ===============================
    
    xz: (stdin): Compressed data is corrupt
    awk: cmd. line:36: Math support is not compiled in
    awk: cmd. line:36: Math support is not compiled in
    bootinfoscript: line 1656: [: 2.73495e+09: integer expression expected

  2. #202
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    yelojakit,

    Are you using the same version/architecture CD as your installation (i.e. 11.10/32 or 64 bit) to chroot?

    Are you sure when you boot the LiveCD the drive is 'sda' and not something else. After mounting sda3, run "ls /mnt/temp/boot" to make sure it sees Ubuntu files.

    Did you ever have the installed Ubuntu working? If not, it may be best just to retrieve any data you have on the partition and just reisntall the OS.

    Your setup seems very simple (no separate /boot, /home, etc) so other than not following the commands those are the things that come readily to mind.

    Code:
    sudo mkdir /mnt/temp 
    sudo mount /dev/sda3 /mnt/temp
    for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/temp$i;  done
    sudo cp /etc/resolv.conf /mnt/temp/etc/resolv.conf
    sudo chroot /mnt/temp
    
    apt-get update
    apt-get purge grub grub-pc grub-common
    apt-get install grub-common grub-pc
    update-grub 
    exit
    
    for i in /dev/pts /dev /proc /sys; do sudo umount /mnt/temp$i ; done
    Back to Xorg...

    Retired.

  3. #203
    Join Date
    Jan 2011
    Beans
    22

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Sorry for the late response drs305. I forgot to subscribe to this thread after replying.

    Quote Originally Posted by drs305 View Post
    Are you using the same version/architecture CD as your installation (i.e. 11.10/32 or 64 bit) to chroot?
    Yes, I just checked the disc image I downloaded on my wife's computer. 11.10 64 bit, which is the one I have on my comp as well.

    Quote Originally Posted by drs305 View Post
    Are you sure when you boot the LiveCD the drive is 'sda' and not something else. After mounting sda3, run "ls /mnt/temp/boot" to make sure it sees Ubuntu files.
    Yes, I'm sure. Yeah I've tried "ls /mnt/temp/boot." I did this to see if my data was intact and that I didn't just accidentally copy the boot folders or whatnot from other procedures in. I did "ls /mnt/temp/home/" which lists my folder. But I can't get any further for backing up the files or configuration files.

    Quote Originally Posted by drs305 View Post
    Did you ever have the installed Ubuntu working? If not, it may be best just to retrieve any data you have on the partition and just reisntall the OS.
    I had it working fine but then I re-sized because I originally had the partition too small. Partway through the re-sizing process, it went to panic mode (where it just showed lines of code and in the bottom it mentioned it's going into panic mode or something similar). You can refer to my thread if you need more context/information: http://ubuntuforums.org/showthread.php?t=1928297

    Quote Originally Posted by drs305 View Post
    Your setup seems very simple (no separate /boot, /home, etc) so other than not following the commands those are the things that come readily to mind.
    I followed your lines exactly (using both copy and paste and typing myself) and since there's only a few simple lines, most of which can be tested to see if it's done correctly, I don't know where it went wrong.

    Thanks again.

    Here is another run at it:
    Code:
    ubuntu@ubuntu:~$ sudo mkdir /mnt/temp
    ubuntu@ubuntu:~$ sudo mount /dev/sda3 /mnt/temp
    ubuntu@ubuntu:~$ ls /mnt/temp/home/
    jack
    ubuntu@ubuntu:~$ for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt/temp$i;  done
    ubuntu@ubuntu:~$ sudo cp /etc/resolv.conf /mnt/temp/etc/resolv.conf
    ubuntu@ubuntu:~$ sudo chroot /mnt/temp
    chroot: failed to run command `/bin/bash': No such file or directory
    Last edited by yelojakit; February 23rd, 2012 at 06:38 PM. Reason: Added actual code ran

  4. #204
    Join Date
    Jun 2012
    Beans
    2

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Hello my dear Sir Drs305,

    Sorry to bring up an old thread. I'll be bold: I didn't read all 21 pages of the thread. But I do like to share some of my findings while trying to upgrade my Natty Narwhal (Ubuntu 11.04) server to the lateste Precise Pangolin LTS (Ubuntu 12.04) server. Maybe, by doing so, I could clarify some things to people who had a similar problem. Even bolder: you maybe able to update your HOWTO to help out pick the different a,b,c of the "chroot" -> "Mounting Instructions" step.

    First of all let me thank you very very much dear Sir Drs305! For you have saved my precious home server from being re-installed. I would also like to thank every one related to the threads and posts I'll be referencing to.

    In short:
    When you have a boot device that has GPT or LVM you can not use GRUB.
    You need (or have) a different boot partition which has an MBR. Therefor you need to take step A in the guide.
    Please refer to the bottom of the long version for details *

    The long version
    My story started off in summer 2008 when I bought a cheap but nice and energy efficient PC configuration for a home server. Back then I used FreeNAS v6, later v7 and I tried v8 for 3 days. This was fine for a while but at a cerntain point I found FreeNAS somewhat to limited for what I wanted. I had modified and played with it a lot. I was very happy about FreeNAS for what it had to offer as a NAS OS. But I needed more than just a NAS system.

    Soo I switched over to Ubuntu server edition. It had everything I needed, and a lot more. In 2008 I was very new to *nix-based systems, but that had changed. I installed Ubuntu Server 11.04 (Natty Narwhal). From what I had learned, and under 'influence' of my best friend, a true SysAdmin, I used different partitions and even used LVM2. It was a whole new world opening to me. I really love Ubuntu by now. I could play to my full and complete hearts content.

    That was over a year ago. A few weeks ago, and again under 'influence' of that true SysAdmin, I started upgrading my Natty Narwhal Server to Precise Pangolin Server. That, and again more experience, had made me realize I had made a "beauty mistake" with the naming of my LVM2 volumes. The system LVM2 volume group was named "Narwhal", after the OS name. I wanted to change that LVM2 volume group name and I did. But there I was ignorant about booting and more precise (no pun intended) about GRUB.

    The boot device, which had LVM2 on it, had its LVM2 volume group name changed. That was something GRUB could not handle by just a configuration change. I had it working, before on Natty Nawhal with LVM2. I changed the volume groupname and every reference to it including for boot but it didn't work... why?

    It took just under 6 days to get to the bottom of this, of course with a lot of trying and trail and error. I learned about the diffence between GRUB and GRUB2. I found out about GRUB loading stage 1.5 error 15. I had a struggle because of the LVM2 and because I didn't knew about chroot I messed up live USB's.

    But yesterday just before dinner I got my Precise Pangolin LTS (Ubuntu 12.04) booting again. It was back better than ever before. I had, again, learned very much because of the forums here and Google'n.

    • GRUB (still?) can not handle booting from big volumes (LVM2) and GPT. You need a separate boot partition with MBR.
    • You can not combine two different versions of GRUB!
    • When using a LiveUSB of other Live system to recover your booting you realy need to chroot
    • Because I have the server version it is normaly headless and I do every thing in commandline. therefor I didn't realy look into Boot-repair, sorry.
    • I did however tried Rescatux but I am sorry to tell you, from my experince, it didn't help one bit. Probaly because of the GPT and LVM2.


    The last two list items are self explanatory. But for the others I would like to add some extra information.

    Thank you drs305 for pointing out the chroot. This was a command I didn't use before and I learned a very valuable lesson by screwing up my liveUSB a few times because of not using chroot. I may sound dumb, and I sure did dumb things this past few days, but because of you my euro (penny) dropped and I could fix GRUB(2) from liveUSB.

    I am a big fan of trail and error. Because of that I ended up installing the older version of GRUB together with GRUB2. That doesn't work! It will give you:
    Code:
    GRUB loading stage 1.5
    
    GRUB loading, please wait...
    Error 15
    Read more about this in the following thread: GRUB loading stage 1.5 error 15

    Quote Originally Posted by oldfred View Post
    Error 15 is often a conflict between old grub & grub2. Although grub legacy was supposed to let you boot and then boot into grub2. (As your menu.lst shows)

    You also have wubi in your windows partiiton. Were/are you using wubi?
    Thank you very much missfroguk and oldfred for helping me with this!

    * For the very first item on the list I would like to refer to a blog post from Shuvo. He pointed out that you need a MBR partition to boot up with GRUB. Thank you very much Shuvo!

    GRUB Installation Issue with 2 TB HDD – GPT Requires BIOS Boot Partition

    Because I had GRUB2 already working on the Natty Narwhal Server that install made my separate boot partition with MBR.
    It was only after I realized I needed a different boot partition that I could solve my boot problem for my Precise Pangolin Server.

    The point:
    When you work with GPT, LVM2 or big disks you must have a separate boot partition that has an MBR.
    This makes a difference when you are following the great guide at the start of this post. Because you have a different boot partition you need to take step A when mounting for chroot.


    I hope my post can help others who face problems with there GRUB together with GPT or LVM.

    Kindest regards
    Vertoke
    Last edited by Vertoke; June 3rd, 2012 at 12:17 PM.

  5. #205
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Vertoke,

    Thank you for posting your experiences with Grub.

    Grub 2 with GPT/LVM certainly has it's own requirements. These weren't often used when I wrote the guide but are becoming increasinly more common.

    I will consult with oldfred and update the first post to include more information or at least include a note for those using GPT/LVM.
    Back to Xorg...

    Retired.

  6. #206
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Partitioning with gpt or MBR both have a MBR, which is the first sector of the hard drive. With gpt it is a protective MBR so older partitioning tools like fdisk do not damage the partitioning.

    With Ubuntu you can use gpt and boot with BIOS but the sectors just after the MBR that grub2 uses to embed the core.img is not there. So with gpt you have to have a 1MB partition, unformated with bios_grub flag. Windows will only boot from gpt partitioned drives if UEFI booting not BIOS.

    Do not know much about LVM but grub2 has lvm.mod and works directly to boot from LVM, grub legacy did not. But separate /boot partition may still make sense. With Ubuntu liveCD you also have to download lvm2 driver to get it to work with lvm partitioning. Normally alternative installer or server installing include the LVM drivers.

    Most desktops do not have LVM as it is more advanced.
    Advantages/Disadvantages Post #9
    http://ubuntuforums.org/showthread.php?t=1586328

    I just used the purge & reinstall on my gpt drive without any issue, but I boot with BIOS. And I have a bios_grub partition.
    Ubuntu used to install to gpt drives but use blocklists like an install to a partition, but I guess now it wants the bios_grub partition so it can install correctly.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #207
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Thanks oldfred.
    Back to Xorg...

    Retired.

  8. #208
    Join Date
    Jan 2008
    Location
    France
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Arrow Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    @Vertoke: if you don't use a separate /usr (not supported yet, i'm working on it), you can use Boot-Repair even if you want to repair the GRUB of a Ubuntu server. It handles LVM, GPT and separate /boot.
    In case the "Recommended repair" doesn't fix GRUB correctly, please indicate the URL that will appear.

  9. #209
    Join Date
    Jun 2012
    Beans
    2

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    Thanks for the positive feedback guys! I am happy that I can help out and give something back after so many years of just reading through the forum.

  10. #210
    Join Date
    Dec 2012
    Beans
    1

    Re: HOWTO: Purge and Reinstall Grub 2 from the Live CD

    http://paste.ubuntu.com/1459879/

    Please help me I'm at a grub rescue prompt

    I'm pulling my hair out I just want to boot into Ubuntu

Page 21 of 22 FirstFirst ... 1119202122 LastLast

Tags for this Thread

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
  •