<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5950</bug_id>
          
          <creation_ts>2014-03-12 06:20:46 +0000</creation_ts>
          <short_desc>Root file system not checked when using systemd</short_desc>
          <delta_ts>2014-03-23 04:45:28 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Liu">net147</reporter>
          <assigned_to name="Jonathan Liu">net147</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>raj.khem</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41117</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2014-03-12 06:20:46 +0000</bug_when>
    <thetext>The root file system is not checked on startup when using systemd because /etc/fstab contains:
rootfs               /                    auto       defaults              1  1

In systemd 210, the following message is shown by journalctl:
systemd-fstab-generator[68]: Checking was requested for &quot;rootfs&quot;, but it is not a device.

If /etc/fstab is corrected to be the proper root filesystem device instead of &quot;rootfs&quot;, then the following message is shown by journalctl:
systemd[1]: Started File System Check on Root Device.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41119</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2014-03-12 06:36:15 +0000</bug_when>
    <thetext>Also, if the &quot;ro&quot; flag is not passed to the kernel to mount the root filesystem readonly on startup, systemd will not run fsck against the root filesystem.

You can verify this by running:
journalctl | grep fsck

If the root filesystem was checked, it should show output similar to:
systemd-fsck[79]: /dev/mmcblk0p2: clean, 2451/967680 files, 227258/7739392 blocks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41341</commentid>
    <comment_count>2</comment_count>
    <who name="Saul Wold">sgw</who>
    <bug_when>2014-03-18 00:53:30 +0000</bug_when>
    <thetext>This is likely an upstream issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41388</commentid>
    <comment_count>3</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2014-03-18 21:55:24 +0000</bug_when>
    <thetext>systemd-fsck presumes that devices are mounted under /dev/ and /sys and the &apos;rootfs&apos;
keyword in /etc/fstab is not known to it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41389</commentid>
    <comment_count>4</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2014-03-18 22:36:02 +0000</bug_when>
    <thetext>I think we have /etc/fstab problem here


root@qemuarm:~# cat /etc/fstab 
rootfs               /                    auto       defaults              1  1
...


&apos;rootfs&apos; is incorrect here. as per /ets/fstab manpages It could either be one of LABEL, UUID or kernel device name and to specify label the syntax is LABEL=... so that option is out and its clearly not uuid or kernel device name.


root@qemuarm:~# ./lsblk -f
NAME FSTYPE LABEL UUID                                 MOUNTPOINT
sda  ext3         9a4ad0c2-3381-4b8c-a03b-26c13fb11f8d /


root@qemuarm:~# cat /proc/cmdline 
root=/dev/sda rw console=ttyAMA0,115200 console=tty ip=192.168.7.2::192.168.7.1:255.255.255.0 mem=128M highres=off  console=ttyS0

since we specify root= in kernel cmdline it finds the boot device but since we also have /et/fstab lying around it gets priority when mounting and when generator is trying to generate systemd units out of it for systemd.mount
it rightly doesnt know about &apos;rootfs&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41390</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2014-03-19 00:17:53 +0000</bug_when>
    <thetext>I replaced rootfs with /dev/root in /etc/fstab and it now checks the root filesystem on startup (using systemd 211).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41457</commentid>
    <comment_count>6</comment_count>
    <who name="Khem Raj">raj.khem</who>
    <bug_when>2014-03-19 22:31:40 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; I replaced rootfs with /dev/root in /etc/fstab and it now checks the root
&gt; filesystem on startup (using systemd 211).

OK thats reasonable, please submit a patch for this change to OE-Core.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41589</commentid>
    <comment_count>7</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2014-03-23 04:45:28 +0000</bug_when>
    <thetext>Fixed by https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e8bc7a136a81a0d8df2d32dfba0920c1b2835141</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>