Re: Add a norecovery option to ext3/4?



On Apr 09, 2007, at 11:43:15, Phillip Susi wrote:
Samuel Thibault wrote:
Hi,
Distribution installers usually try to probe OSes for building a suited grub menu. Unfortunately, mounting an ext3 partition, even in read-only mode, does perform some operations on the filesystem (log recovery). This is not a good idea since it may silently garbage data. XFS has a norecovery option that allows to disable that, I'd say ext3/4 should have it too.

When the filesystem is told to mount the disk read only, that means it should not write to it. The fact that ext3 goes ahead and does anyway is a bug and should be fixed. There is no need for a norecovery option, because read only is a sufficient directive to tell the filesystem not to write to the disk.

As someone else pointed out, this behavior causes havoc if you hibernate a system and then boot up another system which mounts the disk of the hibernated system. Under all conditions it should be safe to mount a disk read only, but here it is not because the journal playback trashes the disk out from under the hibernated system.

Well IIRC it is possible to prevent that by switching the blockdev to read-only mode first:

root@ares:~# mount /dev/hda6 /mnt
kjournald starting. Commit interval 5 seconds
EXT3 FS on hda6, internal journal
EXT3-fs: mounted filesystem with ordered data mode
root@ares:~# umount /mnt
root@ares:~# blockdev --setro /dev/hda6
root@ares:~# mount /dev/hda6 /mnt
mount: block device /dev/loop0 is write-protected, mounting read-only
kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode

Cheers,
Kyle Moffett

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [SLE] HOWTO Configure Linux over multiple hard drives
    ... In my experience ext3 was a tad more stable across ... If you want to make the entire suite of disks appear as one disk, ... It would also let the original poster split split the filesystem up, ... various points on the file system should it run out of space. ...
    (SuSE)
  • Re: [SLE] Home made NAS with SUSE - filesystem questions
    ... over this (I currently use Firewire disk), ... Both MD and LVM2 sit below the filesystem and neither are ... XFS and JFS can both be safely grown online, ... the best luck with ext3. ...
    (SuSE)
  • creating filesystem on huge disks
    ... I was wondering if someone could advice on how to create an (ext3) ... filesystem on a huge disk. ... about it - maybe I need to create several partitions and merge them ...
    (Fedora)
  • Re: update
    ... That looks very much like /dev/hda3 either doesn't contain an ext3 ... filesystem or that filesystem is corrupted or the disk is broken. ... Try to boot the system into Linux from CD or somehow else and examine ...
    (comp.os.linux.misc)
  • Weird harddisk behaviour
    ... A couple of weeks ago my 400Gb SATA disk crashed. ... Partition Table for /dev/sda ... # Type Sector Sector Offset Length Filesystem Type Flag ... Superblock backups stored on blocks: ...
    (Linux-Kernel)