LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-25-2019, 09:13 AM   #16
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

try without sudo or do su - first

Code:
gdisk /dev/sda
Found valid GPT with protective MBR; using GPT.

Command (? for help): v
this will be message if this is the problem
Code:
Warning: The 0xEE protective partition in the MBR is marked as active. This is technically a violation of the GPT specification, and can cause some EFIs to ignore the disk, but it is required to boot from a GPT disk on some BIOS-based computers. You can clear this flag by creating a fresh protective MBR using
the 'n' option on the experts' menu.

Last edited by colorpurple21859; 09-25-2019 at 09:15 AM.
 
Old 09-25-2019, 09:16 AM   #17
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
try without sudo or do su - first

...

There are no Linux partitions. It's not even loading bash. Something went seriously wrong.
 
Old 09-25-2019, 09:19 AM   #18
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
You cleared the BIOS settings, and your CentOS system couldn't boot. That means the problem is related to a BIOS setting, and fixing this would instantly have made the system bootable again.

The most likely cause of your boot problems is that the legacy/EFI BIOS settings are incorrect. Booting with rescue media and messing with grub settings while still having the wrong BIOS settings is likely to result in a system that's unbootable in either mode.

First, make sure you know with certainty whether the system was installed in EFI or legacy mode. Fortunately, this should be really easy to ascertain: EFI requires a GPT partitioned disk, while legacy mode (sort-of) needs MBR. Boot from a USB stick, and fdisk -l /dev/sda (or /dev/your_boot_device_here) will tell you if you're using GPT or MBR. Look for "disklabel type"; MBR is reported as "dos".

Once you've established the type of partitioning being used, make sure to set your BIOS settings accordingly. Remember, simply enabling "legacy" support is no guarantee the system won't try EFI first. You need to also check the boot order. Disabling legacy support does guarantee the system will boot using EFI, though. Oh, and remember the Secure Boot setting; it probably needs to be disabled.

Only when all this is done does it make sense to use rescue media and try reinstalling grub.

Last edited by Ser Olmy; 09-25-2019 at 09:27 AM.
 
Old 09-25-2019, 09:51 AM   #19
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
You cleared the BIOS settings, and your CentOS system couldn't boot. That means the problem is related to a BIOS setting, and fixing this would instantly have made the system bootable again.

The most likely cause of your boot problems is that the legacy/EFI BIOS settings are incorrect. Booting with rescue media and messing with grub settings while still having the wrong BIOS settings is likely to result in a system that's unbootable in either mode.

First, make sure you know with certainty whether the system was installed in EFI or legacy mode. Fortunately, this should be really easy to ascertain: EFI requires a GPT partitioned disk, while legacy mode (sort-of) needs MBR. Boot from a USB stick, and fdisk -l /dev/sda (or /dev/your_boot_device_here) will tell you if you're using GPT or MBR. Look for "disklabel type"; MBR is reported as "dos".

Once you've established the type of partitioning being used, make sure to set your BIOS settings accordingly. Remember, simply enabling "legacy" support is no guarantee the system won't try EFI first. You need to also check the boot order. Disabling legacy support does guarantee the system will boot using EFI, though. Oh, and remember the Secure Boot setting; it probably needs to be disabled.

Only when all this is done does it make sense to use rescue media and try reinstalling grub.
That's exactly what I thought. So here are some notes:

Code:
Disk label type: dos
Device 		Boot		Id		System
/dev/sda1	*		0		Empty
/dev/sda2			ef		EFI (FAT-12/16/32)
For SATA Mode Selection, I have IDE, AHCI and RAID (doesn't count). I'm choosing IDE, which says "for better compatibility" as opposed to "AHCI: Supports new features that improve performance". "SATA Controllers" are enabled.

The Manual for this box. Page 86: http://asrock.pc.cdn.bitgravity.com/Manual/H97M%20Pro4.pdf



The CSM (Compatibility Support Module) is where things get confusing. PXE OpROM, Stoage OpROM, and Video OpROM Policies, I've set all to Legacy only. Two other options are Do not launch and UEFI only. So all those are set to Legacy Only.

At this point, nothing has changed. Secure Boot State is Disabled. I can't even choose it. Secure Boot (one lower on the Security tab) is Disabled.

This is what I've been running with so far, then thought it was a grub thing. Is there a way I can test all this, or do we move onto grub now?

Last edited by BeeRich; 09-25-2019 at 09:52 AM.
 
Old 09-25-2019, 09:55 AM   #20
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
That's exactly what I thought. So here are some notes:

Code:
Disk label type: dos
Device 		Boot		Id		System
/dev/sda1	*			0		Empty
/dev/sda2				ef		EFI (FAT-12/16/32)
So it seems your system was actually installed in EFI mode, even though MBR was used. Make sure to disable all "Legacy" support and leave the Secure Boot setting as disabled.
Quote:
Originally Posted by BeeRich View Post
For SATA Mode Selection, I have IDE, AHCI and RAID (doesn't count). I'm choosing IDE, which says "for better compatibility" as opposed to "AHCI: Supports new features that improve performance".
That's probably wrong. The "compatibility" they're talking about has to do with older operating systems that don't know about AHCI. CentOS7 certainly does support AHCI.

Last edited by Ser Olmy; 09-25-2019 at 09:56 AM.
 
Old 09-25-2019, 10:04 AM   #21
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
So it seems your system was actually installed in EFI mode, even though MBR was used. Make sure to disable all "Legacy" support and leave the Secure Boot setting as disabled.

That's probably wrong. The "compatibility" they're talking about has to do with older operating systems that don't know about AHCI. CentOS7 certainly does support AHCI.
So should I choose Do not launch or UEFI only? I can turn this whole section off (CSM Disabled). So there's 4 choices there.

Upon choosing UEFI only, no drives show up at all (there are 2 I use actually, one as storage). Same happens with Do not launch for the first two choices (third has Legacy or EUFI). Turning off CSM, no drives are available either. So it seems Legacy only is the only option.

Note: I'm not taking into account that there are no boot files on the drives, because of the grub2 stuff before.

Last edited by BeeRich; 09-25-2019 at 10:08 AM.
 
Old 09-25-2019, 10:25 AM   #22
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
Note: I'm not taking into account that there are no boot files on the drives, because of the grub2 stuff before.
That's probably quite significant.

The EFI boot mechanism (in the BIOS) expects to find boot images on the EFI System Partition (ESP), a mandatory partition formatted with one of the FAT filesystems. If these files are missing, the system simply cannot boot.

I'd leave the BIOS settings in "UEFI Only" mode and try to fix grub using rescue media.
 
Old 09-25-2019, 10:34 AM   #23
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
That's probably quite significant.

The EFI boot mechanism (in the BIOS) expects to find boot images on the EFI System Partition (ESP), a mandatory partition formatted with one of the FAT filesystems. If these files are missing, the system simply cannot boot.

I'd leave the BIOS settings in "UEFI Only" mode and try to fix grub using rescue media.
Well at this point, I don't know what to say. I set it to UEFI Only, and it's reporting no Linux partitions are there. I can't do a thing in the shell.

So I don't even have an operating system now. /boot/efi doesn't exist. No clue how I got there. Any last advice before I shoot myself in the head?
 
Old 09-25-2019, 10:46 AM   #24
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
Well at this point, I don't know what to say. I set it to UEFI Only, and it's reporting no Linux partitions are there. I can't do a thing in the shell.
What is reporting "no Linux partitions"? Which shell?

According to your first post, your root partition resides inside LVM along with the swap partiton and a separate partition for /home (/dev/sda3 being the only physical volume), while /dev/sda2 is your boot partition.
 
Old 09-25-2019, 10:52 AM   #25
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
What is reporting "no Linux partitions"? Which shell?

According to your first post, your root partition resides inside LVM along with the swap partiton and a separate partition for /home (/dev/sda3 being the only physical volume), while /dev/sda2 is your boot partition.
The rescue anaconda shell. I can't even chroot /mnt/sysimage/ because implementing the rescue shows there are no Linux partitions, and everything falls apart. No bash, no sh, nothing. I've tried two USB drives with different versions of CentOS7 and same thing.
 
Old 09-25-2019, 11:02 AM   #26
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
I'm afraid I'm not familiar with this particular rescue environment. I have very limited experience with CentOS and RHEL.

Is the drive/controller detected at all? Does ls /dev/sd* show /dev/sda and its partitions?

And if so, is the partition still intact? fdisk -l should display three partitions: The EFI partition, the /boot partition, and an LVM partition containing / (root), /home and swap. Again, according to your first post.

And how about LVM, does lvdisplay show three logical volumes?
 
Old 09-25-2019, 11:25 AM   #27
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Ser Olmy View Post
I'm afraid I'm not familiar with this particular rescue environment. I have very limited experience with CentOS and RHEL.

Is the drive/controller detected at all? Does ls /dev/sd* show /dev/sda and its partitions?

And if so, is the partition still intact? fdisk -l should display three partitions: The EFI partition, the /boot partition, and an LVM partition containing / (root), /home and swap. Again, according to your first post.

And how about LVM, does lvdisplay show three logical volumes?
/dev/sda does show up, as does its partitions. Other partitions do not, for /dev/sdb.

fdisk -l only shows previous partitions. EFI is on /dev/sda2, and Boot is marked on /dev/sda1. There is no /home nor swap.

I'm past the point of breaking. I have a poor brand of SSD in there. I'm going to rebuild.

Any advice on rebuilding? I don't want legacy. I'm assuming the UEFI only is the good choice. I have two new SSDs coming so I can RAID 5.
 
Old 09-25-2019, 11:55 AM   #28
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,345

Rep: Reputation: Disabled
What about /dev/sda3? Is should show up as an LVM partition.

UEFI vs. legacy is a matter of personal preference. I see no advantages to using UEFI (and a few disadvantages), so I always go with Legacy.

However, I'd highly recommend using GPT instead of MBR. It has superior multi-partition support compared to MBR, and supports partitions larger than 2 Tb and drives larger than 4 Tb.
 
Old 09-25-2019, 12:15 PM   #29
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
Why did you reset the bios to begin with? Maybe that will lend some insight into what is happening.
post the output of
Code:
parted -l
and
Code:
ls /sys/firmware/efi
Code:
I can't even chroot /mnt/sysimage/
did you activate the lvm on partition 3 and mount cento-root on /mnt/sysimage and sda1 on /mnt/sysimage/boot after mounting your root file system?

Last edited by colorpurple21859; 09-25-2019 at 12:16 PM.
 
Old 09-25-2019, 04:05 PM   #30
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by colorpurple21859 View Post
Why did you reset the bios to begin with? Maybe that will lend some insight into what is happening.
post the output of
Code:
parted -l
and
Code:
ls /sys/firmware/efi
Code:
I can't even chroot /mnt/sysimage/
did you activate the lvm on partition 3 and mount cento-root on /mnt/sysimage and sda1 on /mnt/sysimage/boot after mounting your root file system?
Because I needed to get into the BIOS to change the Restart after power outage setting. It was set to Fastboot, and the only way out of that is to reset the CMOS, which killed my ability to boot, for some reason. And as luck would have it, I'm the very first person to do this ever.

I can't paste any feedback. I'm on a completely different machine, and that box is on rescue anaconda. Not sure what you're looking for, but it (parted -l) says /des/sda is a 16 GB Lexar JumpDrive, partition msdos.

Then a Linux device-mapper (linear), at /dev/mapper/live-base, partition table: loop.

Then another with (snapshot) instead of (linear)

ls /sys/firmware/efi:
Code:
config_table
efivars
fw_platform_size
fw_vendor
runtime
runtime-map
systab
vars
Like I said, I can't chroot /mnt/sysimage because:

'/bin/bash': No such file or directory
 
  


Reply

Tags
boot loader, centos7, grub2



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
Any problem if I install CENTOS7 Workstation over CENTOS7 Server? Rich Strebendt Linux - Software 5 05-03-2018 11:05 PM
How to update GRUB2 for dual boot centos7/Ubuntu 14.04.. crocodilehunter Linux - Laptop and Netbook 3 03-19-2016 04:51 PM
dual boot error (UEFI secure boot restricting installing centos7 over windows8) praduman1417 Linux - Newbie 3 12-24-2015 08:55 AM
kcm-grub2 - No valid GRUB2/BURG installation could be detected cristi92b Linux - Newbie 2 06-14-2012 08:01 AM
[SOLVED] GRUB2 after a minor update of GRUB2 /boot prefix no longer needed?? wikapuki Linux - Software 1 10-24-2010 02:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:58 AM.

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