LinuxQuestions.org
Review your favorite Linux distribution.
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, 04:05 PM   #31
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 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.
This is a server. It has 120 GB drives which are overkill.
 
Old 09-25-2019, 04:36 PM   #32
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
Like I said, I can't chroot /mnt/sysimage because:

'/bin/bash': No such file or directory
The root fs on this server resides inside an LVM volume.

When you're in the rescue environment, is LVM even activated? What does ls /dev/mapper/ show?

What's the output of pvdisplay, vgdisplay, and lvdisplay?

It seems /mnt/sysimage is supposed to contain a mounted filesystem representing the root fs of the server. Is that the case? If not, then it's no wonder you can't chroot into it.

That's easily fixed, though: You just have to activate the volume group, mount the root fs to /mnt/sysimage, mount /dev/sda2 (the boot partition) to the now available directory /mnt/sysimage/boot, then chroot into /mnt/sysimage and finally mount /sys and /proc manually.

Last edited by Ser Olmy; 09-25-2019 at 04:38 PM.
 
Old 09-25-2019, 04:57 PM   #33
BeeRich
Member
 
Registered: Mar 2009
Location: Toronto, Canada
Distribution: CentOS7.something
Posts: 70

Original Poster
Rep: Reputation: 0
ls /dev/mapper/

Code:
control
live-base
live-rw
pvdisplay
nothing returned

lvdisplay
nothing returned

Yes, like I've been saying, upon loading the rescue OS, it can't see any image to repair. "No Linux partitions" All that grub2 work killed things that rendered this a bunch of files instead of a recognizable OS.

So you say I have to:

- activate the volume group
- mount the root fs to /mnt/sysimage
- mount /dev/sda2 boot partition to the directory /mnt/sysimage/boot
- chroot into /mnt/sysimage
- mount /sys
- mount/proc

I have no idea how to do any of those. So not easily fixed. Resetting the CMOS to get back into the BIOS was a bit much if you ask me.
 
Old 09-25-2019, 05:53 PM   #34
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
Not sure what you're looking for, but it (parted -l) says /des/sda is a 16 GB Lexar JumpDrive, partition msdos.
that is probably the rescue usb, you mentioned in your orginal post. There was no mention of any other drives?
 
Old 09-25-2019, 06:16 PM   #35
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
So you say I have to:

- activate the volume group
vgchange -ay --ignorelockingfailure

You may not need the last parameter.

If nothing happens, try running pvscan and then vgscan, then try again.
Quote:
Originally Posted by BeeRich View Post
- mount the root fs to /mnt/sysimage
mount /dev/mapper/<something-or-other>centos-root /mnt/sysimage

Not exactly sure what the full name of the activated volume will be (except it will contain "centos-root") since I don't know the name of the Volume Group, but ls /dev/mapper/ should display it.
Quote:
Originally Posted by BeeRich View Post
- mount /dev/sda2 boot partition to the directory /mnt/sysimage/boot
mount /dev/sda2 /mnt/sysimage/boot
Quote:
Originally Posted by BeeRich View Post
- chroot into /mnt/sysimage
chroot /mnt/sysimage
Quote:
Originally Posted by BeeRich View Post
- mount /sys
- mount/proc
mount -t proc proc /proc
mount -t sysfs sysfs /sys

Quote:
Originally Posted by BeeRich View Post
I have no idea how to do any of those.
You do now.
Quote:
Originally Posted by BeeRich View Post
So not easily fixed.
Who knows. It might be.

Last edited by Ser Olmy; 09-25-2019 at 06:17 PM.
 
Old 09-25-2019, 08:26 PM   #36
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
When you get back into you system,
Code:
dnf install grub2-efi-x64-modules
 
Old 09-25-2019, 09:12 PM   #37
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
Quote:
Not sure what you're looking for, but it (parted -l)
It will look something like this, but the sizes will be different and sda,sdb may be reversed.
Code:
parted -l

Disk /dev/sda: 32GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  316MB   315MB   fat16                 esp
 2      316MB   317MB   1049kB   ext4                 boot
 3      2938MB  32.9GB  30.0GB                        lvm

Model:  USB Flash Drive (scsi)
Disk /dev/sdb: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.7GB  15.7GB  primary  fat32        boot, lba
I mainly want to know if the partition table is gpt or msdos, if any disk flags are set, files system for each partition and flags for each partition

Last edited by colorpurple21859; 09-26-2019 at 05:25 AM.
 
Old 09-26-2019, 08:40 AM   #38
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
vgchange -ay --ignorelockingfailure

You may not need the last parameter.

If nothing happens, try running pvscan and then vgscan, then try again.
- Nothing happened
- No matching physical volume found (pvscan)
- Reading volume groups from cache (vgscan)

Then nothing again, both without and with that last parameter.
 
Old 09-26-2019, 08:41 AM   #39
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
It will look something like this, but the sizes will be different and sda,sdb may be reversed.
Code:
parted -l

Disk /dev/sda: 32GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name  Flags
 1      1049kB  316MB   315MB   fat16                 esp
 2      316MB   317MB   1049kB   ext4                 boot
 3      2938MB  32.9GB  30.0GB                        lvm

Model:  USB Flash Drive (scsi)
Disk /dev/sdb: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.7GB  15.7GB  primary  fat32        boot, lba
I mainly want to know if the partition table is gpt or msdos, if any disk flags are set, files system for each partition and flags for each partition
Only sda shows up, and it's msdos. Sorry, no flags at all.

Last edited by BeeRich; 09-26-2019 at 08:49 AM.
 
Old 09-26-2019, 09:03 AM   #40
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
- Nothing happened
- No matching physical volume found (pvscan)
- Reading volume groups from cache (vgscan)

Then nothing again, both without and with that last parameter.
"Nothing" may be OK, but the "no matching physical volume" message definitely isn't something I'd expect to see on a system using LVM.

If LVM is active, there should be links in /dev/mapper to the various volumes, but if LVM can't activate the volume group(s), the directory will only contain the character device "control". What does ls /dev/mapper/ show?

Is /dev/sda3 present, and is it an LVM partition? Please post the output from fdisk -l /dev/sda.
 
Old 09-26-2019, 09:15 AM   #41
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
"Nothing" may be OK, but the "no matching physical volume" message definitely isn't something I'd expect to see on a system using LVM.

If LVM is active, there should be links in /dev/mapper to the various volumes, but if LVM can't activate the volume group(s), the directory will only contain the character device "control". What does ls /dev/mapper/ show?

Is /dev/sda3 present, and is it an LVM partition? Please post the output from fdisk -l /dev/sda.
ls /dev/mapper:
control
live-base
live-rw

/dev/sda3 is nor present, just sda1 (boot), and sda2 (EFI)
 
Old 09-26-2019, 09:21 AM   #42
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Quote:
Originally Posted by BeeRich View Post
/dev/sda3 is nor present, just sda1 (boot), and sda2 (EFI)
Then you don't have access to the LVM Volume Group and the Logival Volumes contained therein, which means you don't have a root filesystem to mount.

So where did your LVM/root partition go? If it's been accidentally deleted, it should be pretty easy to recreate it.

Could you please post the full, unedited output from fdisk -l /dev/sda and fdisk -l /dev/sdb?
 
Old 09-26-2019, 09:41 AM   #43
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
Then you don't have access to the LVM Volume Group and the Logival Volumes contained therein, which means you don't have a root filesystem to mount.

So where did your LVM/root partition go? If it's been accidentally deleted, it should be pretty easy to recreate it.

Could you please post the full, unedited output from fdisk -l /dev/sda and fdisk -l /dev/sdb?
I have absolutely no clue.

$ fdisk -l /dev/sda

Disk /dev/sda: 8086 MB, 8086618112 bytes, 15794176 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimal/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier 0x4e2780e2

Device Boot Start End Blocks Id System
/dev/sda1 * 0 1929215 964608 0 Empty
/dev/sda2 444 17851 8704 ef EFI (FAT-12/16/32)


$ fdisk -l /dev/sdb
fdisk: cannot open /dev/sdb: No such file or directory
 
Old 09-26-2019, 10:31 AM   #44
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
Oh, I see; the drive we've been dealing with all this time is actually the 8 Gb USB stick you've been using to boot the system. And of course this is using EFI.

No wonder the LVM subsystem found no volumes; all this time we've been barking up the wrong tree. No worries, we'll just have to take a step back and try again.

The first question is: Where are your drives? It seems really odd that a CentOS-based rescue system would be unable to detect an AHCI disk controller.

See what the kernel log has to say about disk controllers and drives, and post the results: dmesg | grep "ata\|scsi"

Every supported disk controller is registered as a scsi controller, and there vill be a message saying something like "scsi host0: Fusion MPT SAS Host" (the last part will identify your actual hardware). Then there will be an "atax.yy" entry for every detected SATA drive, something like this: "ata2.00: ATA-8: HGST HTS721010A9E630, JB0OA3J0, max UDMA/133".

Also post the output from lspci as it will show the actual hardware present in your server. It should then be pretty straightforward to identify the disk controller and figure out what we have to do to load the requisite modules and have the drives show up.
 
Old 09-26-2019, 10:33 AM   #45
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
The internal drive isn't showing up. Either the drive died or a setting in the bios is wrong. Do you have an option in bios settings to restore defaults? If so, recommend trying that
 
  


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 01:48 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