"data=writeback" in fstab mounts root partition as "read-only"
Goal: Use ext4 (faster than ext2) but completely remove "journaling" (not secure for sensitive data destruction - shred/wipe, etc...)
Exact same fresh install on Debian Squeeze works perfectly. On fresh Wheezy install (kernel 3.0), including "data=writeback" for the / partition causes it to mount read-only, which prevents mounting of other partitions, causing loss of Xserver (drops to shell). Taking "data=writeback" off the / partition but leaving it in for /boot and /home partitions and everything mounts just fine. Put the option back on / = read-only. Take it off = mounts fine. Steps taken: 1. (live CD) Use cfdisk to cut up the drive 2. do: mke2fs -t ext4 -O ^has_journal /dev/sdaX (root) 3. do: tune2fs -O ^has_journal /dev/sdX 4. do: tune2fs -o journal_data_writeback /dev/sdX 5. in /etc/default/grub: GRUB_CMDLINE_LINUX="rootflags=data=writeback" -> update-grub2 6. edit /etc/fstab (for all partitions). ( / options) errors=remount-ro,noatime,nodiratime,data=writeback,barrier=0 (mounts "read-only") I've read dozens of threads and everything points to "tune2fs -o journal_data_writeback /dev/sdX" solving the issue. I believe I've done all the steps correctly, yet still unable to mount root. Thank you for the help |
Quote:
Quote:
Code:
data=writeback Data ordering is not preserved, data may be written Code:
errors=remount-ro Remount the filesystem read-only on an error. |
Quote:
Code:
] EXT4-fs (sda2): Cannot change data mode on remount sda3 = home -> mounts fine with data=writeback (if same option is taken out of 'root' but left in for these two. sda4 = Vbox -> mounts fine with data=writeback Maybe that's where the conflict is?!? Formatting with mke2fs -O ^has_journal followed by tune2fs -O ^has_journal accomplishes removing the journalling option and then 'data=writeback' conflicts in fstab??? Is there a command to see / verify if ext4 is journaling or not? |
This bit me awhile ago. Change the default filesystem mount options in the filesystem itself.
Code:
# tune2fs /dev/sda2 -o journal_data_writeback |
Quote:
With all the try-this and try-that, now I can't reproduce EXT4-fs (sda3): mounted filesystem without journal in 'dmesg'. Is there a way to verify that the system is mounted and is, in fact, running without journaling? Thanks. |
Make fstab and the superblock match. You can tune2fs -l to check whether the filesystem features include has_journal.
|
conclusion...
I just want to clarify a few things (for my sake) before marking the thread "solved".
From tune2fs manpages: -O [features] tune2fs -O ^has_journal /dev/sdX -> Turns journalling OFF journal_data_writeback - This mount option does write to journal. "When the filesystem is mounted with journalling enabled..." (Therefore, if journalling is turned off using the -O switch, then this mount option does not apply) /etc/fstab - "Default mount options can be overridden by mount options specified in /etc/fstab..." (Putting journalling options in /etc/fstab (in this case - simply turning journaling off) is not necessary) Conclusion: To completely turn off journalling in ext4, all that's required is command: tune2fs -O ^has_journal /dev/sdX Using tune2fs -o journalling_data_writeback (mount option) and using "data=writeback" option in /etc/fstab as reported in so many threads regarding this issue is simply not required and might, in fact, be erroneous (correct?) To verify whether journalling is turned off do: tune2fs -l /dev/sdX. Next to "Filesystem Features" - if 'has_journal' does not appear, then journalling has been turned off Please let me know if anything here is incorrect or missing and I will update it, so there is no more confusion. Thank you all for your help. |
In my experience, for something like this, "correct" is what works, the man pages tell you what to try. The man pages didn't warn you about the superblock-consistency requirement for ext4, for instance.
Frankly, a no-journal filesystem scares the crap out of me. Why Do That? Just run data=writeback,commit=600 (edit: should have been more explicit - only data=journal journals your data. nothing else does. my source on that: the filesystem author's documentation on it in the kernel source, Documentation/fs/ext4.txt. Anyway I wonder what kind of hardware and workload make zero-before-rm cheaper or safer than encrypt-it-in-the-first-place. |
All times are GMT -5. The time now is 07:18 PM. |