-2

I disabled SELinux and edited the fstab to mount an LVM partition. After that I restart the machine but stuck in this process

enter image description here

The operating system is CentOS 7.3.

Does anyone have same issue and have the solution?

techraf
  • 4,243
  • 8
  • 29
  • 44

4 Answers4

0

SELinux defines the access and transition rights of every user, application, process, and file on the system.

fstab is the place from where system mount the filesystem. So login in the maintenance mode and chek your fstab information, there is a problem.

anand
  • 199
  • 7
  • My FStab configuretion is here : # # /etc/fstab # Created by anaconda on Fri Jul 29 17:13:00 2016 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=2dfbb5e5-1e8c-4d69-bae2-3199b999d800 / xfs defaults 0 0 /dev/vg_gluster/brick1 /bricks/brick1 xfs defaults 0 0 /dev/vg_gluster/brick2 /bricks/brick2 xfs defaults 0 0 Any wrong in the configuration ? – efendimansur Mar 01 '17 at 08:01
  • I think there is still 1-2 partitions missing. If this is the exact fstab info then there would be one more partition for /boot, please have a look into this. Try to login in maintenance mode there you need password, and as you say you cant able to provide password, please refer below url, might help. https://www.howtogeek.com/howto/linux/reset-your-forgotten-ubuntu-password-in-2-minutes-or-less/ – anand Mar 01 '17 at 08:40
  • And if all process failed then try to boot with live cd and mount the OS hdd on any location and check /etc/fstab and update config or revert the changes you made earlier. – anand Mar 01 '17 at 08:49
  • Thank you so mucah @anand. Your suggestion didn't work for me. I think it is for Ubuntu but my machine use CentOS cloud image Ok, I will try to boot from an ISO – efendimansur Mar 01 '17 at 09:20
  • That link was for reference only. Please proceed with mounting, and let us know progress. I have some finding for centos too, have a look in this: https://community.spiceworks.com/how_to/4022-reset-root-password-on-centos-5-6 or, https://dzone.com/articles/reset-root-password-centosred – anand Mar 01 '17 at 09:28
  • Thanks for your help @anand. I did mount the vdisk into another VM and edit the fstab file. I wrong in fstab which is should add disk using UUID. – efendimansur Mar 01 '17 at 11:04
0

Disabling SELinux is unlikely to have caused this, it is though possible that an error in your fstab could cause it.

I would provide the root password and log in. Then check the fstab and take appropriate action to fix or revert.

If you can't get access from this point then restart the system and at the grub menu select recsue mode. That should give you access and allow you to fix teh problem.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • I selected the rescue mode but the console ask the root password for maintenance. Unfortunately password authentication is disabled. Do you have any idea ? – efendimansur Mar 01 '17 at 07:59
  • It should accept the password for maintenance, failing that boot a linux rescue environment from a cd/pendrive/iso – user9517 Mar 01 '17 at 08:13
  • My server is a virtual machine. SSH access only allowed using ssh key and disable root login. I am thinking how to attach a virtual cd into the vm which is running in open stack. – efendimansur Mar 01 '17 at 09:09
  • I don't think you can get to the prompt in your image from ssh. The restriction on root login for ssh should not affect that prompt - try it and see – user9517 Mar 01 '17 at 09:24
0

It seems either your disk has got some issues or there is a typo in your fstab file. Do not put time for selinux as it is irrelevant to this error.

Enter your root password to enter Single User Mode. Then make suer the root filesystem mounted is in read/write mode.

I see from your fstab you have only one root (/) partition and have no separated /boot partition. Make sure your UUID matches to what you have under /dev. In Single User Mode, you can mount the file system manually to see if you get error.

You can also interrupt the automatic boot process and remove any options like "splash", "rhgb" or "quiet" to force the system provide more information during the boot process. You will get more debugging info and hints to solve the issue.

You can post the debug info here then.

Feri
  • 91
  • 2
  • 9
  • I can't login to Single user mode. I didn't know the root password. The server is a VM running on open stack. I provisioned disk automaticly using CentOS cloud image. I think root login is disable and only permitted using ssh-key. The partition is only one as default. I didn't found any parameter such as "spalsh", "rgb" in selected grub – efendimansur Mar 01 '17 at 09:17
0

You're clearly missing the /boot partition from what I saw in your comment, which is always necessary when you use LVM.

Seeing as you don't have the root password, the easiest way I can see you fixing this is by attaching the virtual disk to another virtual system and editing the fstab. Usually, /boot is the first partition, so /dev/vda1, but you can use a partitioning tool to be sure, such as parted or fdisk.

Your MBR should still point to the right place so grub should show up as soon as your fstab is fixed so no need to reconfigure it.

Yuusou
  • 21
  • 4
  • It is not a requirement to have a separate /boot partition when one uses LVM. I’m writing this comment on a system where /boot is in LVM. – user2233709 Mar 15 '17 at 22:12
  • I stand corrected, thank you @user2233709. You can have /boot in LVM if you have GRUB_PRELOAD_MODULES="lvm" in your /etc/default/grub (or equivalent of your distribution). For the specific case of efendimansur and most base installations I know of, I don't believe that's how it's configured. – Yuusou Mar 17 '17 at 09:31