Grub Rescue - Complete Re-install of GRUB 2 from Live USB


Author: Nixie Pixel
185662 View
3m 49s Lenght
1059 Rating


Seeing nothing but the grub rescue prompt? Did Windows mess up your Master Boot Record? Using Ubuntu, GRUB 2 got you down? Who needs Live CDs? This video tutorial will show you how you can use an Ubuntu Live USB drive to reinstall GRUB, even when your boot device is inaccessible. Commands used in this video: sudo mount /dev/sda5 /mnt *****Using the linux installation on your hard drive instead of /dev/sda5 sudo mount --bind /dev /mnt/dev sudo mount --bind /proc /mnt/proc sudo mount --bind /sys /mnt/sys sudo chroot /mnt grub-install /dev/sda *****Using your boot device instead of /dev/sda CTRL-D sudo umount /mnt/dev sudo umount /mnt/proc sudo umount /mnt/sys sudo umount /mnt This video was produced on Linux and edited entirely using open source programs! My USB is a Mimobot, found here http://bit.ly/pSU2Wt Intro made in Linux by Yazlanka: http://twitter.com/#!/yazlanka Outtro thanks to Wayne Tedder :http://www.youtube.com/user/deathguppie


Comments

  1. after mount command other command not working with kali Linux 2016.2 64
  2. YOU ARE THE BEST! Thank you for this
  3. sudo fdisk -l
    Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x0414eef2

    Device Boot Start End Sectors Size Id Type
    /dev/sda1 * 2048 970481663 970479616 462.8G 83 Linux
    /dev/sda2 970483710 976771071 6287362 3G 5 Extended
    /dev/sda5 970483712 976771071 6287360 3G 82 Linux swap / Solaris









    root@parrot:~# sudo blkid
    /dev/sda1: UUID="8b852ae8-5096-4101-a746-0e012d32a8f7" TYPE="ext4" PARTUUID="0414eef2-01"
    /dev/sda5: UUID="153b93aa-fb50-45e7-8ed7-f6a804d51097" TYPE="swap" PARTUUID="0414eef2-05"
    root@parrot:~#










    root@parrot:~# cat /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
    if [ "${next_entry}" ] ; then
    set default="${next_entry}"
    set next_entry=
    save_env next_entry
    set boot_once=true
    else
    set default="0"
    fi

    if [ x"${feature_menuentry_id}" = xy ]; then
    menuentry_id_option="--id"
    else
    menuentry_id_option=""
    fi

    export menuentry_id_option

    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 load_video {
    if [ x$feature_all_video_module = xy ]; then
    insmod all_video
    else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
    fi
    }

    if [ x$feature_default_font_path = xy ] ; then
    font=unicode
    else
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 8b852ae8-5096-4101-a746-0e012d32a8f7
    else
    search --no-floppy --fs-uuid --set=root 8b852ae8-5096-4101-a746-0e012d32a8f7
    fi
    font="/usr/share/grub/unicode.pf2"
    fi

    if loadfont $font ; then
    set gfxmode=auto
    load_video
    insmod gfxterm
    set locale_dir=$prefix/locale
    set lang=tr_TR
    insmod gettext
    fi
    terminal_output gfxterm
    if [ "${recordfail}" = 1 ] ; then
    set timeout=30
    else
    if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
    # Fallback normal timeout code in case the timeout_style feature is
    # unavailable.
    else
    set timeout=5
    fi
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 8b852ae8-5096-4101-a746-0e012d32a8f7
    else
    search --no-floppy --fs-uuid --set=root 8b852ae8-5096-4101-a746-0e012d32a8f7
    fi
    insmod png
    if background_image /usr/share/images/desktop-base/parrot-grub.png; then
    set color_normal=green/black
    set color_highlight=black/white
    else
    set menu_color_normal=cyan/blue
    set menu_color_highlight=white/blue
    fi
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    function gfxmode {
    set gfxpayload="${1}"
    }
    set linux_gfx_mode=
    export linux_gfx_mode
    menuentry 'Parrot GNU/Linux' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-8b852ae8-5096-4101-a746-0e012d32a8f7' {
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 8b852ae8-5096-4101-a746-0e012d32a8f7
    else
    search --no-floppy --fs-uuid --set=root 8b852ae8-5096-4101-a746-0e012d32a8f7
    fi
    echo 'Linux 4.8.0-parrot-amd64 yükleniyor ...'
    linux /boot/vmlinuz-4.8.0-parrot-amd64 root=UUID=8b852ae8-5096-4101-a746-0e012d32a8f7 ro initrd=/install/initrd.gz noautomount quiet
    echo 'Başlangıç ramdiski yükleniyor ...'
    initrd /boot/initrd.img-4.8.0-parrot-amd64
    }
    submenu 'Parrot GNU/Linux için gelişmiş seçenekler' $menuentry_id_option 'gnulinux-advanced-8b852ae8-5096-4101-a746-0e012d32a8f7' {
    menuentry 'Parrot GNU/Linux, Linux 4.8.0-parrot-amd64 ile' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.8.0-parrot-amd64-advanced-8b852ae8-5096-4101-a746-0e012d32a8f7' {
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 8b852ae8-5096-4101-a746-0e012d32a8f7
    else
    search --no-floppy --fs-uuid --set=root 8b852ae8-5096-4101-a746-0e012d32a8f7
    fi
    echo 'Linux 4.8.0-parrot-amd64 yükleniyor ...'
    linux /boot/vmlinuz-4.8.0-parrot-amd64 root=UUID=8b852ae8-5096-4101-a746-0e012d32a8f7 ro initrd=/install/initrd.gz noautomount quiet
    echo 'Başlangıç ramdiski yükleniyor ...'
    initrd /boot/initrd.img-4.8.0-parrot-amd64
    }
    menuentry 'Parrot GNU/Linux, with Linux 4.8.0-parrot-amd64 (recovery mode)' --class parrot --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.8.0-parrot-amd64-recovery-8b852ae8-5096-4101-a746-0e012d32a8f7' {
    load_video
    insmod gzio
    if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
    insmod part_msdos
    insmod ext2
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 8b852ae8-5096-4101-a746-0e012d32a8f7
    else
    search --no-floppy --fs-uuid --set=root 8b852ae8-5096-4101-a746-0e012d32a8f7
    fi
    echo 'Linux 4.8.0-parrot-amd64 yükleniyor ...'
    linux /boot/vmlinuz-4.8.0-parrot-amd64 root=UUID=8b852ae8-5096-4101-a746-0e012d32a8f7 ro single initrd=/install/initrd.gz noautomount
    echo 'Başlangıç ramdiski yükleniyor ...'
    initrd /boot/initrd.img-4.8.0-parrot-amd64
    }
    }

    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_linux_xen ###

    ### END /etc/grub.d/20_linux_xen ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/30_uefi-firmware ###
    ### END /etc/grub.d/30_uefi-firmware ###

    ### 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 ${config_directory}/custom.cfg ]; then
    source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
    source $prefix/custom.cfg;
    fi
    ### END /etc/grub.d/41_custom ###
    root@parrot:~#



    40/5000 Windows a night please help please
  4. i wanna put my usb drive in ...
    and doesn't matter what i said i love your voice and face ..
  5. too many command, I have fixed grub rescue too many time. Finally, I found effective solution at this web: http://askubuntu.com/questions/143667/boot-error-no-such-device-grub-rescue.
    sudo fdisk -l
    create folder in home: /home/ubuntu/temp
    sudo mount /dev/sda5 /home/ubuntu/temp
    sudo grub-install --root-directory=/home/ubuntu/temp /dev/sda (with /dev/sda is hard disk name)
  6. Is it work on efi system
  7. hey, I need to install trusted grub which would then help me to secure boot the encrypted disk partition. Do you have and tutorial on how to install trusted grub on ububtu
  8. This video has saved me twice.. :|
  9. Holey shit am I ever glad I tried to install Linux. I must have been sleep deprived when I believed some Linux asshole that his grandmother could use Linux. My mother would say that you must be on drugs
  10. hey , on my pc i removed windows and my HDD is empty so when i install ubantu it installing correctly but after rebooting msg when i reboot it nothing has open expect dell test.....
    how can i solve this ..............?
  11. thank it good work
  12. I love you <3 thanx a lot
  13. Ohh thanks a lot
    It worked.
    I tried several methods mentioned in forum and ended up getting errors.
    Your tutorial worked fine
    PS I have Linux mint and yes it works for Linux mint as well.
  14. simply -command not found grub install
  15. Does this work Kali as well? My issue is i can see the entire install, I have some mirror issues but i know why on that, least i hope lol! but after reboot my screen come on select kali the the screen get squiggly line as in the image get all cut up and squiggly lol then a blank dark screen (nothing to do w/power)!
  16. what if I have debian?
  17. On the last step something goes wrong, it displays this:

    grub-install: warning: File system 'ext2' doesn't support embedding.
    grub install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However blocklists are UNRELIABLE and their use is discouraged..
    grub-install: error: will not proceed with blocklists.

    What am I supposed to do?
    EDIT: looks like I was a moron and I made a mistake on the step "grub-install /dev/sda" , I accidentally wrote sda2 (my root partition). I hope I did't screw my system up with it. It installed properly now, but got a warning message:

    grub-install: warning: Sector 32 is already in use by the program 'FlexNet' ; avoiding it. This software may cause boot or other problems in future. Please ask it's authors not to store data in the boot track.
    Installation finished. No error reported

    So I guess it should be ok?
    EDIT2: Ok, I have managed to fuck it up somehow. My system boots into Ubuntu without offering that GRUB screen where I could choose for Windows. I think I will just format the whole fucking SSD and start all over again, installing windows first, then Ubuntu. Fuck, I thought they have figured out an easier way to do these things. Looks like if you install Ubuntu first, you are pretty much screwed.
  18. Is my SDA1 my regukar hard drive and SDA2 my external Maxtor hard drive? My guess is 1 is the primary inside the PC, 2 is the pne in the external dock. Right?
  19. i must kindly ask for assistance.

    I'm trying to install Lubuntu and it keeps coming up with "Bootloader install failed" and a grub error. It could possibly be something I'd doing wrong, how would I tell?
  20. .......and they opened thy Book of Linux and said,............though shalt not use thy archaic cd/dvd device no longer, nor shalt though use Windows, though shalt take part in the light and use yon mighty flash drives, SSD drives and throw thy cds/dvds to a wattery grave..............................Uhhhhhhmmmmmm Butu