Grub Reinstall Questions
I have a linux drive that won’t boot. I think grub is bad. I have it attached now via usb and have loaded from a live OS on a flashdrive and I can view the hard drive and view files, but it won’t boot.
I first tried to use Boot Repair while booted up in ubuntu and it did generate some reports. I have since made a bootable flash drive with mint 20. I thought maybe the repair tool on the installer might help, but it didn’t. So I have tried again with terminal commands. Here is what I get: To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details. mint@mint:~$ sudo fdisk -l Disk /dev/loop0: 1.83 GiB, 1939968000 bytes, 3789000 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 /dev/sda: 114.61 GiB, 123048296448 bytes, 240328704 sectors Disk model: Cruzer Glide 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: 0x6d94e5e7 Device Boot Start End Sectors Size Id Type /dev/sda1 * 0 4018655 4018656 1.9G 0 Empty /dev/sda2 624 8559 7936 3.9M ef EFI (FAT-12/16/32) /dev/sda3 4022272 240328703 236306432 112.7G 83 Linux mint@mint:~$ sudo blkid /dev/sda1: UUID="2020-06-24-20-35-19-00" LABEL="Linux Mint 20 MATE 64-bit" TYPE="iso9660" PTUUID="6d94e5e7" PTTYPE="dos" PARTUUID="6d94e5e7-01" /dev/loop0: TYPE="squashfs" /dev/sda2: SEC_TYPE="msdos" UUID="1AC3-20ED" TYPE="vfat" PARTUUID="6d94e5e7-02" /dev/sda3: LABEL="writable" UUID="cbe6e751-16d8-4196-a784-8b791bf2801e" TYPE="ext4" PARTUUID="6d94e5e7-03" mint@mint:~$ sudo mount /dev/sda3 /mnt mint@mint:~$ sudo grub-install --boot-directory=/mnt/boot /dev/sda Installing for i386-pc platform. grub-install: warning: Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet.. 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. I’d read some things about the way to proceed depended on whether you had the bios set for legacy or ueif. I saw that it was sat at use both. So I went back and changed it to legacy only for the latest try that you see above. For what it’s worth I was initially trying to fix a windows drive that would’t boot because it was likely corrupted by a windows installer. So I was sort of blindly running commands to repair that and I may have tried the use the windows chckdsk on a linux drive. It looks like the pastebin files it created aren’t kept for long. They were created yesterday and are gone now. When I tried boot repair today while booted in Mint 20 I tried a couple times and the message just said to go to pastebin, but there was no file number, just the base url. |
fdisk is only showing one drive, and it looks like the booted usb drive, if so, either your hard drive has failed or you made a change in the bios/firmware settings that has disabled the internal drive.
what is output of Code:
lsblk -f |
You could do it the easy way with https://sourceforge.net/p/boot-repair-cd/home/Home/
|
Quote:
Quote:
|
I had first downloaded a ubuntu is and and a version of etcher that runs on android and installed root repair on that and ran that. At that time I had to use a smartphone to get and install the isos, etc. It did generate links to the report that time but I didn't go look at them at the time. I did the next step which was have Boot Repair do the analysis and repair. It made an attempt but said it couldn't and didn't make any changes.
So I figured I might be better off using a live Mint 20 iso and start over with that and try using the analyze medium option in the Mint installer as well. So at one time I did have ubuntu on the bootable flash drive. When it didn't work I reflashed it as a bootable flash with the Linux Minto 20 iso on it. I also did try to look at the original the pastebin links later, but got the message: The Paste you are looking for does not currently exist. Tried both of them again just now and got the same message. So at present I am running a live Mint 20 and the hard drive that won't boot also has Mint 20 on it. The long Boot Repair log I posted in the earlier post was generated while booted live with Mint 20 and and the non booting mint hard drive in the laptop's dive bay. Given that it appears these logs are only saved for a little while I thought I should paste it in my message rather than send the links. |
I can't find it now but I saw a reply that said to shorten my message as it had the full pastebin log in it.
So here is a shorter note with a link to the pastebin note on Google Drive: Here is that session where I pasted in the script I was instructed to: mint@mint:~$ sudo chroot "/mnt/boot-sav/sda6" dpkg --configure -a mint@mint:~$ sudo chroot "/mnt/boot-sav/sda6" apt-get install -fy Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded. mint@mint:~$ sudo chroot "/mnt/boot-sav/sda6" apt-get purge -y grub*-common shim-signed Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'grub-common' for glob 'grub*-common' Note, selecting 'grub2-common' for glob 'grub*-common' Package 'shim-signed' is not installed, so not removed Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: grub-pc : Depends: grub-common (= 2.04-1ubuntu26.3) but it is not going to be installed Depends: grub2-common (= 2.04-1ubuntu26.3) but it is not going to be installed grub-pc-bin : Depends: grub-common (= 2.04-1ubuntu26.3) but it is not going to be installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. mint@mint:~$ So I ran boot repair again and just chose to analyze and send the log to pastebin. So here is a link to google drive with what was posted at pastebin: https://drive.google.com/file/d/1m-55yIdhuDII2qengpnkpN99tW-sMNLO/view?usp=share_link |
Quote:
|
When I was trying to fix the Windows drive it was mounted as an external USB drive. So it was after I tried fixing that drive that I found the linux drive became corrupted. I'd found a number of drives, but really had do idea which ones were which. Most of what I tried completed immediately and said no changes were made. I did find another drive while still trying to repair the windows drive. The chckdsk command did do some things and take some time. But the windows disk still didn't boot and the linux disk now no longer could boot.
So all of the things I have posted are from after the linux drive no longer booted and the windows drive was in to way attached or connected to anything. So maybe the windows chckdsk command tried to rename something to Windows? I hope this clarifies things a little bit. |
I think the best way to fix this is to chroot into the linux partition and reinstall grub.
Boot the live usb and open a terminal Code:
sudo mount /dev/sda6 /mnt You may get an error on one of the grub-install commands ignore for now. |
made it part of the way:
mint@mint:~$ sudo mount /dev/sda6 /mnt mint@mint:~$ sudo mount /dev/sda1 /mnt/boot/efi mint@mint:~$ sudo mount --bind /dev /mnt/dev mint@mint:~$ sudo mount --bind /dev/pts /mnt/dev/pts mint@mint:~$ sudo mount --bind /proc /mnt/proc mint@mint:~$ sudo mount --bind /sys /mnt/sys mint@mint:~$ chroot /mnt chroot: cannot change root directory to '/mnt': Operation not permitted mint@mint:~$ sudo mount --bind /sys /mnt/sys mint@mint:~$ chroot /mnt chroot: cannot change root directory to '/mnt': Operation not permitted |
should be
Code:
sudo chroot /mnt Took another look at the pastebin you can skip this one: grub-install --target=x86_64-efi /dev/sda |
I saw your edit and skipped the install uemi step, exited and rebooted. It didn't boot. I got a could not load pxe over ip4 message.
I looked around a little and see this probably refers to the bios settings. I had it set to uefi only when I ran the terminal commands and rebooted. I assume that change stuck. I know when I first looked at the settings it was set as use both legacy and uefi. So I'm thinking I should change it back to that but I wanted to get back to you first. Then I ran into issues logging in plus got called away for other things. |
There is a i386-pc folder in /boot/grub/ and not a x86_64-efi folder which indicates linux was installed in legacy mode therefore legacy mode would need to be enabled. To boot windows linux needs to be installed in the same mode as windows. Running both grub-install commands would allow linux to be booted in either mode.
|
I was tired last night and didn't want to try resetting the bios setting and rebooting in case that didn't solve things, although I that it would. I needed some rest.
I did that this morning and it booted up fine. Thank you so much. It is so nice to have screen and keyboard a size I can read and manipulate, not to sign into things and stay connected, etc. |
You're Welcome
|
All times are GMT -5. The time now is 06:13 AM. |