<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet type="text/xsl" href="/atom.xsl"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn"><id>https://maxlen727.github.io/tags/%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/</id><title>文件系统 on 暮歌</title><updated>2026-10-19T05:35:03Z</updated><language>zh-cn</language><subtitle>自留地，不是技术 blog, 仅仅用作我生活的记录</subtitle><background>/background_hu_d92feabfcd60f52c.webp</background><accent>139, 92, 246</accent><accentLight>167, 139, 250</accentLight><debounce>70</debounce><author><name>微恙</name><email>maxlen@duck.com</email><uri>https://maxlen727.github.io/</uri></author><link href="https://maxlen727.github.io/tags/%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/atom.xml" rel="self" type="application/atom+xml"/><link href="https://maxlen727.github.io/tags/%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/" rel="alternate" type="text/html"/><generator uri="https://gohugo.io" version="0.148.2">Hugo</generator><rights>© 2021 - 2026 MaxLen All Rights Reserved.</rights><entry><id>https://maxlen727.github.io/posts/flash-rom-android-fliessys/</id><title>一次刷机经历，让我开始了解安卓文件系统</title><published>2023-07-07T10:35:25+08:00</published><updated>2024-02-12T10:35:25+08:00</updated><author><name>微恙</name></author><link href="https://maxlen727.github.io/posts/flash-rom-android-fliessys/" rel="alternate" type="text/html"/><summary>由一次意外而产生的新认知…</summary><content type="html" xml:base="https://maxlen727.github.io/posts/flash-rom-android-fliessys/"><![CDATA[<p>（抬头）束束刚刚泡了一杯茶，先请你尝尝吧！</p>
<hr>

<h2 class="relative group">What happened ? 
    <div id="what-happened-" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#what-happened-" aria-label="锚点">#</a>
    </span>        
    
</h2>
<p>发现家里有一台野生 Redmi 7, 但是 MIUI 在这台机器上实在太卡，于是束束决定给它刷一个类原生。</p>
<p>逛了逛酷安，看这个机型里有人说 cherishOS 不错，所以束束先选择的是 cherish 的 A11.</p>
<p>本以为是一次平平无奇的刷机，按照常规操作解 BL，进 fastboot，刷 Rec（用的 OrangeFox），adbsideload 侧载 rom，开机</p>
<p>？</p>
<p>开不开机！一直卡在开机界面上</p>
<p>无奈，束束认为是 Rom 的问题，于是换 dotos 的 A11，再刷</p>
<p>这次的 dotos 就还可以了，虽然也不能开机，但是可以显示一个报错的界面，全英文，具体是什么我也忘了，大概就是说需要格式化此设备才行，下面直接一个按钮 Reboot to Recovery.</p>
<p>那行，那束束就乖乖 Reboot to Recovery 去格式化呗。然而格式化 data 分区后…不行。</p>
<p>此时我以为是 rec 问题，于是又换了 TWRP，同时去下了 los 的每夜版（因为这个设备根本没有正式版啊喂！）再试一次。</p>
<p>噔噔，结果还是和刷 dotos 时一样的。看着这台没刷好的手机，束束有些着急了。</p>

<h2 class="relative group">怎么解决的？ 
    <div id="怎么解决的" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e6%80%8e%e4%b9%88%e8%a7%a3%e5%86%b3%e7%9a%84" aria-label="锚点">#</a>
    </span>        
    
</h2>
<p>束束去网上搜来搜去好像没人说到这个问题，后来不知道看了哪篇文章还是 xda 某个帖子提到了文件系统的事，索性去 TWRP 里碰碰运气，把 data 分区的文件系统从 f2fs 改为 ext4，开机，欸，竟然可以了。</p>
<p><a
  href="https://blog.ichr.me/post/f2fs-rom-issue/"
    target="_blank"
  >F2FS ROM 引发的悲剧及其解决方案</a></p>
<p>诺，这篇 blog 中提到了，但和束束遇到的情况并不完全一样。</p>

<h2 class="relative group">对安卓文件系统的新了解 
    <div id="对安卓文件系统的新了解" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e5%af%b9%e5%ae%89%e5%8d%93%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e7%9a%84%e6%96%b0%e4%ba%86%e8%a7%a3" aria-label="锚点">#</a>
    </span>        
    
</h2>
<p>上面文章里的博主提到了</p>
<blockquote>
<p>这次「灾难」的导火索是严格要求 F2FS 文件系统的 Android 类原生 ROM——<a
  href="https://www.droidontime.com/"
    target="_blank"
  >Dot OS (Droid on Time)</a>，而其它 ROM 譬如 Lineage OS、Pixel Experience 等均只要求 ext4 文件系统。</p></blockquote>
<p>dotos 真的只认 f2fs 吗？其实不然。安卓系统对于文件系统的支持要看内核是否支持。</p>
<p>比如说束束刷的这台 Redmi 7: 束束刷的这几个包内核都不支持 f2fs，而这里 TWRP 等 rec 刷入进去默认文件系统就是原先的 f2fs，就导致了开机报错或 cherish 那种严重的无法开机的情况。</p>
<p>再说这个 f2fs 不是很广泛了？为什么竟然不被部分内核支持。这里引用一段</p>
<blockquote>
<p>F2FS（Flash-Friendly File System）是一种闪存文件系统，最初就是为了 NAND 闪存存储设备设计的。相比之下，ext4 最初设计是考虑到运行在机械硬盘（磁盘）等区块存储设备上的，而由于其读写性能远不如 SSD 固态硬盘等闪存存储设备，所以现在很多场景都使用固态硬盘。Linux 随后也推出了 MTD 这一硬件抽象层，它能让闪存设备看起来像是一种区块设备，从而使针对区块设备的文件系统直接应用在闪存上。</p></blockquote>
<blockquote>
<p>ext4 即为<strong>第四代扩展文件系统</strong>（Fourth extended filesystem，ext4），2006 年被首次公开、2008 年被当成稳定版本并入 Linux 源代码并成为官方建议的默认文件系统。而 Android 正是基于 Linux 开发，早在 Android 2.3 就已用 ext4 取代 YAFFS，市面上绝大多数 Android ROM 也确实使用的是 ext4 文件系统。</p></blockquote>
<p>早在安卓 2.3 时 ext4 就已经被安卓官方支持，但是这段文字里没有提到 f2fs 的支持情况，具体又是怎样的呢？</p>
<p>在谷歌所维护的 AOSP 中，F2FS 并不是官方支持的文件系统，但是仍然有一些设备树可以选择支持 f2fs. 少数派的这篇文章中有提到：</p>
<p><a
  href="https://sspai.com/post/53136"
    target="_blank"
  >给你的 Android 手机换个文件系统 - 少数派</a></p>
<p>而 AOSP 默认所支持的文件系统是 ext4.</p>
<p>这也道出了另一个事实：不是被 Linux 主线内核支持的文件系统就会被安卓支持。</p>
<p>






<figure>
    <img class="my-0 rounded-md" loading="lazy" alt="image" src="https://github.com/maxlen727/picx-images-hosting/raw/master/image.64b3fo5r38c0.webp">

  
</figure>
</p>

<h2 class="relative group">Ending 
    <div id="ending" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#ending" aria-label="锚点">#</a>
    </span>        
    
</h2>
<p>这次刷机“翻车”让束束学到了一些关于安卓文件系统的知识。还是不得不感叹：安卓的系统机制真是神奇且有趣啊？到底还有什么更多的东西等着咱去发掘呢？</p>
<hr>

<h2 class="relative group">参考资料 
    <div id="参考资料" class="anchor"></div>
    
    <span
        class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100 select-none">
        <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e5%8f%82%e8%80%83%e8%b5%84%e6%96%99" aria-label="锚点">#</a>
    </span>        
    
</h2>
<p><a
  href="https://sspai.com/post/53136"
    target="_blank"
  >给你的 Android 手机换个文件系统 - 少数派</a></p>
<p><a
  href="https://blog.ichr.me/post/f2fs-rom-issue/"
    target="_blank"
  >F2FS ROM 引发的悲剧及其解决方案</a></p>
<p><a
  href="https://zh.wikipedia.org/wiki/Ext4"
    target="_blank"
  >ext4</a></p>
<p><a
  href="https://source.android.com/docs/core/architecture/android-kernel-file-system-support?hl=zh-cn"
    target="_blank"
  >Android 内核文件系统支持  |  Android 开源项目  |  Android Open Source Project</a></p>
<p><a
  href="https://forum.xda-developers.com/t/official-recovery-onclite-orangefox-recovery-project-r11-0_0-stable.4079941/post-82593949"
    target="_blank"
  >[OFFICIAL][RECOVERY][ONCLITE] OrangeFox Recovery Project&hellip;</a></p>
]]></content><category term="刷机"/><category term="安卓"/><category term="文件系统"/></entry></feed>