xfs
[Top] [All Lists]

Re: xfs_check refuses to work on readonly fs

To: CN <cnliou9@xxxxxxxxxxx>
Subject: Re: xfs_check refuses to work on readonly fs
From: Hedi Berriche <hedi@xxxxxxxxxxxxxx>
Date: Tue, 1 Aug 2006 16:39:51 +0100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1154433320.2160.267361956@webmail.messagingengine.com>
References: <1154433320.2160.267361956@webmail.messagingengine.com>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.11+cvs20060403
Hi,

Based on the info you provided I infer that you're running Linux.

On Tue, Aug 01, 2006 at 14:00 CN <cnliou9@xxxxxxxxxxx> wrote:
| Hi!
|
| # init 1
| # mount -o ro,remount /
| # mount
| /dev/hda1 on / type xfs (rw)
| # xfs_check /dev/hda1
| xfs_check: /dev/hda1 contains a mounted and writable filesystem
|
| xfs_check/xfs_repair are willing to work only when I boot from a disk
| and check/repair the other unmounted disk.
|
| Why "mount" shows (rw) instead of (ro) even "mount -o ro,remount /" is
| issued?

Because mount is relying on /etc/mtab which couldn't be updated
precisely because / was remounted ro.

You'll need a recent xfsprogs version, at least 2.7.17 IIRC, one
that uses that uses /proc/mounts instead of /etc/mtab to check
filesystem status.

Or you can use a dirty and quick hack

    - prior to remounting ro, edit /etc/mtab and change the root fs entry from
    rw to ro.
    - remount ro
    - run your xfs_check/xfs_repair in dangerous mode.

FWIW the safe thing to do after a repair on a mounted root FS is to reboot.

Cheers,
Hedi.

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>