View previous topic :: View next topic |
Author |
Message |
quag7 Apprentice
Joined: 12 Aug 2002 Posts: 288 Location: Marana, Arizona - USA
|
Posted: Thu Aug 09, 2007 6:19 am Post subject: Using data=writeback in fstab on / - why read only (ro)? |
|
|
OK, I was trying to speed up my system a bit. I read an article somewhere online today about adding noatime to mounts to avoid a bunch of writes. This made sense. In addition, it talked about another option, data=writeback
Now I've had no problem with noatime and while data=writeback seems to give me no problems on my other partitions, if I apply this in fstab to /, it mounts it as read only, which causes a whole bunch of problems. I have to manually remount the partition as read-write.
(In case anyone is searching on this, simply: mount -o rw,remount /dev/rootdevice / to remount as read-write to fix your fstab)
Why?
From the mount manpage:
Quote: |
data=journal / data=ordered / data=writeback
Specifies the journalling mode for file data. Metadata is
always journaled. To use modes other than ordered on the root
file system, pass the mode to the kernel as boot parameter, e.g.
rootflags=data=journal.
journal
All data is committed into the journal prior to being
written into the main file system.
ordered
This is the default mode. All data is forced directly
out to the main file system prior to its metadata being
committed to the journal.
writeback
Data ordering is not preserved - data may be written into
the main file system after its metadata has been commit-
ted to the journal. This is rumoured to be the highest-
throughput option. It guarantees internal file system
integrity, however it can allow old data to appear in
files after a crash and journal recovery.
|
Why would this force the root filesystem to be mounted as read only? I was able to reproduce this effect on two machines, the Gentoo desktop I'm typing on now, and my Debian fileserver. I'm curious as to what specifically is going on - it's no big loss not to use that option, but I'm a little perplexed as to why it would cause / to mount as read only? _________________ http://www.dataswamp.net |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Thu Aug 09, 2007 6:33 am Post subject: |
|
|
Did you try just putting 'rw' into the options for / yet? Also, did you use tune2fs to set the journal mode for the partition before rebooting? _________________ Thomas S. Howard |
|
Back to top |
|
|
quag7 Apprentice
Joined: 12 Aug 2002 Posts: 288 Location: Marana, Arizona - USA
|
Posted: Thu Aug 09, 2007 6:47 am Post subject: |
|
|
Yes, rw was set in the options column in fstab along with data=writeback. That's why this is perplexing to me.
As for tune2fs, no, I hadn't/haven't done that. I wonder if that was the problem.
However, in the man page for tune2fs:
Quote: |
-o [^]mount-option[,...]
Set or clear the indicated default mount options in the filesys-
tem. Default mount options can be overridden by mount options
specified either in /etc/fstab(5) or on the command line argu-
ments to mount(. Older kernels may not support this feature;
in particular, kernels which predate 2.4.20 will almost cer-
tainly ignore the default mount options field in the superblock.
|
Edit/Addition:
It seems like, in theory, fstab should overwrite whatever I set here with tune2fs anyway. Still, I went ahead and set it with tune2fs, and tune2fs says:
Default mount options: journal_data_writeback
I also added the writeback option back to /etc/fstab. It works! Since in theory fstab should override whatever is set by tune2fs, I'm confused - the only thing I can imagine is that for some reason the hard drive has to be in writeback mode before the boot process gets around to reading fstab.
Nevertheless, it now boots rw correctly, doesn't choke on the fstab option, and tune2fs seems to suggest that it is in writeback mode. _________________ http://www.dataswamp.net
Last edited by quag7 on Thu Aug 09, 2007 7:01 am; edited 1 time in total |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Thu Aug 09, 2007 6:55 am Post subject: |
|
|
Yeah, I did a little checking around and ran across a tip that for the root fs, you might have to use tune2fs in order to enable writeback, in addition to the fstab changes. No explanation about why though. _________________ Thomas S. Howard |
|
Back to top |
|
|
quag7 Apprentice
Joined: 12 Aug 2002 Posts: 288 Location: Marana, Arizona - USA
|
Posted: Thu Aug 09, 2007 7:02 am Post subject: |
|
|
Well thanks for the pointer at any rate - it doesn't exactly answer the question definitively as to why this is so, but at least it has done away with the annoying behavior. Appreciate it! _________________ http://www.dataswamp.net |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|