On 02/14/14 at 10:41am, Dave Young wrote:
On 02/13/14 at 10:13am, Vivek Goyal wrote:
> On Wed, Feb 12, 2014 at 03:38:10PM +0800, Dave Young wrote:
>
> [..]
> > For another issue as you mentioned for remount,rw for rootfs. fsck will
> > refuse to continue if it's already mounted. It's always sugested to
> > fsck before mounting unless using '-f'.
> >
> > Chao has veryfied that latest RHEL7 has pulled in changes from upstream
> > systemd that will add fsck functionality for rootfs in initramfs so we
> > do not need worry about it.
>
> So are you saying that systemd now is running fsck on root filesystem
> in initramfs before monting it read only?
>
> In last mails chao had mentioned that systemd does not run fsck on
> root filesystem in initramfs. So that has changed since then?
Will leave this to Chao. Chao, could you help answer this question
Running fsck on root fs in initrd is introduced in systemd-208.
Currently RHEL7 is using systemd-207.
And then I find systemd-208 in our brew build:
http://download.eng.bos.redhat.com/brewroot/packages/systemd/208/
It seems it's rebased v208, however I'm not sure when v208 will
be pulled into RHEL-7.0 build.
This change is introduced in commit 7f5806d:
# git describe 7f5806d7
v208-164-g7f5806d
commit 7f5806d
Author: Thomas Bächler <thomas(a)archlinux.org>
Date: Mon Sep 30 00:32:33 2013 +0200
fstab-generator: When parsing the root= cmdline option, set FsckPassNo to 1
[tomegun: without this we would never fsck the rootfs if it was directly
mounted 'rw' from the initrd. We now risk fsck'ing it twice in the case
it
is mounted 'ro', so that should be addressed in a separate patch.]
diff --git a/src/fstab-generator/fstab-generator.c
b/src/fstab-generator/fstab-generator.c
index 9e7d55d..a7536f8 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -442,7 +442,7 @@ static int parse_new_root_from_proc_cmdline(void) {
}
log_debug("Found entry what=%s where=/sysroot type=%s", what, type);
- r = add_mount(what, "/sysroot", type, opts, 0, noauto, nofail, false,
+ r = add_mount(what, "/sysroot", type, opts, 1, noauto, nofail, false,
SPECIAL_INITRD_ROOT_FS_TARGET, "/proc/cmdline");
return (r < 0) ? r : 0;
--
Thanks
WANG Chao