LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help! I messed up with a bios update... (https://www.linuxquestions.org/questions/linux-newbie-8/help-i-messed-up-with-a-bios-update-4175686021/)

Jonny_Mango 11-30-2020 10:49 AM

Help! I messed up with a bios update...
 
Hi All,

I was running a dual boot system with Linux Mint Cinammon 18.3 and Windows 10 on an Acer ES1-132 laptop for a couple of years now. I use Linux 99% of the time and switch to Windows only when I need to use certain software such as CorelDraw which is not available on Linux. Acer is not Linux-friendly and it initially took me quite a while to get around a Windows Boot Manager issue that was preventing me from being able to boot into Linux. Eventually I found a workaround code which was: sudo efibootmgr -c -L "Windows Boot Manager" -l "EFI\ubuntu\grubx64.efi"

I recently was having some problems with the laptop (camera stopped working, touchpad stopped working + a few other minor issues) and after looking online it seemed that a bios update might fix some of these issues. I went to the Acer website to update the bios and found that updates were only available for Windows O/S, and nothing for Linux (of course...). At this point my brain apparently switched to zombie mode and I rebooted into Windows and performed the bios update while booted in Windows. Whilst it did fix the problems with the touchpad and camera, it also reverted back to automatically booting into Windows.

If I use a flash drive to boot into a live version of Linux I can find all of my files (huge relief!!) and I have installed LM again choosing the option of running LM alongside existing operating systems (as opposed to deleting all info on the drives). As yet I have not removed the flash drive and rebooted using the code: sudo efibootmgr -c -L "Windows Boot Manager" -l "EFI\ubuntu\grubx64.efi" because I am unsure if this will result in me losing any data. If left to my own devices my next step would be to buy an external HD, copy all my files and then run the code again, however, I'm fairly certain if I do this I will be starting from scratch with effectively a new install of LM.

Does anyone know if there is a way I can reinstall LM (or revert back to my previous setup) so that I do not have to start again from scratch (i.e. re-install all software etc), or did that bios update doom me?

Many thanks in advance.

uteck 11-30-2020 11:16 AM

I am a bit confused by your question in the last paragraph. You just wrote in the paragraph above that one you did reinstall Mint. So if you lost your files it was when you reinstalled the OS before backing up the files you said you found on it.
Running the command to get grub working again will not delete your files, reinstalling the OS can do that if /home get formatted.

colorpurple21859 11-30-2020 12:32 PM

Quote:

If I use a flash drive to boot into a live version of Linux I can find all of my files
With this a reinstall shouldn't have been necessary, unless the efi partition was reformatted, all you would have needed to do is rerun the efibootmgr command again. Here is a list of the efibootmgr switches: https://linux.die.net/man/8/efibootmgr The command just registers the grubx64.efi bootloader as a "windows boot manager" If the efi partition was reformatted then grub-install command will need to be reran.

Quote:

I have installed LM again choosing the option of running LM alongside existing operating systems
With this either you have two LM installations on the system, and your most likely booting the newer installation, or you overwrote your data when you did LM re-install.

Jonny_Mango 12-03-2020 02:34 AM

Many thanks for the replies. I ended up buying a new external HDD to back up my files before running the efibootmgr command, but it seemed running a live version of LM from the USB stick created a few problems with permissions, so I bit the bullet and ran the command anyway without first making a backup. Thankfully all went well, and as colorpurple21859 predicted I now have 2 versions of Linux on my machine. Now when I boot up I get the following options:

Linux Mint 18.3 Cinnamon 64-bit (this is the new install)
Advanced options for Linux Mint 18.3 Cinnamon 64-bit
Windows Boot Manager (on /dev/sda1)
Linux Mint 18.3 Sylvia (18.3) (on /dev/sda2) (this is my old system setup)
Advanced options for Linux Mint 18.3 Sylvia (18.3) (on /dev/sda2)
System Setup

I get around 10-15 seconds to make a decision as to which option I want to choose and if I fail to specify an option by default I am booted into the 1st option, the new installation.

Can anyone advise how I can safely remove this new installation, or if that is tricky, then is there a way to change the order so that the 1st option in the list is my old system setup?

Once again, many thanks in advance.

colorpurple21859 12-03-2020 06:48 AM

Quote:

Can anyone advise how I can safely remove this new installation

At the grub menu press c for a grub prompt
Code:

grub>set
There will be a line that looks like this:
Code:

prefix=(hd0,?)/boot/grub
Where the hd0 will be the first drive counting from 0 and the ? will be the partition number counting from one. It probably points to the partition that the new installation is on and controlling the grub bootloader.

This should give control of the grub bootloader back to the installation you want to keep.
Boot into the installation you want to keep
Quote:

sudo grub-install
sudo efibootmgr -c -L "Windows Boot Manager" -l "EFI\ubuntu\grubx64.efi"
reboot
The default entry should now be the old installation.
use the set command at the grub prompt to verify.

What are you going to do with the partition the new installation is on after removing?

jefro 12-03-2020 03:11 PM

Thoughts.

Sudo efibootmgr will simply show the boot order. To remove any is sudo efibootmgr -Bb xy.
Every linux user ought to monitor that list. Some bios's creep adding entries. At some point the bios bricks.

Now what is also mentioned above is grub (or maybe other loaders) that take over from bios. That could be affected by boot order in some cases.

I think I'd also look at drive(s) in case any remnants exist to fool grub update.

Jonny_Mango 12-04-2020 02:13 AM

Quote:

Originally Posted by colorpurple21859 (Post 6191323)
At the grub menu press c for a grub prompt
Code:

grub>set
There will be a line that looks like this:
Code:

prefix=(hd0,?)/boot/grub
Where the hd0 will be the first drive counting from 0 and the ? will be the partition number counting from one. It probably points to the partition that the new installation is on and controlling the grub bootloader.

This should give control of the grub bootloader back to the installation you want to keep.
Boot into the installation you want to keep

reboot
The default entry should now be the old installation.
use the set command at the grub prompt to verify.

Thanks for your help.

I'm pretty sure I followed the instructions correctly. After I typed "set" when "grub> " appeared it showed: hd0, gpt5 (as I recall - didn't screenshot it but pretty sure that's what it showed)

So now when I boot up it shows:

Linux Mint 18.3 Cinnamon 64-bit (this is my old system setup)
Advanced options for Linux Mint 18.3 Cinnamon 64-bit
Windows UEFI bootmgfw.efi
EFI/refind/refind_x64.efi
EFI/ubuntu/fbx64.efi
EFI/ubuntu/fwupx64.efi
EFI/ubuntu/mmx64.efi
EFI/Linux/ubuntu/fbx64.efi
EFI/Linux/ubuntu/fwupx64.efi
EFI/Linux/ubuntu/mmx64.efi
Windows Boot Manager (on /dev/sda1)
Linux Mint 18.3 Sylvia (18.3) (on /dev/sda5)
Advanced options for Linux Mint 18.3 Sylvia (18.3) (on /dev/sda5)
System setup

So my old system setup is now at the top of the list and is the default boot mode, which is great, so thank you for that. Would you recommend I do anything to tidy up/trim down that list, or just leave it as-is?


Quote:

Originally Posted by colorpurple21859 (Post 6191323)
What are you going to do with the partition the new installation is on after removing?

I don't know... What would you suggest?

Jonny_Mango 12-04-2020 02:18 AM

Quote:

Originally Posted by jefro (Post 6191462)
Thoughts.

Sudo efibootmgr will simply show the boot order. To remove any is sudo efibootmgr -Bb xy.
Every linux user ought to monitor that list. Some bios's creep adding entries. At some point the bios bricks.

Now what is also mentioned above is grub (or maybe other loaders) that take over from bios. That could be affected by boot order in some cases.

I think I'd also look at drive(s) in case any remnants exist to fool grub update.

Thanks very much for your input. Sorry but I'm not experienced enough with Linux to know what you're suggesting I should do. Can you educate me, or am I on the right path with colorpurple21859's suggestions?

Cheers.

colorpurple21859 12-04-2020 06:47 AM

Post the output of
Code:

sudo parted -l
efibootmgr


Jonny_Mango 12-04-2020 09:44 AM

james@james-Aspire-ES1-132 ~ $ sudo parted - l
[sudo] password for james:
Error: Could not stat device - - No such file or directory.
Retry/Cancel?

colorpurple21859 12-04-2020 10:24 AM

Had a typo that was suppose to be -l without a space between the - and the lowercase L, corrected the previous post

Jonny_Mango 12-05-2020 10:13 AM

OK - here's the results:

james@james-Aspire-ES1-132 ~ $ sudo parted -l
[sudo] password for james:
Model: ATA WDC WD5000LPCX-2 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 EFI System Partition boot, esp
2 538MB 171GB 171GB ext4
3 171GB 280GB 108GB ntfs msftdata
4 280GB 280GB 839MB ntfs hidden, diag
5 280GB 496GB 216GB ext4
6 496GB 500GB 4114MB linux-swap(v1)

james@james-Aspire-ES1-132 ~ $ efibootmgr
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0005,0002,2001,2002,2003
Boot0000* Unknown Device:
Boot0001* ubuntu
Boot0002* Windows Boot Manager
Boot0003* Windows Boot manager
Boot0004* Windows Boot Manager
Boot0005* Windows Boot Manager
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network

Jonny_Mango 12-08-2020 02:34 AM

Anyone...?

colorpurple21859 12-08-2020 05:31 AM

Based on the grub menu info you posted, the old installation is on /dev/sda2 and the new installation is on /dev/sda5. With the diag partition between sda5 and the windows partition you won't be able to add it back to the windows partition. With its location, the most you could use it for is an extra data partition that you could share with windows if it is formatted ntfs or to multiboot an additional distro.
Quote:

Would you recommend I do anything to tidy up/trim down that list, or just leave it as-is?
leave as-is

syg00 12-08-2020 05:46 AM

Quote:

Originally Posted by colorpurple21859 (Post 6192930)
leave as-is

Absolutely.

I reckon you've done enough damage already. You neglected to mention you had installed rEFInd - in addition to the two copies of grub. And the multiple Windows entries you created. EFI is pretty robust - much more so than BIOS, but you can still screw it if you try. So leave it alone for a while.


All times are GMT -5. The time now is 11:51 PM.