1

In my desktop I installed redhat 7 and after reboot it went to maintenance mode, After entering the password it is not allowing to do a file system scan for root and every time it boots enters to maintenance mode and not allowing to run xfs_repair command which is showing error as it is mounted.

    # xfs_repair /dev/mapper/rhel-root 
    xfs_repair: /dev/mapper/rhel-root contains a mounted and writable filesystem.

    fatal error -- couldn't initialize XFS library.

I tried to execute same command on other file systems which are not mounted and it is working fine.

Please help me.

3 Answers 3

3

You can at least find out what's wrong by running:

xfs_repair -n /dev/mapper/rhel-root

-n runs xfs_repair in no-modify mode.

If it's complaining about it being mounted and writeable, you might want to try re-mounting it read-only (mount -r -o remount <device>), but this will probably just come back with '/dev/mapper/rhel-root is busy'.

I'd go with booting from a different medium and running xfs_check from there.

1
  • 2
    I tried all these but no luck, XFS always it is saying the file system is mounted even in RO/RW. Commented Nov 28, 2014 at 4:22
1

Boot from some live medium and perform the xfs_repair from there.

1
  • So is there no direct way to get it done Commented Nov 20, 2014 at 12:28
1

Boot into Emergency mode in which root-fs will be mounted as read-only. For this, add

systemd.unit=emergency.target

to the kernel parameters in GRUB when booting. After this you would be able to run:

xfs_repair -d /dev/mapper/your-root-fs

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.