Skip to contentSkip to conversation

fs change on read-only mount

DISCUSSION Bgs 2 participants 4 messages Aug 13, 2009

lore
Share & tools
lore

Bgs

author
#0 lore raw

Greetings,

I don't know xfs' superblock handling well enough, so I'm asking for advice here:

Does xfs write anything on the disk when mounting read-only? Is it possible to use a partitions hash (or some well defined portion of the partition) for integrity checks?

The partitions are used read-only and hash would be re-generated if any rw action was done (after remount ro or full reboot of course). Can this be done? I'm concerned about 'mount count' like writes...

Thanks in advance
Bgs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw
Quoted 9 lines · Bgs

Greetings,

I don't know xfs' superblock handling well enough, so I'm asking for advice here:

Does xfs write anything on the disk when mounting read-only? Is it possible to use a partitions hash (or some well defined portion of the partition) for integrity checks?

It should not write anything to disk [1], but older versions did so due to bugs. Doing a hash of a read-only filesystem should be fine.

Quoted 3 lines

The partitions are used read-only and hash would be re-generated if any rw action was done (after remount ro or full reboot of course). Can this be done? I'm concerned about 'mount count' like writes...

There is no mount-count like write in XFS.

[1] the only exception is that log reocvery is performed when we attempt a read-only mount with an unclean log, that is the box crashed while writing the filesystems. To make sure you never do this always mark the underlying device readonly, using blkdev --ro.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

author
#2 lore raw

Thanks for the fast answer.

So the following scenarios should be ok:

1) Normal boot (no crash, previous mount was ro as well, journal empty) -> mount ro from the beginning => partition hash stays the same

2) Mount rw at any point -> make changes -> remount ro -> sync -> create new hash -> next boot with ro mount has this new hash.

Regards
Bgs

Quoted 17 lines · Christoph Hellwig
Quoted 8 lines · Bgs

Greetings,

I don't know xfs' superblock handling well enough, so I'm asking for advice here:

Does xfs write anything on the disk when mounting read-only? Is it possible to use a partitions hash (or some well defined portion of the partition) for integrity checks?

It should not write anything to disk [1], but older versions did so due to bugs. Doing a hash of a read-only filesystem should be fine.

Quoted 3 lines

The partitions are used read-only and hash would be re-generated if any rw action was done (after remount ro or full reboot of course). Can this be done? I'm concerned about 'mount count' like writes...

Quoted 7 lines

There is no mount-count like write in XFS.

[1] the only exception is that log reocvery is performed when we attempt a read-only mount with an unclean log, that is the box crashed while writing the filesystems. To make sure you never do this always mark the underlying device readonly, using blkdev --ro.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 10 lines · Bgs

Thanks for the fast answer.

So the following scenarios should be ok:

1) Normal boot (no crash, previous mount was ro as well, journal empty) -> mount ro from the beginning => partition hash stays the same

2) Mount rw at any point -> make changes -> remount ro -> sync -> create new hash -> next boot with ro mount has this new hash.

Yes.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs