Page 19 of 22 FirstFirst ... 91718192021 ... LastLast
Results 181 to 190 of 211

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

  1. #181
    Join Date
    Aug 2006
    Beans
    10

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

    Well, I ran the boot repair CD linked in the first post of this thread and this was the result: http://paste.debian.net/130061

    Now when I boot I get:

    Code:
    error: the symbol 'grub_xputs' not found.
    grub rescue>

  2. #182
    Join Date
    Aug 2006
    Beans
    10

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

    Code:
    ubuntu@ubuntu:~$ sudo mount /dev/hd0 /mnt
    mount: special device /dev/hd0 does not exist
    
    ubuntu@ubuntu:~$ sudo mount /dev/sda5 /mnt
    mount: unknown filesystem type 'LVM2_member'
    
    ubuntu@ubuntu:~$ sudo lvmdiskscan 
      /dev/ram0  [      64.00 MiB] 
      /dev/loop0 [     657.82 MiB] 
      /dev/ram1  [      64.00 MiB] 
      /dev/sda1  [     243.00 MiB] 
      /dev/ram2  [      64.00 MiB] 
      /dev/ram3  [      64.00 MiB] 
      /dev/ram4  [      64.00 MiB] 
      /dev/ram5  [      64.00 MiB] 
      /dev/sda5  [      24.76 GiB] LVM physical volume
      /dev/ram6  [      64.00 MiB] 
      /dev/ram7  [      64.00 MiB] 
      /dev/ram8  [      64.00 MiB] 
      /dev/ram9  [      64.00 MiB] 
      /dev/ram10 [      64.00 MiB] 
      /dev/ram11 [      64.00 MiB] 
      /dev/ram12 [      64.00 MiB] 
      /dev/ram13 [      64.00 MiB] 
      /dev/ram14 [      64.00 MiB] 
      /dev/ram15 [      64.00 MiB] 
      0 disks
      18 partitions
      0 LVM physical volume whole disks
      1 LVM physical volume
    
      
    ubuntu@ubuntu:~$ sudo lvdisplay
      --- Logical volume ---
      LV Name                /dev/webhost/root
      VG Name                webhost
      LV UUID                3Frc3n-CXqT-n0ZL-Q2vJ-63H6-uGiT-F0FfQf
      LV Write Access        read/write
      LV Status              NOT available
      LV Size                23.69 GiB
      Current LE             6064
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
       
      --- Logical volume ---
      LV Name                /dev/webhost/swap_1
      VG Name                webhost
      LV UUID                ybfHcl-sow9-bG5R-Zoo0-yFkT-pQD6-NOqYb2
      LV Write Access        read/write
      LV Status              NOT available
      LV Size                1.07 GiB
      Current LE             274
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
       
    ubuntu@ubuntu:~$ sudo vgdisplay 
      --- Volume group ---
      VG Name               webhost
      System ID             
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               0
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               24.76 GiB
      PE Size               4.00 MiB
      Total PE              6338
      Alloc PE / Size       6338 / 24.76 GiB
      Free  PE / Size       0 / 0   
      VG UUID               XQ0KH6-FFLd-9Ntd-v1xg-reYo-EAQF-DyIlqQ
       
    ubuntu@ubuntu:~$ sudo lvscan
      inactive          '/dev/webhost/root' [23.69 GiB] inherit
      inactive          '/dev/webhost/swap_1' [1.07 GiB] inherit
      
    ubuntu@ubuntu:~$ sudo modprobe dm-mod
    
    ubuntu@ubuntu:~$ sudo vgchange -ay
      2 logical volume(s) in volume group "webhost" now active
    
    ubuntu@ubuntu:~$ sudo lvscan
      ACTIVE            '/dev/webhost/root' [23.69 GiB] inherit
      ACTIVE            '/dev/webhost/swap_1' [1.07 GiB] inherit
    ubuntu@ubuntu:~$ sudo mount /dev/webhost/root /mnt
    ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt /dev/mapper/webhost-root
    
    /usr/bin/grub-setup: warn: Attempting to install GRUB to a partitionless disk or to a partition.  This is a BAD idea..
    /usr/bin/grub-setup: error: embedding is not possible, but this is required when the root device is on a RAID array or LVM volume.
    So now I'm actually at a grub command line when I boot:
    Code:
    GNU GRUB version 1.99~rc1-13ubuntu3
    
    grub>
    Tried the purge and repair grub onto /mapping/webhost from the advanced options of the boot cd and elected to install it onto every disk it found (as suggested by the docs).

    http://paste.debian.net/130246

    Rebooted aaaaaaand..... grub command prompt.

  3. #183
    Join Date
    Aug 2006
    Beans
    10

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

    ubuntu@ubuntu:~$ sudo apt-get install lvm2
    ubuntu@ubuntu:~$ sudo modprobe dm-mod
    ubuntu@ubuntu:~$ sudo vgchange -ay
    ubuntu@ubuntu:~$ sudo mkdir /mnt/temp
    ubuntu@ubuntu:~$ sudo mount /dev/webhost/root /mnt/temp
    ubuntu@ubuntu:~$ sudo chroot /mnt/temp
    root@ubuntu:/# apt-get update
    ...
    Reading package lists... Done
    root@ubuntu:/# apt-get purge grub grub-pc grub-common
    .. no errors ..
    root@ubuntu:/# apt-get install grub-common grub-pc
    .. at this point I am asked whether to install to one of the following:
    /dev/sda (26843 MB; Virtual_disk)
    /dev/dm-0 (25434 MB; webhost-root)
    ...

    If I choose /dev/dm-0 it says "grub failed to install to /dev/dm-0. If I choose /dev/sda It installed without errors and when I finally reboot I'm exactly where I started from: a grub prompt.

    At least I can boot to the live CD, mount my drive and copy off the files I need before wiping the whole thing and re-installing from scratch.

    What a piece of crap.

  4. #184
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    paulgami,

    I'd like to help but I'm woefully uninformed about LVM, RAID, etc. This thread probably doesn't get read too often except by those needing help, so if you don't get a positive response you might want to start a new thread and include the partitioning scheme you are using in the title.

    If you can identify the partition from the grub prompt, I'll give some general advice:

    Since you now get the 'grub' prompt, it means that Grub 2 has probably found the grub boot files but for some reason can't use or find the grub.cfg file.

    From the grub prompt, if you use the "ls" command perhaps it will now identify your OS partition. If it does, try the following commands to boot. I'm going to use "hd0,1" in the example, but if found yours may be more exotic and certainly different. Substitute the correct value:

    Code:
    insmod (hd0,1)/boot/grug/normal.mod  # This may display the menu.
    configfile (hd0,1)/boot/grub/grub.cfg  # This may also display the menu
    If it does, you may need to press 'e' to edit the menuentry and check the lines for the proper addresses/format.

    If you can find the correct partition with the "ls" command the above doesn't work, you can try (with substitutions):
    Code:
    set root=(hd0,1)
    linux (hd0,1)/vmlinuz root=/dev/sda1 ro
    initrd (hd0,1)/initrd.img
    boot # or CTRL-x to boot.
    GRUB2

    Retired.

  5. #185
    Join Date
    Aug 2006
    Beans
    10

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

    grub> ls
    (webhost-swap_1) (webhost-root) (hd0) (hd0,msdos5) (hd0,msdos1) (fd0)
    grub> insmod (hd0,msdos1)/boot/grub/normal.mod
    error: file not found
    grub> insmod (hd0,msdos5)/boot/grub/normal.mod
    error: unknown filesystem
    grub> insmod (webhost-root)/boot/grub/normal.mod
    error: 'normal' is already loaded.
    grub> ls (hd0,msdos1)/
    lost+found/ vmcoreinfo-2.6.38-11-server config-2.6.38-11-server vmlinuz-2.6.38-11-server abi-2.6.38-11-server initrd.img-2.6.38-11-server........
    grub> ls (webhost-root)/
    lost+found/ var/ boot/ etc/ media/ cdrom/ lib/ usr/ bin/........
    grub> ls (webhost-root)/boot/grub
    ... all the grub files...
    grub> configfile (hd0,msdos1)/boot/grub/grub.cfg
    brings me to grub> prompt
    grub> configfile (webhost-root)/boot/grub/grub.cfg
    brings me to grub> prompt

    I've tried booting manually from grub with all manner of different combinations of partitions and formats but it either drops me off at an initramfs prompt after various mount failures or completely hangs grub when I issue the "linux ..." command.

    This isn't the first time Ubuntu has **** the bed on an update, so from here on out, no dist-upgrades for me. It's fresh install and restore data from backup every time! I do thank you for your help, and your well-written How-to. Shame it just wasn't to be

  6. #186
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    My only guess would be to try these commands
    set root=(webhost-root)
    linux (webhost-root)/vmlinuz then tab to complete the applicable kernel
    initrd (webhost-root)/initrd then tab to complete the applicable initrd image
    CTRL-x to boot.

    If you don't understand what I'm suggesting I can elaborate but I'm on a horrible Internet connection at the moment.
    Last edited by drs305; September 16th, 2011 at 04:52 PM. Reason: typo
    GRUB2

    Retired.

  7. #187
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

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

    I also do not use LVM, but just like you installed the lvm2 package when you chrooted you need grub needs lvm.mod to see the lvm when booting?

    From your grub.cfg file you posted. I would think you need these as part of a manual boot.

    insmod lvm
    insmod part_msdos
    insmod ext2

    I think grub automatically includes the second two but does not include lvm as standard.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  8. #188
    Join Date
    Aug 2006
    Beans
    10

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

    Yup, already tried insmod lvm and also tab-completion (the kernel/initrd files are found just fine).

    I'm almost done installing fresh and it won't take me long to restore the databases. It's a pain in the *** but this is only a dev server and at least I have daily backups.

  9. #189
    Join Date
    Oct 2010
    Beans
    6

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

    Hi All,

    I tried this instruction guide as my grub2 is problematic. However, while trying the chroot step, I get an error saying Bus Error (core dumped) and my user prompt does not change to *root*. Please help me with this.

  10. #190
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

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

    Quote Originally Posted by pranaykotasthane View Post
    Hi All,

    I tried this instruction guide as my grub2 is problematic. However, while trying the chroot step, I get an error saying Bus Error (core dumped) and my user prompt does not change to *root*. Please help me with this.
    I am not familiar with this error. Is the LiveCD you are using the same as the version of Ubuntu you are trying to chroot into? For example, you probably can't use a 9.10 CD to chroot into a 11.10 installation, or vice versa.
    GRUB2

    Retired.

Page 19 of 22 FirstFirst ... 91718192021 ... 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
  •