Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: lost grub, how to reinstall it to the drive?

  1. #11
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: lost grub, how to reinstall it to the drive?

    Hi old fred,

    I have an ide hard drive.
    It will be the only drive in a PC
    I bring the drive home
    I put the drive in a USB enclosure.
    The computer at home has an internal drive.
    I boot from the drive F8 select usb wdc 200 gb drive
    It boots.

    I am sitting here right now running on the usb drive.
    sdc is what I want grub on, currently the usb enclosure drive, I want sdb to be ignored, like it does not exist, like unplugged.

    sdb is my internal drive. that will have to be fixed after I unplug sdc, i suppose?

    Can you give me custom commands to run ?

    Thanks.

    If you cant help me, then I will have to unplug sdb and run the boot repair, I think that will work.
    But I would like to do it your way, if possible.
    Attached Images Attached Images

  2. #12
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: lost grub, how to reinstall it to the drive?

    If you have booted into the install in sdc:
    Just to confirm it is sdc:
    sudo fdisk -l
    Then:
    sudo grub-install /dev/sdc
    sudo update-grub
    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.

  3. #13
    Join Date
    Dec 2006
    Beans
    Hidden!

    Re: lost grub, how to reinstall it to the drive?

    Ok, I ran it with no errors.

    It has however not ignored sdb with the windows partition and Trusty.

    Do you think it will still boot at the boat?
    And maybe then run
    sudo update-grub out there???

    Code:
    boat@boat-MS-7529:~$ sudo fdisk -l
    [sudo] password for boat: 
    
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00042686
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *          63   976768064   488384001    7  HPFS/NTFS/exFAT
    Partition 1 does not start on physical sector boundary.
    /dev/sda2       976768065  1953520064   488376000   83  Linux
    Partition 2 does not start on physical sector boundary.
    
    Disk /dev/sdb: 750.2 GB, 750156374016 bytes
    255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 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
    Disk identifier: 0xb822ff08
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          63   245151899   122575918+   7  HPFS/NTFS/exFAT
    /dev/sdb2       245153790  1465147391   609996801    5  Extended
    /dev/sdb5       842551296  1465147391   311298048   83  Linux
    /dev/sdb6       245153792   284214338    19530273+  83  Linux
    /dev/sdb7       284217344   292028415     3905536   82  Linux swap / Solaris
    /dev/sdb8       292030464   842549247   275259392   83  Linux
    
    Partition table entries are not in disk order
    
    Disk /dev/sdc: 200.0 GB, 200049647616 bytes
    255 heads, 63 sectors/track, 24321 cylinders, total 390721968 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
    Disk identifier: 0x00007d34
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *        2048    19531775     9764864   83  Linux
    /dev/sdc2        19533822   390721535   185593857    5  Extended
    /dev/sdc5       382337024   390721535     4192256   82  Linux swap / Solaris
    /dev/sdc6        19533824   382337023   181401600   83  Linux
    
    Partition table entries are not in disk order
    boat@boat-MS-7529:~$ sudo grub-install /dev/sdc
    Installing for i386-pc platform.
    Installation finished. No error reported.
    boat@boat-MS-7529:~$ sudo update-grub
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-3.13.0-24-generic
    Found initrd image: /boot/initrd.img-3.13.0-24-generic
    Found linux image: /boot/vmlinuz-3.13.0-23-generic
    Found initrd image: /boot/initrd.img-3.13.0-23-generic
    Found linux image: /boot/vmlinuz-3.13.0-21-generic
    Found initrd image: /boot/initrd.img-3.13.0-21-generic
    Found linux image: /boot/vmlinuz-3.11.0-18-generic
    Found initrd image: /boot/initrd.img-3.11.0-18-generic
    Found memtest86+ image: /boot/memtest86+.elf
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows 7 (loader) on /dev/sdb1
    Found Ubuntu 14.04 LTS (14.04) on /dev/sdb6
    done
    boat@boat-MS-7529:~$

  4. #14
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    14,189
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: lost grub, how to reinstall it to the drive?

    sdowney717; & oldfred ; Hey.

    I am back and looking too at this situation.
    If it does not boot now, recon we ought to look at '/boot/grub/grub.cfg' and make sure that all the device id's match the UUIDs ?

    Now a thought, when the drive is reinstalled to the box it is to operate in, will not the device-ID/UUIDs have to re-confirmed ?
    hd0 = 1st hard drive and msdos1 is that 1st partition
    hd3 = 3rd hard drive msdos7 is the 7th partition
    In accord with what 'sudo blkid' relates.

    so
    (hd0,msdos1) = sda1
    (hd3,msdos8) = sdd8

    Mind yall, I am still very much in a learning mode in respect to booting and grub and how grub relates to 'init'.

    So everyone is on the same page
    booting wisely
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  5. #15
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: lost grub, how to reinstall it to the drive?

    I find my devices change.
    I managed to skip a SATA port when I installed drives. So if I plug in my flash drive it is sde, but if I reboot then that flash drive is sdb and all others are one letter more. Or I have to pay attention to which drive if not using UUIDs.

    Grub works from hd0 which is always the boot drive as defined by BIOS. With my system then every other drive is hd1, hd2 etc. But there is no match between grub's hd0 and sdd or sda as it depends on which drive I boot from. I usually boot sdd which is my SSD. But they always seem to be in the same order after hd0 is used.

    Or when I boot sdd as hd0 then sda is hd1. And depending on whether flash drive was plugged in or not it change also change order.
    But if I boot sda as hd0, then sdb is hd1.
    Confused yet?
    I often have to use e on my grub menu and just try hd1, hd2 etc on some of my boot stanza's where I do not use UUIDs. As I cannot keep track either.
    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.

  6. #16
    Join Date
    Aug 2013
    Location
    Thailand
    Beans
    101
    Distro
    Ubuntu

    Re: lost grub, how to reinstall it to the drive?

    from my experience running grub on usb drives or usb flash sticks if you dont unhook your internal drives it will wipe the boot loaders on internal drives

Page 2 of 2 FirstFirst 12

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
  •