首页 > 其他分享 >data分区格式f2fs改为ext4

data分区格式f2fs改为ext4

时间:2024-03-30 09:47:53浏览次数:17  
标签:ext4 f2fs dev platform defaults data block name

问题:设备是不带电池的,关机的时候是直接断电的,如果data分区是f2fs的文件系统格式,这种操作是有一定概率性损坏文件系统了导致开不了机。f2fs改为ext4就可以减小异常掉电后数据丢失的概率。

异常开机:

 

 

正常开机会有很多init的信息:

 

 

措施:data分区改成ext4的格式文件系统:

Android7.1+rk3288:

device/rockchip/rk3288:

diff --git a/device.mk b/device.mk
index 5d05a56..cdf512e 100755
--- a/device.mk
+++ b/device.mk
@@ -25,13 +25,13 @@ PRODUCT_PACKAGES += \
displayd

#enable this for support f2fs with data partion
-BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
+#BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs

# This ensures the needed build tools are available.
# TODO: make non-linux builds happy with external/f2fs-tool; system/extras/f2fs_utils
-ifeq ($(HOST_OS),linux)
- TARGET_USERIMAGES_USE_F2FS := true
-endif
+#ifeq ($(HOST_OS),linux)
+# TARGET_USERIMAGES_USE_F2FS := true
+#endif

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.rk3288.rc:root/init.rk3288.rc \
diff --git a/fstab.rk30board.bootmode.emmc.rk3288 b/fstab.rk30board.bootmode.emmc.rk3288
old mode 100644
new mode 100755
index e753b7d..1bc021b
--- a/fstab.rk30board.bootmode.emmc.rk3288
+++ b/fstab.rk30board.bootmode.emmc.rk3288
@@ -9,8 +9,9 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/vendor0 /vendor ext4 ro,noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
-#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev
wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
/dev/block/platform/ff0f0000.dwmmc/by-name/misc /misc emmc defaults defaults
# /dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait

diff --git a/fstab.rk30board.bootmode.emmc.rk3288w b/fstab.rk30board.bootmode.emmc.rk3288w
old mode 100644
new mode 100755
index 05d7f16..8129ddd
--- a/fstab.rk30board.bootmode.emmc.rk3288w
+++ b/fstab.rk30board.bootmode.emmc.rk3288w
@@ -9,8 +9,9 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/vendor1 /vendor ext4 ro,noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait,check
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
-#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
+#/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev
wait,check,notrim,encryptable=/metadata/key_file
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard,errors=panic wait,check,encryptable=/metadata/key_file
/dev/block/platform/ff0f0000.dwmmc/by-name/misc /misc emmc defaults defaults
# /dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard wait

diff --git a/recovery.emmc.fstab b/recovery.emmc.fstab
old mode 100644
new mode 100755
index 572d70e..2981c59
--- a/recovery.emmc.fstab
+++ b/recovery.emmc.fstab
@@ -5,7 +5,7 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/system /system ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data f2fs defaults defaults
+/dev/block/platform/ff0f0000.dwmmc/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/cust /cust ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/custom /custom ext4 defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/radical_update /radical_update ext4 defaults defaults
@@ -18,4 +18,4 @@
/dev/block/platform/ff0f0000.dwmmc/by-name/recovery /recovery emmc defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/backup /backup emmc defaults defaults
/dev/block/platform/ff0f0000.dwmmc/by-name/trust /trust emmc defaults defaults
-/dev/block/platform/ff0f0000.dwmmc/by-name/baseparamer /baseparamer emmc defaults defaults
+/dev/block/platform/ff0f0000.dwmmc/by-name/baseparamer /baseparamer emmc defaults defaults
\ No newline at end of file

device/rockchip/common:

diff --git a/device.mk b/device.mk
index 6f49c7e..3327a2f 100755
--- a/device.mk
+++ b/device.mk
@@ -73,7 +73,7 @@ PRODUCT_COPY_FILES += \


# Filesystem management tools
-PRODUCT_PACKAGES += \
+#PRODUCT_PACKAGES += \
mkfs_host.f2fs \
fsck.f2fs \
mkfs.f2fs \

 

Android8.1+rk3399:

/device/rockchip/common

diff --git a/device.mk b/device.mk
index 6f49c7e..3327a2f 100755
--- a/device.mk
+++ b/device.mk
@@ -73,7 +73,7 @@ PRODUCT_COPY_FILES += \


# Filesystem management tools
-PRODUCT_PACKAGES += \
+#PRODUCT_PACKAGES += \
mkfs_host.f2fs \
fsck.f2fs \
mkfs.f2fs \

/device/rockchip/rk3399

diff --git a/device.mk b/device.mk
index 0390c64..97e6e50 100755
--- a/device.mk
+++ b/device.mk
@@ -25,13 +25,13 @@ PRODUCT_PACKAGES += \
libion

#enable this for support f2fs with data partion
-BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
+#BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs

# This ensures the needed build tools are available.
# TODO: make non-linux builds happy with external/f2fs-tool; system/extras/f2fs_utils
-ifeq ($(HOST_OS),linux)
- TARGET_USERIMAGES_USE_F2FS := true
-endif
+#ifeq ($(HOST_OS),linux)
+# TARGET_USERIMAGES_USE_F2FS := true
+#endif

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.rk3399.rc:root/init.rk3399.rc \
diff --git a/recovery.fstab b/recovery.fstab
index ab69841..e923582 100755
--- a/recovery.fstab
+++ b/recovery.fstab
@@ -7,7 +7,7 @@
/dev/block/by-name/oem /oem ext4 defaults defaults
/dev/block/by-name/cache /cache ext4 defaults defaults
/dev/block/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/by-name/userdata /data f2fs defaults defaults
+/dev/block/by-name/userdata /data ext4 defaults defaults
/dev/block/by-name/cust /cust ext4 defaults defaults
/dev/block/by-name/custom /custom ext4 defaults defaults
/dev/block/by-name/radical_update /radical_update ext4 defaults defaults
diff --git a/rk3399_mid/fstab.rk30board b/rk3399_mid/fstab.rk30board
index b16e9de..5140639 100755
--- a/rk3399_mid/fstab.rk30board
+++ b/rk3399_mid/fstab.rk30board
@@ -14,4 +14,5 @@
# For sdmmc
/devices/platform/fe320000.dwmmc/mmc_host* auto auto defaults voldmanaged=sdcard1:auto,encryptable=userdata
# Full disk encryption has less effect on rk3399, so default to enable this.
-/dev/block/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,forceencrypt=/metadata/key_file
+#/dev/block/by-name/userdata /data f2fs noatime,nodiratime,nosuid,nodev,discard,inline_xattr wait,check,notrim,forceencrypt=/metadata/key_file
+/dev/block/by-name/userdata /data ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard ,errors=panic wait,check,notrim,forceencrypt=/metadata/key_file
diff --git a/rk3399_mid/recovery.fstab b/rk3399_mid/recovery.fstab
index 26b8311..c0b3a08 100755
--- a/rk3399_mid/recovery.fstab
+++ b/rk3399_mid/recovery.fstab
@@ -7,7 +7,7 @@
/dev/block/platform/fe330000.sdhci/by-name/oem /oem ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/cache /cache ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/metadata /metadata ext4 defaults defaults
-/dev/block/platform/fe330000.sdhci/by-name/userdata /data f2fs defaults defaults
+/dev/block/platform/fe330000.sdhci/by-name/userdata /data ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/cust /cust ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/custom /custom ext4 defaults defaults
/dev/block/platform/fe330000.sdhci/by-name/radical_update /radical_update ext4 defaults defaults

 

修改成功后,cat /proc/mounts可看出来:

 

 EXT4是Linux的标准文件系统,但相对与F2FS I/O读写速度较慢。

   

标签:ext4,f2fs,dev,platform,defaults,data,block,name
From: https://www.cnblogs.com/wanglongjiang/p/18105092

相关文章

  • openGauss 工具链_DataKit
    DataKit可获得性本特性自openGauss5.0.0版本开始引入。特性简介DataKit是基于Web的openGauss的可视化的平台系统,目的是方便客户使用和管理openGauss可视化工具,可以为客户降低openGauss数据库安装使用门槛,做到安全中心管理,插件管理,以及其它功能包括一键化部署、卸载、组件化安......
  • VOL框架 GetPageData 前端加入自定义查询条件的处理方法
    VOL框架GetPageData前端加入自定义查询条件的处理方法前端加入两个自定义条件:开始日期,结束日期publicoverridePageGridData<ST_QueryFeeReceiveable>GetPageData(PageDataOptionsoptions){QuerySql=$@"SELECTFeeReceivableID,R.FeeI......
  • KingbaseES V8R3集群运维案例之---集群启动“DATA_SIZE_DIFF 16 (MB)”故障
    案例说明:为保证集群数据的一致性安全,在主备库的数据相差“DATA_SIZE_DIFF>=16M"以上时,该备库不能参与主备切换,并且通过kingbase_monitor.sh启动集群时,集群将无法启动;本案例对此种故障做了复现,并测试了解决方法。适用版本:KingbaseESV8R3适用版本:KingbaseESV8R3一、案例......
  • KingbaseES V8R3备份恢复案例之---backup_label does not exist in KINGBASE_DATA
    案例说明:在KingbaseESV8R3集群主库执行sys_rman的全备时,出现‘backup_labeldoesnotexistinKINGBASE_DATA’的故障,如下图所示:适用版本:KingbaseESV8R3一、问题现象如下所示,数据库执行sys_rman物理备份:[kingbase@node201bin]$./sys_rman-Usystem-W123456-dtes......
  • 在使用PageHelper插件进行分页查询时,为什么在Postman进行后端测试时返回的data中对应
    注意:在使用PageHelper插件进行分页查询,由Postman进行后端测试时,需要根据返回的total(查询的总记录数)和测试设置的pageSize(每页记录条数)来设置page(查询页码)的值,否则后端测试返回的data中对应的rows可能为空。理由如下:假设此时是这样一个查询情景:通过动态SQL进行条件查询,......
  • A TL Strategy for Improving the Data Efficiency of DRL Control
    Paper1ATransferLearningStrategyforImprovingtheDataEfficiencyofDeepReinforcementLearningControlinSmartBuildings:https://ieeexplore.ieee.org/document/10454120MotivationRL算法需要大量数据用于学习,我们需要提高训练和数据利用的效率。TL方法是一......
  • HCIA-Datacom实验日志(四)
    4 以太网基础与VLAN配置实验4.1实验介绍4.1.1实验组网拓扑4.1.2实验背景某公司根据业务需求,需要对其二层网络进行VLAN划分。同时,VLAN10为特殊VLAN,为了保证信息安全,只有某些特殊的PC才可以通过VLAN10进行网络访问。如实验拓扑图所示,可以在S1和S2交换机上配置基于接......
  • 启用Flashback Database闪回数据库功能
     若想顺利的使用闪回数据库功能,需要先将数据库置于闪回数据库状态。此文记录开启闪回数据库功能的步骤,注意调整过程需要重启数据库并确保数据库处于归档模式。1.确认数据库是否开启FlashbackDatabase功能若未开启,则继续,若已经开启,请从此小文儿飘过~~SYS@ora11g>selectflashbac......
  • 关于使用IconData时flutter build apk 打包报错Target aot_android_asset_bundle fail
    flutter项目中引入了iconfont.ttf之后,调试时正常,打包就报错。 网上有的说法是:使用了iconfont.ttf里面不存在的icon,但是我使用的都是在iconfont.tt文件中的icon。 我的情况是使用了switch  case给IconData的codePoint动态赋值,下面这种情况就是打包报错的 解决办法是......
  • HCIP-Datacom(H12-821)题库补充(3/27)
                  最新HCIP-Datacom(H12-821)完整题库请扫描上方二维码访问,持续更新中。运行OSPF协议的路由器,所有接口必须属于同一个区域。A:正确B:错误答案:B解析:OSPF的邻居关系是基于接口的,可以不同的接口属于不同的区域。ACL本质上是一种报文......