I have a device installed with Ubuntu 14.04.5 which has a single hard drive with an ext4 file system.
By reading the document Ext4 Filesystem I learned that the default data mode is
ordered which only protects the metadata. In my project, we want to change it to
journal to also protect file data because the data safety is of higher value.
The first thing I tried was to modify the
/etc/fstab file. I tried to change
UUID=<UUID> / ext4 errors=remount-ro 0 1
UUID=<UUID> / ext4 errors=remount-ro,data=journal 0 1
data=journal to the option field.
However, when I reboot the device, I ended up with an error message saying
cannot change data mode on remount. I checked the
dmesg and saw an earlier message about mounting the drive with
ordered data mode.
For an embarrassingly long time, I thought
/etc/fstab is used to override the default mounting options so the drives are only mounted once. But now it looks wrong: the drive is mounted using its default mount options, then
/etc/fstab is picked up to remount it.
My questions are:
- Is this "mount-remout" process the design of the system? I read the
Fstabwiki page but didn't see it mentions the "mount-remount" thing.
/etc/fstabis truly used for remounting, in which step of the booting process is the drive mounted for the first time? Is it implemented in
/etc/init.d? I did see some scripts in
umountroot, but, skimming their content, they don't look relevant.