• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Recover Corrupted Root Partition from Rescue Mode in CentOS/RHEL 5,6

By admin

This post provides step-by-step instruction on how to recover the corrupted root filesystem. Booting up the server fails with corrupted the root filesystem as shown below.

Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a /dev/VolGroup00/LogVol00
/dev/VolGroup00/LogVol00 contains a file system with errors, check forced.
/dev/VolGroup00/LogVol00: Inodes that were part of a corrupted orphan linked list found.

/dev/VolGroup00/LogVol00: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
[FAILED]

*** An error occurred during the file system check.
*** Dropping you to a shell; the system will reboot
*** when you leave the shell.
Give root password for maintenance

The error indicates the root filesystem is corrupted. And to recover the corrupted root filesystem, please follow the steps below:

1. Boot the system from the DVD of the same major release as the system. Once the system has successfully booted from the ISO image and boot screen will appear. Type: “linux rescue” without the quotes, and hit enter at the prompt.

boot: linux rescue

2. When prompted for language, and keyboard, provide the pertinent information for the system.

3. When prompted to enable the network devices on the system, select: No

4. Select: Skip when prompted to allow the rescue environment to mount Oracle Linux installation under /mnt/sysimage directory.

5. If not using LVM, execute fsck on the device which contains the filesystem:

# e2fsck -f /dev/sda1 
e2fsck 1.41.12.14 (17-May-2014)
[...]

6. If using LVM, activate the volumes before running fsck.

# pvscan
PV /dev/sda1 VG VolGroup00 lvm2 [96.00 MB / 0 free]
Total: 1 [3.34 GB] / in use: 1 [3.34 GB] / in no VG: 0 [0 ]
# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
# lvscan
INACTIVE '/dev/VolGroup00/LogVol00' [3.34 GB] inherit
# lvdisplay 

--- Logical volume --- 
LV Name /dev/VolGroup00/LogVol00 
VG Name VolGroup00 
LV UUID 335qTi-Ossg-32O5-yQC7-xNON-egdI-frj4et 
LV Write Access read/write 
LV Status NOT available 
LV Size 3.34 GB 
Current LE 107 
Allocation inherit 
Read ahead sectors 0
# vgchange -ay
1 logical volume(s) in volume group "VolGroup00" now active
# e2fsck -f -y /dev/VolGroup00/LogVol00
e2fsck 1.41.12.14 (17-May-2014)
[...]

7. Exit the rescue mode, remove the DVD or boot disc media, then boot the system normally.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, Linux

Some more articles you might also be interested in …

  1. How to Disable Docker Process and docker0 Interface on CentOS/RHEL
  2. Linux OS service ‘nfs’
  3. How To Force User/Group Ownership Of Files On A Samba Share
  4. CentOS / RHEL : How To Shrink LVM Root File System
  5. How to Change Time Interval to Fall Back to Secondary DNS Server in CentOS/RHEL
  6. What are Bash Exit Codes in Linux
  7. Common Error Messages from Command xfs_repair in Linux
  8. ‘lxc_cgfs – Device or resource busy – failed to set memory.use_hierarchy to 1; continuing’ – error while starting LXC container
  9. How to enable or disable service on boot with chkconfig
  10. How to verify the integrity of a file with md5 checksum

You May Also Like

Primary Sidebar

Recent Posts

  • How to Configure Automatic Package Updates on the Server in CentOS/RHEL 8
  • FATAL: Error inserting rds_rdma
  • Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
  • How To Add Timestamps To dmesg Kernel Boot Log in CentOS/RHEL
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary