LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   After taking out and putting back an M.2 Drive, I can no longer boot (https://www.linuxquestions.org/questions/linux-software-2/after-taking-out-and-putting-back-an-m-2-drive-i-can-no-longer-boot-4175696694/)

DiBosco 06-20-2021 11:22 AM

After taking out and putting back an M.2 Drive, I can no longer boot
 
I have had a lot of problems with nvidia graphics drivers on my Mageia installation recently, so took out my M.2 drive with my install on it and tried booting from a SATA drive with a fresh install and updating all drivers to see if the problem was on a specific install and/or the very latest drivers had fixed my issue.

They hadn't, so I put my M.2 drive back in, but now that will not longer boot.

If I run from a SATA drive, then the data is still there on my M.2 drive, so I have clearly not destroyed it. If I try to reinstall on to my M.2 drive, the Mageia installer tells me I have no EFI partition any more and I have to erase the whole disk.

Is there a way to recover my EFI partition? I really don't know why carefully removing and reinstalling the M.2 drive would cause this to happen.

Many thanks.

lovemeslk 06-20-2021 11:34 AM

What sounds like happened when you take a drive out then put it back your cmos got reset. Go into bios find your drive and set it to boot from. make sure legacy boot support is enabled if you do not use EFI partition. On my system I have it set to Auto so I can boot legacy or EFI partition from the disk.
What it looks like you had it set to legacy when you installed your system. Now your system is set to boot EFI only. Like it came from factory. set to auto or legacy boot that system.

DiBosco 06-20-2021 11:39 AM

Quote:

Originally Posted by lovemeslk (Post 6260528)
What sounds like happened when you take a drive out then put it back your cmos got reset. Go into bios find your drive and set it to boot from. make sure legacy boot support is enabled if you do not use UFEI partition. On my system I have it set to Auto so I can boot legacy or UFEI partition from the disk.

I have tried that (I think). I can press F12 to choose the drive to boot from. If I do that, nothing happens for a short while then it returns the computer's boot options (is asking me which physical drive I should boot from). If I go in to the BIOS itself and select the relevant M.2 drive as the first drive to boot from, it's the same.

lovemeslk 06-20-2021 11:41 AM

No you need to set to legacy boot. so please give MB info
What it looks like you had it set to legacy when you installed your system. Now your system is set to boot EFI only. Like it came from factory. set to auto or legacy boot

DiBosco 06-20-2021 12:15 PM

I don't know what you mean by MB info, sorry.

I have tried legacy, but it didn't help. Mageia only works with UEFI, I am 99.9% sure I did install with with UEFI enabled.

DiBosco 06-20-2021 12:17 PM

BTW, CSM support *is* enabled in the BIOS. If that is disabled, you can't choose The Storage Boot Option Control between Legacy and EUFI.

lovemeslk 06-20-2021 12:56 PM

Quote:

Originally Posted by DiBosco (Post 6260540)
I don't know what you mean by MB info, sorry.

I have tried legacy, but it didn't help. Mageia only works with UEFI, I am 99.9% sure I did install with with UEFI enabled.

that is not true. I do installs of it as not EFI all the time in VM.
I also do it on this one partition I have. just boot from grub. I do not set up a GPT and 100mb fat partition that is mounted at /boot/grub.
That is what a EFI partition.
I install it make sure my work runs in it then reformat carry on.
default install with a non formatted drive. Your installer will do a GPT partion and then create a EFI partion.
Little secret you can still boot it as legacy if you have legacy boot enable in csm.
The reason Default install is EFI. is because people take a windows machine and install linux on it.
so we spoon feed them a tad to let them grow.
Other wise would not be sitting here dealing with this issue.
since you have no Idea the make model of your computer or the motherbord.
put a live disk in and wipe the drive and start fresh.
let the default installer create the default partitions and formats.
Code:

how to find motherboard info in linux
use this
as root or sudo.
Code:

dmidecode -t 2
look like this
Code:

Base Board Information
        Manufacturer: Gigabyte Technology Co., Ltd.
        Product Name: X570 AORUS ELITE WIFI
        Version: x.x
        Serial Number: Default string
        Asset Tag: Default string
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: Default string
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0


colorpurple21859 06-20-2021 02:11 PM

Before you took out the m2 drive, was the sata drive already installed and if so, what was on it before you did a fresh install?

Bonzoo 06-20-2021 04:26 PM

1 Attachment(s)
Quote:

Originally Posted by DiBosco (Post 6260540)
I don't know what you mean by MB info, sorry.

I have tried legacy, but it didn't help. Mageia only works with UEFI, I am 99.9% sure I did install with with UEFI enabled.

inxi -b in your terminal

DiBosco 06-20-2021 05:04 PM

It was the "MB" that threw me, I simply didn't know what it stood for, had I known the abbreviation I'd've known how to get the information. As we were talking about hard drives, I just didn't make the connection. :)

Code:

  Manufacturer: Gigabyte Technology Co., Ltd.
        Product Name: Z390 UD
        Version: x.x
        Serial Number: Default string
        Asset Tag: Default string
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: Default string
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0


As for the question from colorpurple21859, that is a very good question. There was a different SATA drive I just used for some data backup. That was removed and this second SATA drive put in just to enable me to check the graphics issue on a separate drive temporarily. When I did the original install there was nothing but the M2 drive installed in the virgin machine though.

Quote:

put a live disk in and wipe the drive and start fresh.
let the default installer create the default partitions and formats.
I'm more than capable of doing that, but was trying not to have to go through that rigmarole and copy everything on to a newly formatted drive. (I never use the default partitioning, mind.)

colorpurple21859 06-20-2021 05:13 PM

Post the output of /etc/fstab of the installation on the m2 drive

Bonzoo 06-20-2021 05:48 PM

OK. How about this ( far stretch) Snatch the battery and reset the cmos.

colorpurple21859 06-20-2021 08:18 PM

.
Quote:

There was a different SATA drive I just used for some data backup.
Quote:

. If I try to reinstall on to my M.2 drive, the Mageia installer tells me I have no EFI partition any more and I have to erase the whole disk.

Is there a way to recover my EFI partition? I really don't know why carefully removing and reinstalling the M.2 drive would cause this to happen.
Removing and reinstalling a drive won't get rid of the the efi partition or any other partition on the drive. Either the drive was booting in legacy/csm mode or the efi partition was located on the different Sata drive.

With the sata and m2 drive installed post the output of
Code:

sudo parted -l
and the contents of the m2 /etc/fstab.

verndog 06-21-2021 10:29 AM

Boot from a live linux distro. Open a terminal and type
Code:

efibootmgr
. It will list the boot order. Make your m.2 the first boot.


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