Recover from emergency mode on Centos 7

 CentOS 7 may enter emergency mode if there are issues with the file system or the system fails to boot correctly. To recover from emergency mode, you can follow these steps:


1. **Check the File System**:


   First, you need to check the file system for errors. Run a file system check (fsck) on the root file system:


   ```bash

   fsck /dev/mapper/centos-root

   ```


   Replace `/dev/mapper/centos-root` with the appropriate device for your root file system. You can find this information by running `lsblk` or `df -h`.


2. **Remount the File System**:


   After running `fsck`, remount the file system in read-write mode:


   ```bash

   mount -o remount,rw /

   ```


3. **Check Disk Space**:


   Verify that you have enough disk space. Use `df -h` to check the available disk space on your partitions.


4. **Examine Journal Logs**:


   Check the systemd journal logs to identify any errors:


   ```bash

   journalctl -xb

   ```


   This command will display recent system logs, and you can scroll through them to look for any errors that might have caused the system to enter emergency mode.


5. **Fix the Issue**:


   Based on the error messages and logs you find, take appropriate actions to fix the issues. This might include fixing configuration files, resolving disk space problems, or repairing file system errors.


6. **Reboot the System**:


   Once you have fixed the issues causing the emergency mode, you can try to reboot your system:


   ```bash

   reboot

   ```


   Your system should attempt to boot normally. If you've addressed the underlying problems, it should boot successfully.


If the issue persists or you're unable to fix the problems, consider seeking professional help or consulting your system administrator. Additionally, take necessary backups before making any major changes to your system.

Comments

Popular posts from this blog

bad character U+002D '-' in my helm template

GitLab pipeline stopped working with invalid yaml error

How do I add a printer in OpenSUSE which is being shared by a CUPS print server?