[SOLVED, most probably] Grub problems after reinstalling Linux Mint 18.2 (from dual boot with Windows to LM only)

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
kramarov

[SOLVED, most probably] Grub problems after reinstalling Linux Mint 18.2 (from dual boot with Windows to LM only)

Post by kramarov »

Acer Aspire E5-771G, Intel Core i5-5200, NVidia GeForce 840M, UEFI, GPT

I was dualbooting Windows 8.1 with Linux Mint 18.2 Cinnamon for a while, then had malware issues ( + generally buggy Windows), and decided to do the following: 1. Remove Mint; 2. Repair Windows; 3. Dualboot with Mint again.
I used this guide: https://itsfoss.com/uninstall-ubuntu-li ... dual-boot/. Part 2 (fixing Windows bootloader) didn't work, so I restored Windows to initial state. After recovery, Windows asked for the activation key I had lost long ago (the OS was preinstalled on the laptop). I got mad at the stubborn Windows and decided to kill it entirely and install Mint only.

I booted from the same USB i had used to install Mint in dualboot (UEFI bootable, made with Rufus) and launched the installer. It detected Windows on the machine. As i thought i had already fixed the bootloader, i simply chose to "erase Windows and install Mint". This was probably my big mistake, i should have done manual partitioning. The installation went ok until restart; but when i rebooted i got this:

Default boot device missing or boot failed.
Insert recovery media and hit any key.
Then select 'Boot Manager' to choose a new boot device or to boot recovery media.
[Ok]


I hit Ok without the USB, and got this:

Boot Manager
Boot Option Menu

1. Linux
2. Unknown Device: <WDC WD10JPVX-22JC3T0>


which was quite a surprise because this 'Linux' is the name i gave Mint in dual boot and i suspect it tried to boot the system that no longer exists. The 'unknown device' is my hard drive with the newly installed Mint.
I rebooted a few times with various UEFI settings (secure boot enabled/disabled, changing boot priority, etc.) and somehow was able to bring up the GRUB menu; i chose 'Advanced options' => recovery mode => Update grub bootloader
I'm not sure what it did (in the log, it mentioned remounting the EFI partition) but i booted into Mint and thought that my problems were over. I installed updates (safe mode, level 1 and 2 only, so no kernel updates) and nvidia driver (as i had the black screen at boot which i had to bypass with 'nomodeset'). I rebooted and...

Boot Manager
Boot Option Menu

1. Unknown Device: <WDC WD10JPVX-22JC3T0>
2. Linux


Now, if i choose the 'Unknown Device', it boots to black screen (obviously something went wrong with the driver), and i can't bypass the black screen because i don't get the GRUB (!). Striking Esc at boot takes me to 'Minimal BASH like line editing...' with grub> prompt.

Here's the output of grub> set :
Image

I can still boot from live USB.
Here's the output of sudo fdisk -l:
Image

Here's what GParted shows:
Image

Now i'm quite at a loss about what to do next. I feel tempted to try boot-repair (https://www.howtogeek.com/114884/how-to ... wont-boot/) but first i'd love to understand what's going on here and be sure about what i'm doing.

Many thanks in advance...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Grub problems after reinstalling Mint 18.2

Post by deepakdeshp »

Try boot repair.
https://help.ubuntu.com/community/Boot-Repair
If it doesn't work, go to BIOS and choose legacy mode and not uefi.
Save BIOS settings and install Mint
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Grub problems after reinstalling Mint 18.2

Post by deepakdeshp »

Boot from live USB and run following.

Code: Select all

fsck -y /dev/sda2
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
Pierre
Level 21
Level 21
Posts: 13224
Joined: Fri Sep 05, 2008 5:33 am
Location: Perth, AU.

Re: Grub problems after reinstalling Mint 18.2

Post by Pierre »

kramarov wrote:Acer Aspire E5-771G, Intel Core i5-5200, NVidia GeForce 840M, UEFI, GPT

I was dual-booting Windows 8.1 with Linux Mint 18.2 Cinnamon for a while, then had malware issues ( + generally buggy Windows), and decided to do the following: 1. Remove Mint; 2. Repair Windows; 3. Dualboot with Mint again.
I used this guide: https://itsfoss.com/uninstall-ubuntu-li ... dual-boot/. Part 2 (fixing Windows bootloader) didn't work, so I restored Windows to initial state. After recovery, Windows asked for the activation key I had lost long ago (the OS was preinstalled on the laptop). I got mad at the stubborn Windows and decided to kill it entirely and install Mint only.
you didn't need to get Mad at Windows - - just Get Smart with it:
- - that Activation Key is inbuilt into the BIOS, these days :o
and so there is No Sticker or anything to show what the code actually is.

- - seriously, though - - I'd suggest starting again:
re-install win-8x and then re-install LinuxMint
- - there is plenty of room for both, on that 1Tb drive.
:shock:

use Gparted from that Live Stick to erase everything from that HDD,
- make 1 -2 partitions for win-8x
- make 2 - 3 partitions for LinuxMint

- - install win-8x & reboot to check that it works A.ok
- - install LinuxMint & reboot to check that they Both still work A.ok
8)
Image
Please edit your original post title to include [SOLVED] - when your problem is solved!
and DO LOOK at those Unanswered Topics - - you may be able to answer some!.
michael louwe

Re: Grub problems after reinstalling Mint 18.2

Post by michael louwe »

@ kramarov, .......
kramarov wrote:...
.
Beginning with Win 8.x, the OEMs stopped providing COA Product Key stickers because the activation code is embedded in the motherboard, stored in M$'s servers and auto-activated online. Similarly for Win 10. The OEMs also stopped providing free Win 8.x/10 Recovery/Install DVDs. So, buyers were expected to create their own OEM Factory Image Recovery Backup USB Flashdrive or System Image USB-drive for system recovery.
...

To clean reinstall Win 8.1, you need to insert the Product Key, which should have been retrieved from a running Win 8.1 system with a 3rd-party program like ProduKey. There is a workaround for the PK requirement ... https://www.pcsteps.com/627-install-win ... oduct-key/
... If a clean reinstalled Win 8.1 is not auto-activated online, the users should call M$.
michael louwe

Re: Grub problems after reinstalling Mint 18.2

Post by michael louwe »

@ kramarov, .......
kramarov wrote:...
.
Certain high-end OEM Win 8.x/10 computers, eg Acer, Asus and HP, have an obstructive or pro-M$ BIOS setting for "select an UEFI file as trusted for executing",(= Linux cannot boot). For the fix, please refer to ...
https://itsfoss.com/no-bootable-device-found-ubuntu/
viewtopic.php?t=236560

The above latest(= 2017) OEM laptops, eg Acer E and S series, may have even removed this BIOS setting(eg "No bootable device" after installing Linux and cannot be fixed), but may be restored by a new BIOS firmware update from the OEMs = update through Windows only. This was after many complaints from affected users. ...
viewtopic.php?f=46&t=254948
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

Pierre wrote:
you didn't need to get Mad at Windows - - just Get Smart with it:
- - that Activation Key is inbuilt into the BIOS, these days :o
and so there is No Sticker or anything to show what the code actually is.

- - seriously, though - - I'd suggest starting again:
re-install win-8x and then re-install LinuxMint
- - there is plenty of room for both, on that 1Tb drive.
:shock:
Thank you for the advice, but i really don't want Windows on that laptop (i have Win10 on another machine); i'm going to dualboot Mint with another Linux distro, Manjaro with KDE desktop most probably, then maybe try Ubuntu when Bionic Beaver is released...
Pierre wrote:
use Gparted from that Live Stick to erase everything from that HDD
8)
Thought about that as last resort. I actually don't know how to do it and will have to find a guide first.
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

michael louwe wrote: Certain high-end OEM Win 8.x/10 computers, eg Acer, Asus and HP, have an obstructive or pro-M$ BIOS setting for "select an UEFI file as trusted for executing",(= Linux cannot boot). For the fix, please refer to ...
https://itsfoss.com/no-bootable-device-found-ubuntu/
viewtopic.php?t=236560
I'm aware of this setting and already had to use it when i was installing Mint in dualboot.
This time, when i tried to do it, it said something like "File exists", and it changed nothing.
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

deepakdeshp wrote:Boot from live USB and run following.

Code: Select all

fsck -y /dev/sda2
Thank you,
here's the output:

Code: Select all

mint@mint ~ $ fsck -y /dev/sda2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
fsck.ext2: Permission denied while trying to open /dev/sda2
You must have r/w access to the filesystem or be root
With sudo added:

Code: Select all

mint@mint ~ $ sudo fsck -y /dev/sda2
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
/dev/sda2: clean, 220090/60628992 files, 5273913/242508032 blocks
As far as I understood from the manuals, with -y option, fsck tries to automatically repair the detected filesystem problems... But nothing changed so far :(
deepakdeshp
Level 20
Level 20
Posts: 12341
Joined: Sun Aug 09, 2015 10:00 am

Re: Grub problems after reinstalling Mint 18.2

Post by deepakdeshp »

If reinstalling Mint ,here is the guide
https://www.google.co.in/amp/s/www.tecm ... guide/amp/
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help.
Regards,
Deepak

Mint 21.1 Cinnamon 64 bit with AMD A6 / 8GB
Mint 21.1 Cinnamon AMD Ryzen3500U/8gb
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

deepakdeshp wrote:Try boot repair.
https://help.ubuntu.com/community/Boot-Repair
If it doesn't work, go to BIOS and choose legacy mode and not uefi.
Save BIOS settings and install Mint
Boot-repair helped, to a certain extent :)
I still get the Default boot device missing or boot failed message and the ugly Boot Manager screen:

Boot Option Menu
1. Unknown Device: <WDC WD10JPVX-22JC3T0>
2. Linux


However, if i choose the 'unknown device' now, i get the normal Grub menu.

Booted into the installed Mint (after bypassing the black screen again).
Got this message:

Cinnamon just crashed
You are currently running in Fallback mode
Do you want to restart Cinnamon?


Well, whatever i want, it won't restart LOL
Don't know what to do about it.
Trying to fix the drivers now...
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

Reinstalled the nvidia driver. No Cinnamon crash since then.

Here's the Boot-repair report before the recommended repair:
http://paste.ubuntu.com/26320377/

and after the recommended repair:
http://paste.ubuntu.com/26320490/

After the repair, it said "do not forget to make your BIOS boot on sda1/EFI/ubuntu/shimx64.efi file". How do i do that? Via the "select an UEFI file as trusted for executing", or is there a way to do that in the terminal?
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

So, the current state of things is:

Now, after using Boot-repair, i have the perfectly running system, but i have to boot via a weird sequence of screens.
First, i see this:

Default boot device missing or boot failed.
Insert recovery media and hit any key.
Then select 'Boot Manager' to choose a new boot device or to boot recovery media.
[Ok]


Hitting Ok (with no recovery media inserted) takes me to the Boot Manager screen:

Boot Option Menu
1. Unknown Device: <WDC WD10JPVX-22JC3T0>
2. Linux


If i choose (1), i get the proper Grub menu, and then Mint starts normally.
(2) is a nonfunctioning option that remained from the previous dual boot setup.The question now is, how can i get rid of it and make the machine understand that there's now only one OS on it?

I'm sorry for moving up the topic again (i understand that this is probably an uncommon situation and not really interesting for many people on the forum), but please give it this last chance :)
mrmajik45

Re: Grub problems after reinstalling Mint 18.2

Post by mrmajik45 »

Can you give us a screenshot of the partitions? Gparted or Partition manager
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

mrmajik45 wrote:Can you give us a screenshot of the partitions? Gparted or Partition manager
Here's the screenshot:
Image

I'm sorry i'm so slow in answering, it's holiday time with a lot of family and friend responsibilities...

Here's also the Boot-repair report with boot info summary and repair info: https://paste.ubuntu.com/26320490/
mrmajik45

Re: Grub problems after reinstalling Mint 18.2

Post by mrmajik45 »

That's weird you have a efi partition but i don't. maybe the unknown device is the efi partition?
mrmajik45

Re: Grub problems after reinstalling Mint 18.2

Post by mrmajik45 »

mrmajik45 wrote:That's weird you have a efi partition but i don't. maybe the unknown device is the efi partition?
Just back up the partition before doing that.
mrmajik45

Re: Grub problems after reinstalling Mint 18.2

Post by mrmajik45 »

Why are there 2 boot partitions and some files overlapping? SDA1

Code: Select all

File system:       vfat
    Boot sector type:  FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /EFI/ubuntu/grub.cfg /EFI/Boot/bootx64.efi 
                       /EFI/ubuntu/fbx64.efi /EFI/ubuntu/fwupx64.efi 
                       /EFI/ubuntu/grubx64.efi /EFI/ubuntu/mmx64.efi 
                       /EFI/ubuntu/shimx64.efi


SDB1

Code: Select all

File system:       vfat
    Boot sector type:  Windows 8/2012: FAT32
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /boot/grub/grub.cfg /syslinux.cfg /EFI/BOOT/grubx64.efi
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

mrmajik45 wrote:That's weird you have a efi partition but i don't. maybe the unknown device is the efi partition?
What stands in brackets after the 'unknown device' looks like my HDD... which must be sda2 ?
mrmajik45 wrote:Why are there 2 boot partitions and some files overlapping?
My knowledge is not enough to comment on the boot info you quoted... isn't SDB1 here on the live USB? I ran Boot-repair from Mint live USB.
Anyway, it's no wonder if something is overlapping considering that I (1) installed Mint in dualboot with Windows, (2) removed Mint, (3) probably failed to remove its bootloader, (4) reinstalled Mint (and trusted its installer to remove Windows and partition the disk automatically).
kramarov

Re: Grub problems after reinstalling Mint 18.2

Post by kramarov »

Here's a screenshot of the boot priority list in my bios:

Image

As far as i understand, Mint actually boots from (1).
And, there's also this (9) EFI File Boot 0: Linux. Moving it up to the top of the boot priority doesn't change anything. I assume that it's probably nonfunctional because it refers to the removed OS. This must be the file i selected as 'trusted for executing' when installing Mint in dualboot with Windows. Might be just my guesses as i'm totally new to all this. But if i'm right, what's the correct way to locate and remove it?
Locked

Return to “Installation & Boot”