On Tue, Feb 24, 2009 at 6:33 PM, John Robinson <john.robinson@xxxxxxxxxxxxxxxx> wrote: > On 23/02/2009 20:16, NeilBrown wrote: >> >> On Tue, February 24, 2009 6:53 am, Doug Ledford wrote: >>> >>> Is XFS the only one that does the journal recovery on initial mount >>> read-only during the initfs step, or do other journaled fses do the same >>> thing? I didn't think ext3 recovered the journal until you switch to a >>> read-write mount, but I guess I could be wrong. >> >> This from fs/ext3/super.c >> >> if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_RECOVER)) { >> if (sb->s_flags & MS_RDONLY) { >> printk(KERN_INFO "EXT3-fs: INFO: recovery " >> "required on readonly >> filesystem.\n"); >> if (really_read_only) { >> printk(KERN_ERR "EXT3-fs: write access " >> "unavailable, cannot proceed.\n"); >> return -EROFS; >> } >> printk (KERN_INFO "EXT3-fs: write access will " >> "be enabled during recovery.\n"); >> } >> } >> >> suggests that, unfortunately, you are. > > Presumably it's not only me that thinks this is insane? If I want to mount a > filesystem read-only, I expect it to be mounted read-only; perhaps I already > know it's damaged, or know the journal's damaged... > > I guess I can see the journal recovery normally being the right thing, and > it is the filesystem we asked to have read-only not the disc, but still > there surely has to be a way of saying mount without journal recovery, or > mount without writing to disc, or both, and if there isn't who do I ask to > implement it? (I'm way too rusty as a coder to trust myself to get it even > half right.) > > I wonder: in the case of ext3 can I mount it as ext2 and thereby have the > journal ignored rather than recovered? And would this be sufficient for the > initrd context? > > Cheers, I'm most familiar with xfs. It has a norecovery flag you can use with mount. I believe it was introduced many years ago because LVM snapshots at the time were truly read-only and it was not possible to replay portions of the journal in order to mount a filesystem. I would assume all filesystems received similar enhancements? Less critical today because device mapper supports read/write snapshots. Unfortunately, per the mount man page I only see that xfs has the specific flag I'm talking about. Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html