-1

I want to do fsck check while booting. my centos, not booting and kernel panic error showing.

so how to use fsck in kernel command line to do a file system check. please do let me know as its urgent.

thanks in advance.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • 3
    I suggest that instead of focusing on how to run a file system check, you should be focusing on the kernel panic, what it means and how to fix the issue leading up to it. There is of course a possibility that the proper solution for the kernel panic you're getting is to run a file system check, but it could also be something entirely different. The Linux kernel is fairly resilient to file system errors and will more typically just print an error and continue running just fine if it can't figure out the metadata of a file system, than crash. – user Nov 25 '18 at 12:17

1 Answers1

4

You don't say which version of CentOS you're using, but both 6 and 7 will do a fsck on reboot if you touch /forcefsck before rebooting.

MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • thanks for the response. but I am not able to login to the server. and the version is 5. so I need to do it from grub boot menu kernel command line. – data centre Nov 24 '18 at 15:22
  • 3
    @datacentre That is an [XY problem](https://meta.stackexchange.com/q/66377/189912). Instead of asking about your problem, you asked about what you thought was the solution (but it probably is not). You should instead ask a question about the real problem you are having. – Michael Hampton Nov 24 '18 at 15:57
  • @datacentre also, don't use unsupported operating systems. – MadHatter Nov 25 '18 at 12:00
  • @datacentre I would advise using an installation media to boot a live CD. From there you can mount the drive and partitions then chroot in and try reinstalling the kernel. It doesn't sound like an FSCK will fix your issue IMO. – Timothy Frew Nov 25 '18 at 12:08