I need to find out what kind of script runs fsck during the boot on CentOS 7?I know that all scenarios are located in /etc/rc.d directory.But I haven't any idea about where is this script is located.
Fsck script location
linux
I know that all scenarios are located in /etc/rc.d directory.What you know is wrong.Welcome to CentOS 7.  The world has changed.  In particular, your base of Red Hat Enterprise Linux 7 has changed.  You are using a systemd Linux operating system.  A lot of the received wisdom about Linux is not true for such systems.fsck is not run by any script at all on systemd Linux operating systems.The native format for systemd is the unit, which can be amongst other things a service unit or a mount unit. systemd's service management proper operates solely in terms of those, which it reads from one of nine directories where (system-wide) .service and .mount files can live.    /etc/systemd/system, /run/systemd/system, /usr/local/lib/systemd/system, and /usr/lib/systemd/system are four of those directories.Your /etc/fstab database is converted into mount units by a program named systemd-fstab-generator. This program is listed in the /usr/lib/systemd/system-generators/ directory and is thus run automatically by systemd early in the bootstrap process at every boot, and again every time that systemd is instructed to re-load its configuration later on.This program is a generator, a type of ancillary utility whose job is to create unit files on the fly, in a tmpfs where three more of those nine directories (which are intended to be used only by generators) are located.  systemd-fstab-generator generates .mount units that mount the volumes.  These in their turn reference .service units that run fsck.Those fsck service units don't themselves exist as files in the filesystem (not even in a tmpfs), and are not the products of a generator.  They are instantiated by systemd from a template service unit file, named systemd-fsck@.service, using the device name as the service unit instance name.  The instantiation happens because of the Requires= and After= references to systemd-fsck@device.service from the generated .mount units.This instantiated template is a service that runs a program named systemd-fsck, which sets up a client-server connection for displaying progress information and then in its turn runs fsck.  systemd-fsck is a compiled C program, not an interpreted script.Further readingNew Features: System and Services.  Red Hat Enterprise Linux 7 Release Notes.  Red Hat.Stephen Wadeley (2014).  8. Managing Services with systemd Red Hat Enterprise Linux 7 System Administrators' Guide.  Red Hat.systemd-fstab-generator. systemd manual pages.  Freedesktop.org.systemd-fsck@.service. systemd manual pages.  Freedesktop.org.systemd.mount. systemd manual pages.  Freedesktop.org.https://unix.stackexchange.com/a/204075/5132https://unix.stackexchange.com/a/196014/5132