2

I removed iptables, installed it again and rebooted my centos server ; after that my access to the domains on server has denied. When I checked console There was an error:

fsck.ext4: No such file or directory while trying to open /dev/mapper/vg_servername-lv_root the superblock could not read or does not describe a correct ext2 file system ...

I have tryed yum update to check if there was something removed unwanted update that but when I run this code it says :

Another app is currently holding the yum lock:waiting for it to exit...
The other application is : yum ...

And it waits for a long time doing nothing and keep writing this.
I'm really stocked at this I read some articles in other forums some of them were not this problem and some other did not work or I couldn't understand them.Please.. if anyone can help me with this, I'll be appreciate that.


[UPDATE]
Content of /etc/fstab :

/etc/fstab

Content of /proc/mounts :

/proc/mounts

Content of /proc/partitions :

/proc/partitions


[UPDATE]
Answers to @Ryan Babchishin 's questions:
Does the system fail to boot? no
Are you using a rescue/live CD to gather this information? no I just have console accessibility and all I see is from there.
How did you access the root filesystem?console(vmware vSphare)
Why is the filesystem readonly? I don't know I did just what I said, nothing else.
Did you try a manual fsck?Yes it says the problem that I told at the top of the question.

SAM
  • 123
  • 3
  • 1
    Can you add the content of /etc/fstab, /proc/mounts and /proc/partitions? Add also the output of: `pvs;vgs;lvs` – Mircea Vutcovici Sep 27 '16 at 11:35
  • @Mircea Vutcovici I updated my answer with your requests except the output of: pvs;vgs;lvs That I didn't understand What you mean? – SAM Sep 27 '16 at 12:02
  • 1
    You just need to run them. They will display the LVM volume configuration. – Mircea Vutcovici Sep 27 '16 at 12:39
  • 1
    Your current problem is related to the disk volume configuration. May be a filesystem corruption. I can not see any reason to point to iptables re-installation. I think that the problem just surfaced when you restarted the server. – Mircea Vutcovici Sep 27 '16 at 12:46
  • @Mircea Vutcovici I wrote them in console but It says command not found.Yes the problem appeared just after I restarted the server. – SAM Sep 27 '16 at 13:18
  • @SAM Does the system fail to boot? Are you using a rescue/live CD to gather this information? How did you access the root filesystem? Why is the filesystem readonly? Did you try a manual `fsck`? If this is not a rescue CD or whatever and the system is actually running, then you are missing the `lvm2` and related packages that are required. As for yum, you can expect many things to fail to work properly without read write access to the root filesystem. – Ryan Babchishin Sep 27 '16 at 16:45
  • @Ryan Babchishin I updated my question. – SAM Sep 28 '16 at 10:48

1 Answers1

0

SAM & I worked the problem out in chat...

  1. Boot from CentOS iso in rescue mode
  2. Configure networking
  3. Mount filesystems (on LVM) (from menu, automatic)
  4. chroot to mounted root
  5. Do a yum update - just because
  6. Install missing lvm2 and dependancies
  7. Run vgscan and vgchange -ay - just because
  8. Rebuild initramfs. System froze with no errors before switching to root fs without this step.
  9. Reboot and all is good

The VM runs fine now. No idea how this happened.

Ryan Babchishin
  • 6,160
  • 2
  • 16
  • 36
  • Thank you for your answer.But it's avirtual server and I don't have direct access to server to boot it from disk or anything.Look I'm really not familiar with these stuffs I just know some linux commands.I'm in the situation that only have access to the vSphare client console to write some commands, that's my first and last accessibility.When I write 'vgscan' it says no command found.Also I'm not able to use yum command as I said in the question. – SAM Sep 28 '16 at 00:24
  • If there is any solution for the problem I'll be appreciate that so much you tell me with this level of my knowledge Otherwise I have some important files in DirectAdmin If you tell me how can I zip them and download them as a backup from the console to my computer I'll be thank you so much. – SAM Sep 28 '16 at 00:26
  • @SAM I'll try. Please answer my questions in the comments below your question. – Ryan Babchishin Sep 28 '16 at 00:58
  • @SAM I still need more info. But if the server is running and you have ssh, then you can use scp or sftp or rsync to transfer your files. Or perhaps you can attach your virtual disk to another VM to access the files. – Ryan Babchishin Sep 28 '16 at 02:52
  • I tried this "apt-get install lvm2 dmsetup mdadm reiserfsprogs xfsprogs" to install LVM but it can't find "apt-get" command.I answered your questions in comment;No the system reboots but after that I face this problem and I said I'm not familiar with linux I just did that damn re-installing iptables and after reboot the problem occurred.It looks like your professional;If yoou need me to answer your questions separately I'll do that under your above comment. I'm really in trouble please help me if you can, I'm sure this problem may occur for some other people. – SAM Sep 28 '16 at 10:37
  • @SAM apt-get is for Debian/Ubuntu based distributions. You can only use yum (or rpm). What does `ls -l /dev/mapper/` and `cat /proc/mounts` show you? Also please run `dmesg` and look for anything about disks/lvm/fsck/errors, etc... It's very difficult to debug without logging into the server. – Ryan Babchishin Sep 28 '16 at 13:56
  • @SAM Ok, I tested this out on a Centos 7 VM. I'm going to move this to chat so we can work it out, then I'll update my answer when we've hopefully fixed this issue. – Ryan Babchishin Sep 28 '16 at 13:58
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/46025/discussion-between-ryan-babchishin-and-sam). – Ryan Babchishin Sep 28 '16 at 13:58