LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-12-2023, 06:57 PM   #1
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Rep: Reputation: 0
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.
 
Old 03-12-2023, 08:48 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
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

Last edited by colorpurple21859; 03-13-2023 at 06:16 AM.
 
Old 03-12-2023, 10:46 PM   #3
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,175

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
You could do it the easy way with https://sourceforge.net/p/boot-repair-cd/home/Home/
 
Old 03-13-2023, 05:41 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,546

Rep: Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497Reputation: 2497
Quote:
I first tried to use Boot Repair while booted up in ubuntu and it did generate some reports.
The boot repair page instructs users to post the paste bin link at a forum where experienced users can help. That should have been your first step as you seem unfamiliar with bootloaders. Try running it again and posting the link.

Quote:
/dev/sda1: UUID="2020-06-24-20-35-19-00" LABEL="Linux Mint 20 MATE 64-bit" TYPE="iso9660" PTUUID="6d94e5e7" PTTYPE="dos"
The output above which you posted clearly shows with the "iso9660" that the drive is the live Linux iso as pointed out in an earlier post. You indicate you have some Linux installed on the hard drive, which is it? Is it Ubuntu or Mint or some other OS? Is the install on the hard drive an EFI or Legacy install?
 
Old 03-13-2023, 07:04 AM   #5
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 03-13-2023, 11:50 AM   #6
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 03-13-2023, 12:32 PM   #7
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
Quote:
For what it’s worth I was initially trying to fix a windows drive that would’t boot
Was this an external drive? There is a grub entry for windows on a second drive first partition, however there is no windows partition anywhere.
 
Old 03-13-2023, 12:57 PM   #8
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 03-13-2023, 01:20 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
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
sudo mount /dev/sda1 /mnt/boot/efi
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
grub-install --target=i386-pc /dev/sda
grub-install --target=x86_64-efi /dev/sda
exit
reboot
You may get an error on one of the grub-install commands ignore for now.

Last edited by colorpurple21859; 03-13-2023 at 01:44 PM.
 
Old 03-13-2023, 01:26 PM   #10
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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
 
Old 03-13-2023, 01:41 PM   #11
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
should be
Code:
sudo chroot /mnt
edited post 9 for the sudo
Took another look at the pastebin you can skip this one: grub-install --target=x86_64-efi /dev/sda

Last edited by colorpurple21859; 03-13-2023 at 01:44 PM.
 
Old 03-13-2023, 08:56 PM   #12
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 03-13-2023, 09:28 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
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.
 
1 members found this post helpful.
Old 03-14-2023, 07:37 AM   #14
muttleytm
LQ Newbie
 
Registered: Sep 2022
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 03-14-2023, 08:33 AM   #15
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,369

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
You're Welcome
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Infinite Grub Loop: GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB GRUB... beeblequix MEPIS 2 11-02-2013 10:56 PM
Reinstall Slack's LILO after WIndows XP reinstall __spc__ Linux - Newbie 3 02-15-2009 09:04 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
To reinstall or not to reinstall...that's the question.. minike Slackware 3 09-17-2005 06:24 PM
reinstall windows, reinstall GRUB too? leupi Linux - Software 1 05-07-2005 10:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration