public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs_check refuses to work on readonly fs
@ 2006-08-01 11:55 CN
  2006-08-01 15:39 ` Hedi Berriche
  0 siblings, 1 reply; 3+ messages in thread
From: CN @ 2006-08-01 11:55 UTC (permalink / raw)
  To: xfs

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?

fsck.ext3 works fine given the same sequence of commands for ext3
mounted file system. Did I miss anything with XFS?

Thank you in advance!

CN

-- 
http://www.fastmail.fm - mmm... Fastmail...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfs_check refuses to work on readonly fs
  2006-08-01 11:55 xfs_check refuses to work on readonly fs CN
@ 2006-08-01 15:39 ` Hedi Berriche
  2006-08-02 14:36   ` CN
  0 siblings, 1 reply; 3+ messages in thread
From: Hedi Berriche @ 2006-08-01 15:39 UTC (permalink / raw)
  To: CN; +Cc: xfs

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

Hi,

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

On Tue, Aug 01, 2006 at 14:00 CN <cnliou9@fastmail.fm> 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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: xfs_check refuses to work on readonly fs
  2006-08-01 15:39 ` Hedi Berriche
@ 2006-08-02 14:36   ` CN
  0 siblings, 0 replies; 3+ messages in thread
From: CN @ 2006-08-02 14:36 UTC (permalink / raw)
  To: xfs

Hi! Hedi,

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

Yes. I forgot to mention this.

> | # 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.

I upgraded xfsprogs to 2.8.4 and have tried both approaches you provided
but still have no luck. Only one thing is different: "mount" now reports
"ro" if I edit /etc/mtab as you instructed.

Regards,

CN

-- 
http://www.fastmail.fm - The professional email service

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-02 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-01 11:55 xfs_check refuses to work on readonly fs CN
2006-08-01 15:39 ` Hedi Berriche
2006-08-02 14:36   ` CN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox