Risk of filesystem corruption with ext3 in lucid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Expired
|
Medium
|
Unassigned |
Bug Description
On my system, a default ext3 mount (no fstab entry) results in:
$ cat /proc/mounts
/dev/sda6 /media/space ext3 rw,nosuid,
We can see the "barrier=1" option is missing by default, which can cause severe filesystem corruption in case of power failure (i've been hit recently). Quoting mount(1):
"barrier=0 / barrier=1
This enables/disables barriers. barrier=0 disables it, barrier=1 enables it. Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. The ext3 filesystem does not enable write barriers by default. Be sure to enable barriers unless your disks are battery-backed one way or another. Otherwise you risk filesystem corruption in case of power failure."
the issue is fixed in later kernels (precise 3.2.0-35 is not affected), but lucid users are left to suffer the consequences of this horrifying default.
$ uname -a
Linux netbook 2.6.32-45-generic #101-Ubuntu SMP Mon Dec 3 15:41:13 UTC 2012 i686 GNU/Linux
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
summary: |
- by default ext3 is mounted without barrier=1 in lucid + Risk of filesystem corruption with ext3 in lucid |
/etc/fstab can be used as temporary workaround to force barrier=1 :
$ sudo umount /media/space 1,rw,nosuid, nodev,uhelper= udisks 0 0
$ sudo mkdir /media/space
and add an entry to /etc/fstab like:
/dev/sda6 /media/space ext3 barrier=