0% found this document useful (0 votes)
590 views6 pages

How To Repair Filesystem in Rescue Mode For Red Hat Enterprise Linux

Uploaded by

Lucas Macedo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
590 views6 pages

How To Repair Filesystem in Rescue Mode For Red Hat Enterprise Linux

Uploaded by

Lucas Macedo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux

C U S TO M E R (https://access.redhat.com/)
P O R TA L

How to repair filesystem in rescue mode for Red


Hat Enterprise Linux
$ SOLUTION VERIFIED - Updated 6 de Junho de 2018 às 12:58 - English ()

Environment
Red Hat Enterprise Linux 4
Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6
Red Hat Enterprise Linux 7
EXT and XFS file system
Rescue Mode

Issue
How to repair filesystem in rescue mode for Red Hat Enterprise Linux
System won't load after boot, requests fsck of root file system
/ (root) filesystem going into read-only mode.
How to run repair root file system (on both EXT or XFS )

Resolution
1. Boot the system from the binary DVD or boot disc1 of the same major release as the system.
Once the system has successfully booted from the ISO image and Red Hat Enterprise Linux
boot screen will appear.
For RHEL 5: Type: linux rescue without the quotes, and hit enter at the prompt. Then go
to Step 2.

[F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]

boot: linux rescue

For RHEL6: select Rescue installed system. Then go to Step 2.


For RHEL7: select Troubleshooting, then Rescue a Red Hat Enterprise Linux system. Then go
to Step 4.

https://access.redhat.com/solutions/9541 1/6
11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux

2. When prompted for language, and keyboard, provide the pertinent information for the
C U S TO M E R (https://access.redhat.com/)
system. P O R TA L

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

4. Select: Skip when prompted.

5. If not using LVM, execute the check on the device which contains the filesystem (For ext4
filesystem use e2fsck and for xfs filesystem use xfs_repair ):

Note: please make sure to have a backup of data present in filesystem, before going for
filesystem repair

**For EXT filesystem**


sh-3.1# e2fsck -fv /dev/sda1
e2fsck 1.41.12 (17-May-2010)
[...]

**For XFS filesystem**


sh-3.1# xfs_repair /dev/sda1
[...]

If using LVM, activate the volumes in order to scan them. Perform this task with LVM scans:

https://access.redhat.com/solutions/9541 2/6
11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux

C U S TO M E R (https://access.redhat.com/)
sh-3.1# lvm pvscan

PV /dev/sda1 P OVGR TA
VolGroup00
L lvm2 [96.00 MB / 0 free]
Total: 1 [3.34 GB] / in use: 1 [3.34 GB] / in no VG: 0 [0 ]

sh-3.1# lvm vgscan


Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2

sh-3.1# lvm lvscan


INACTIVE '/dev/VolGroup00/LogVol00' [3.34 GB] inherit

sh-3.1# lvm 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

sh-3.1# lvm vgchange -ay


1 logical volume(s) in volume group "VolGroup00" now active

**For ext filesystem**


sh-3.1# e2fsck -fv /dev/VolGroup00/LogVol00
e2fsck 1.41.12 (17-May-2010)
[...]

**For xfs filesystem**


sh-3.1# xfs_repair /dev/VolGroup00/LogVol00
[...]

If using Software RAID, Initialize the RAID array first:

#mdadm --assemble --scan

Execute fsck on the md device which contains the filesystem:

**For EXT filesystem**


sh-3.1# e2fsck -f /dev/<md device name>
[...]

**For XFS filesystem**


sh-3.1# xfs_repair /dev/<md device name>
[...]

6. Exit the rescue mode and boot the system normally.

https://access.redhat.com/solutions/9541 3/6
11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux

Product(s)Red Hat Enterprise Linux (/taxonomy/products/red-hat-enterprise-linux)


C U S TO M E R (https://access.redhat.com/)
P O R TA L

Component e2fsprogs (/components/e2fsprogs) lvm2 (/components/lvm2)
xfsprogs (/components/xfsprogs)

Category Learn more (/category/learn-more)

Tags ext2 (/tags/ext2) ext3 (/tags/ext3) ext4 (/tags/ext4)

labs_rescuemodeassistant (/taxonomy/tags/labsrescuemodeassistant) read-only (/tags/read-only)

rhel (/tags/rhel) rhel_5 (/tags/rhel_5) rhel_6 (/tags/rhel_6) rhel_7 (/taxonomy/tags/rhel7) xfs (/tags/xfs)

This solution is part of Red Hat’s fast-track publication program, providing a huge library of
solutions that Red Hat engineers have created while supporting our customers. To give you the
knowledge you need the instant it becomes available, these articles may be presented in a raw and
unedited form.

People who viewed this solution also viewed

getting "chroot: cannot run command '/bin/sh': No such file or directory" in rescue
mode

Solution - 21 de fev de 2018

How to create the chroot from Rescue Mode?

Solution - 21 de fev de 2018

How to backup data via network in rescue mode with ssh but without using the systems
root filesystem?

Solution - 27 de jan de 2016

https://access.redhat.com/solutions/9541 4/6
11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux

7 Comments C U S TO M E R (https://access.redhat.com/)

P O R TA L

6 December 2011 5:33 PM (https://access.redhat.com/solutions/9541#comment-336433)


MB Michael Bohler (/user/1686723)
(/user/1686723)
To run a filesystem check I used
COMMUNITY
MEMBER
# fsck.ext3 /dev/mapper/volgroup-logvol-name
29 Points
≤ Reply (/Ajax_comments/Reply/9541/336433)

27 January 2013 9:27 AM (https://access.redhat.com/solutions/9541#comment-456233)


NS NUPCO Support (/user/1175013)
(/user/1175013)
I am agree with Michael Bohler. In my case, I did not used a bootable CD and I have
NEWBIE just use the command:
17 Points # fsck /dev/vg_os/lv_root

Regards,
Baßel

≤ Reply (/Ajax_comments/Reply/9541/456233)

17 April 2013 6:55 PM (https://access.redhat.com/solutions/9541#comment-482103)

Bryan Totty (/user/2174633)


(/user/2174633)
fsck should not be run on a mounted logical volume as it will cause filesystem
RED HAT
corruption. The file system should be unmounted to be performed properly.
GURU

3369 ≤ Reply (/Ajax_comments/Reply/9541/482103)


Points

18 December 2017 2:47 PM (https://access.redhat.com/solutions/9541#comment-1251431)


JU Justin Uhrich (/user/11981263)
(/user/11981263)
fsck and e2fsck keep saying that /var is mounted and aborts. Do you have anything
NEWBIE for this scenario?
7 Points
≤ Reply (/Ajax_comments/Reply/9541/1251431)

18 December 2017 3:02 PM (https://access.redhat.com/solutions/9541#comment-1251481)


AG Alan Gilley (/user/11465833)
(/user/11465833)
RED HAT

https://access.redhat.com/solutions/9541 5/6
11/09/2018 How to repair filesystem in rescue mode for Red Hat Enterprise Linux
NEWBIE
/var is a necessary filesystem and filesystem checks have to be done when the
C U S TO M E R (https://access.redhat.com/)
10 Points filesystem ifPOoffline.
R TA L Ensure that you booted into rescue mode and did not mount

them. You have to do the check on the path to the device or logical volume. So if /var
is located on "/dev/mapper/rootvg-var", for example, you will use that path, not the
mount point which is /var.

≤ Reply (/Ajax_comments/Reply/9541/1251481)

24 April 2018 6:22 PM (https://access.redhat.com/solutions/9541#comment-1297911)


IE Israel Enrique Rivero (/user/19275501)
(/user/19275501)
How to apply these steps in a VM?
NEWBIE

5 Points ≤ Reply (/Ajax_comments/Reply/9541/1297911)

6 June 2018 4:02 PM (https://access.redhat.com/solutions/9541#comment-1314081)


MT Megan Towey (/user/15020641)
(/user/15020641)
These steps would be the same whether they are applied to a physical machine or
RED HAT
virtual machine.
NEWBIE

5 Points ≤ Reply (/Ajax_comments/Reply/9541/1314081)

All systems operational (https://status.redhat.com)

Privacy Statement
(http://www.redhat.com/en/about/privacy-policy)
Customer Portal Terms of Use
(https://access.redhat.com/help/terms/)
All Policies and Guidelines
(http://www.redhat.com/en/about/all-policies-guidelines)
Copyright © 2018 Red Hat, Inc.

https://access.redhat.com/solutions/9541 6/6

You might also like