<?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>15523</bug_id>
          
          <creation_ts>2024-06-19 19:49:26 +0000</creation_ts>
          <short_desc>wic cp corrupts ext4 journal</short_desc>
          <delta_ts>2024-06-21 08:25:17 +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>devtools / tool chain</component>
          <version>4.0.20</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NOTABUG</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>5.1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Thomas Roos">thomas</reporter>
          <assigned_to name="Thomas Roos">thomas</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>99230</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2024-06-19 19:49:26 +0000</bug_when>
    <thetext>When copying files into a ext4 partition in an image it seems that the journal is getting corrupt.

When booting I see errors like this, and sometimes the files are just not there despite &quot;wic ls&quot; did show them.
ext4_lookup:1857: inode #2: comm ls: deleted inode referenced:

Workaround (to fix the journal is to do this after copying)
sync
e2fsck -y tmp/deploy/images/qemuarm64/image-qemuarm64.ext4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99235</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-06-20 14:51:42 +0000</bug_when>
    <thetext>That workaround feels reasonable enough, can you send a patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99240</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2024-06-21 08:25:17 +0000</bug_when>
    <thetext>Sorry for the noise - could not reproduce it.
Here is a snipplet of my idea to disable journal - but hence it disappeared I close the bug.

diff --git a/scripts/lib/wic/engine.py b/scripts/lib/wic/engine.py
index 674ccfc244..03cd508386 100644
--- a/scripts/lib/wic/engine.py
+++ b/scripts/lib/wic/engine.py
@@ -280,7 +280,7 @@ class Disk:
     def __getattr__(self, name):
         &quot;&quot;&quot;Get path to the executable in a lazy way.&quot;&quot;&quot;
         if name in (&quot;mdir&quot;, &quot;mcopy&quot;, &quot;mdel&quot;, &quot;mdeltree&quot;, &quot;sfdisk&quot;, &quot;e2fsck&quot;,
-                    &quot;resize2fs&quot;, &quot;mkswap&quot;, &quot;mkdosfs&quot;, &quot;debugfs&quot;,&quot;blkid&quot;):
+                    &quot;resize2fs&quot;, &quot;tune2fs&quot;, &quot;mkswap&quot;, &quot;mkdosfs&quot;, &quot;debugfs&quot;,&quot;blkid&quot;):
             aname = &quot;_%s&quot; % name
             if aname not in self.__dict__:
                 setattr(self, aname, shutil.which(name, path=self.paths))
@@ -332,9 +332,12 @@ class Disk:
 
         if self.partitions[pnum].fstype.startswith(&apos;ext&apos;):
             if isinstance(src, str):
+                # disable journal, since this is not proper updated
+                exec_cmd(&quot;{} -fO ^has_journal  {}&quot;.format(self.tune2fs, self._get_part_image(pnum)))
+                # creating copy cmd</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>