Wil Reichert <wil.reich...@gmail.com> posted 7a329d910904282211wc8fa1a4ya40de3686c248...@mail.gmail.com, excerpted below, on Tue, 28 Apr 2009 22:11:54 -0700:
> Seems root mounts get special treatment as well. Compare my / & /opt - > both ext4, both created identically & mounted with just noatime: > > /dev/vg/root on / type ext4 (rw,noatime,barrier=1,data=ordered) > /dev/mapper/vg-opt on /opt type ext4 (rw,noatime) > > Or perhaps its just more verbose since like Duncan said data=ordered is > the default & barriers are currently disabled on lvm. The thing with root is that it must be originally mounted before fstab is accessible (with possible modifications for any userland config in the initramfs/initrd). Kernel and fstuning defaults apply, but little else. I do know it's possible to change the rw/ro bit on the kernel command line (so from grub or whatever) and that's reasonably commonly done, but not much else. It's also worth noting that some filesystems, xfs I know is one, aren't as flexible with the remount options as they are with the initial mount options. Thus, if these options aren't setup as desired on original mount, they don't get setup as desired period, because the remount can't change them. (I'm not sure how many filesystems, beyond xfs as mentioned, have such inflexible remounts.) At least some modules have additional options that can be passed either on-load or if built-in, on the kernel command line. However, I'm not entirely sure how flexible that is and whether the kernel command line can handle rootfs mountopts beyond rw/ro. Additionally, get the command line too long and it becomes difficult to manage. Of course it's much easier from 2.6.29 or was it .28, with the addition of a compiled-in command line, it was sure nice seeing a clean kernel-filename-only default kernel command line in grub again! Thus, using whatever fstun app ships with the maintenance utils for your choice of fs to set sane defaults is quite useful. In fact, it's worth noting the reduced line length benefits apply to the options field in fstab (and hal's fdi files too) as well as to the kernel command line, for filesystems other than root, loaded from userspace. Talking about which... I think I'll have to lookup reiserfstune again, and see if I can set some of my mount options as default. Since on reiserfs a standard mount and journal playback does almost as much as a normal fsck would (beyond that, there's --rebuild-tree, but that's a drastic measure not recommended for normal use), I toyed with mounting the rootfs as read/write at initial kernel mount time, instead of the normal read-only, then remount. But then I noticed it was doing atime updates because doing it that way skipped the remount, which added all my normal mount options (including noatime) while doing the remount. So I went back to doing it the traditional way, feed ro at the kernel command line and let it get remounted. (It doesn't take much longer that way, after all, as long as the fsck field is set to 0 in ordered to skip it, since the mount process itself does almost exactly the same thing on reiserfs.) If reiserfstune can handle stuff like noatime by default, that'll clear quite a bit out of my fstab as well as allowing me to go back to mounting root rw from the kernel command line. =:^) Unfortunately, if memory serves, it's not quite that flexible and doesn't allow one to set mount-option defaults, only filesystem internal details (side/location of the log, etc), with the fs label being perhaps the only externally visible exception. =:^( -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman