EXT4 app2sd link2sd 分区修复坏超级块。 Android 上无法挂载分区,但在 Linux Live 上可以通过 su 挂载 RW

EXT4 app2sd link2sd 分区修复坏超级块。 Android 上无法挂载分区,但在 Linux Live 上可以通过 su 挂载 RW

我的6 手机上有一个 128GB 的​​ micro SD,格式化为ext410GB,用于app2sd第二个 ext4分区 (p2) 。Android我的所有应用程序(80%)都保留在该 ext4 分区上。现在app2sd无法加载此分区 - “无法安装 ....kgrinvalid 文件” 另外,exFat用于保存我的数据的 119 GB 主 fat ( ) 分区 ( p1) 已安装为 RO。我rooted使用的是索尼 experia Z3

简要背景:
正在用手机拍电影,重启两次就死机了。之后就没有成功安装 ext4 分区了。

问题 :

-- 我怎样才能在 ext4 文件系统上完成 fsck 并让分配表知道有坏块
-- 卡中是否有内置的机制可以检测坏块和损坏,并将卡置于 RO 模式 1分区和其他分区 ext4 无法安装在手机上
——我在某些地方读到这意味着该卡已处于最后状态,经过一些写入周期后,它会变成 RO。一些技术支持表明发生了这种情况。我不准备相信。从亚马逊购买的它只有 4 个月大,我可以写信给它(这将在故事的其余部分中确认)
——我有 ADB 驱动程序并在 adb 上进入 # 提示符。我可以将 p1 安装为 RW 。我可以在 adb 上确认 P2 已被看到,但它不会挂载它
——我怎样才能让 app2sd 挂载它并回到业务中。

我做了什么

现场linuxCD

-- 我能够将 p1 和 p2 挂载为 RW(在显式命令之后),并且只能挂载为 Su。普通用户 - 其 RO 被拒绝。所以在实时 ubuntu 上我可以 RW 到两者
- 备份 P2,然后尝试 DEL 并格式化 P2(gparted+fdisk手动) - 不走运。两者都给出成功的消息,但刷新后它们将显示相同的旧partitionsP1 和 P2。在 Window 7 - paragon 分区管理器上尝试了相同的操作 - 给出了成功的消息,但刷新后它们将显示旧配置 P1 和 P2。
---Fsck

it@it:~$ sudo fsck.ext4 -v /dev/sdc2
e2fsck 1.43.4 (31-Jan-2017)
app2sd: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? yes
fsck.ext4: unable to set superblock flags on app2sd


app2sd: ********** WARNING: Filesystem still has errors **********

-运行备份超级块修复没有帮助

it@it:~$ sudo mke2fs -n  /dev/sdc2
mke2fs 1.43.4 (31-Jan-2017)
/dev/sdc2 contains a ext4 file system labelled 'app2sd'
    last mounted on /data/sdext2 on Sun Jan  7 07:21:35 2018
Proceed anyway? (y,N) y
Creating filesystem with 2604538 4k blocks and 651520 inodes
Filesystem UUID: 53138787-e743-4160-9041-ac9613d44db8
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

我尝试了各种超级块 - 没有运气。

我使用了这些指南 - 没有运气
1) 从备份恢复超级块2 ) fsck.ext4 在错误卸载后无法设置超级块标志

it@it:~$ sudo e2fsck -b   1605632 -B 4096 /dev/sdc2
e2fsck 1.43.4 (31-Jan-2017)
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
app2sd: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
e2fsck: unable to set superblock flags on app2sd


app2sd: ***** FILE SYSTEM WAS MODIFIED *****

app2sd: ********** WARNING: Filesystem still has errors **********

我也尝试过这个,B=4096证实testdisk了w:

mke2fs -S

-S    Write  superblock and group descriptors only.  This is useful if all
          of the superblock and backup superblocks are corrupted, and a  last-
          ditch  recovery method is desired.  It causes mke2fs to reinitialize
          the superblock and group descriptors, while not touching  the  inode
          table and the block and inode bitmaps.  The e2fsck program should be
          run immediately after this option is used, and there is no guarantee
          that  any  data  will be salvageable.  It is critical to specify the
          correct filesystem blocksize when using this option, 

这是更多的东西
测试盘日志

Partition table type (auto): Intel
Disk /dev/sdb - 127 GB / 119 GiB - Generic- SD/MMC
Partition table type: Intel

Interface Advanced
Geometry from i386 MBR: head=255 sector=63


test_FAT()
 1 P FAT32 LBA                0  32 33 14247  69 30  228880384
sector_size  512
cluster_size 64
reserved     126
fats         2
dir_entries  0
sectors      0
media        F8
fat_length   0
secs_track   16
heads        4
hidden       2048
total_sect   228880384
check_part_i386 failed for partition type 0C
get_geometry_from_list_part_aux head=255 nbr=2
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=255 nbr=2
 1 P FAT32 LBA                0  32 33 14247  69 30  228880384
 2 * Linux                14248   0  1 15544 254 63   20836305 [app2sd]
     ext4 blocksize=4096 Large_file Sparse_SB Recover, 10668 MB / 10173 MiB
search_superblock

recover_EXT2: s_block_group_nr=0/79, s_mnt_count=83/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2 (block=0, blocksize=4096)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 262144 (block=32768, blocksize=4096)

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 786432 (block=98304, blocksize=4096)

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 1310720 (block=163840, blocksize=4096)

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 1835008 (block=229376, blocksize=4096)

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2359296 (block=294912, blocksize=4096)

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 6553600 (block=819200, blocksize=4096)

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 7077888 (block=884736, blocksize=4096)

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 12845056 (block=1605632, blocksize=4096)
  Linux                14248   0  1 15544 254 62   20836304 [app2sd]
superblock 0, blocksize=4096 [app2sd]
superblock 32768, blocksize=4096 [app2sd]
superblock 98304, blocksize=4096 [app2sd]
superblock 163840, blocksize=4096 [app2sd]
superblock 229376, blocksize=4096 [app2sd]
superblock 294912, blocksize=4096 [app2sd]
superblock 819200, blocksize=4096 [app2sd]
superblock 884736, blocksize=4096 [app2sd]
superblock 1605632, blocksize=4096 [app2sd]

To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
search_superblock

recover_EXT2: s_block_group_nr=0/79, s_mnt_count=83/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2 (block=0, blocksize=4096)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed

dump2fs 日志示例
我不能简单地将整个文件附加到堆栈上。

Partition table type (auto): Intel
Disk /dev/sdb - 127 GB / 119 GiB - Generic- SD/MMC
Partition table type: Intel

Interface Advanced
Geometry from i386 MBR: head=255 sector=63


test_FAT()
 1 P FAT32 LBA                0  32 33 14247  69 30  228880384
sector_size  512
cluster_size 64
reserved     126
fats         2
dir_entries  0
sectors      0
media        F8
fat_length   0
secs_track   16
heads        4
hidden       2048
total_sect   228880384
check_part_i386 failed for partition type 0C
get_geometry_from_list_part_aux head=255 nbr=2
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=255 nbr=2
 1 P FAT32 LBA                0  32 33 14247  69 30  228880384
 2 * Linux                14248   0  1 15544 254 63   20836305 [app2sd]
     ext4 blocksize=4096 Large_file Sparse_SB Recover, 10668 MB / 10173 MiB
search_superblock

recover_EXT2: s_block_group_nr=0/79, s_mnt_count=83/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2 (block=0, blocksize=4096)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=1/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 262144 (block=32768, blocksize=4096)

block_group_nr 3

recover_EXT2: "e2fsck -b 98304 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=3/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 786432 (block=98304, blocksize=4096)

block_group_nr 5

recover_EXT2: "e2fsck -b 163840 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=5/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 1310720 (block=163840, blocksize=4096)

block_group_nr 7

recover_EXT2: "e2fsck -b 229376 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=7/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 1835008 (block=229376, blocksize=4096)

block_group_nr 9

recover_EXT2: "e2fsck -b 294912 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=9/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2359296 (block=294912, blocksize=4096)

block_group_nr 25

recover_EXT2: "e2fsck -b 819200 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=25/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 6553600 (block=819200, blocksize=4096)

block_group_nr 27

recover_EXT2: "e2fsck -b 884736 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=27/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 7077888 (block=884736, blocksize=4096)

block_group_nr 49

recover_EXT2: "e2fsck -b 1605632 -B 4096 device" may be needed
recover_EXT2: s_block_group_nr=49/79, s_mnt_count=0/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 12845056 (block=1605632, blocksize=4096)
  Linux                14248   0  1 15544 254 62   20836304 [app2sd]
superblock 0, blocksize=4096 [app2sd]
superblock 32768, blocksize=4096 [app2sd]
superblock 98304, blocksize=4096 [app2sd]
superblock 163840, blocksize=4096 [app2sd]
superblock 229376, blocksize=4096 [app2sd]
superblock 294912, blocksize=4096 [app2sd]
superblock 819200, blocksize=4096 [app2sd]
superblock 884736, blocksize=4096 [app2sd]
superblock 1605632, blocksize=4096 [app2sd]

To repair the filesystem using alternate superblock, run
fsck.ext4 -p -b superblock -B blocksize device
search_superblock

recover_EXT2: s_block_group_nr=0/79, s_mnt_count=83/20, s_blocks_per_group=32768, s_inodes_per_group=32320
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 2604538
recover_EXT2: part_size 20836304
Ext2 superblock found at sector 2 (block=0, blocksize=4096)

block_group_nr 1

recover_EXT2: "e2fsck -b 32768 -B 4096 device" may be needed

循环遍历节点列表
另一种尝试:从 testdisk 日志中获取所有备份超级节点列表并循环,这很有趣:当我运行时,esfsck -b <n> -B <N> /devpath我得到下面相同的标准 o/p 。没有不同。

    + sudo e2fsck -b 163840 -B 4096 -y /dev/sdc2
    e2fsck 1.43.4 (31-Jan-2017)
    Superblock needs_recovery flag is clear, but journal has data.
    Recovery flag not set in backup superblock, so running journal anyway.
    app2sd: recovering journal
    Superblock needs_recovery flag is clear, but journal has data.
    Recovery flag not set in backup superblock, so running journal anyway.
    Superblock needs_recovery flag is clear, but journal has data.
    Recovery flag not set in backup superblock, so running journal anyway.
    e2fsck: unable to set superblock flags on app2sd


    app2sd: ***** FILE SYSTEM WAS MODIFIED *****

    app2sd: ********** WARNING: Filesystem still has errors **********

但是当我循环遍历从文件(testdisk.log)加载的列表时 - 对于某些节点,它会给出一个很长的o/p,就像它做了一些修复一样 - 一线希望。之后我做了一个LinuxREISUB 关闭并再次 efsck 。没有运气

efsck 循环日志与修复部分。

对于那些尝试修复的块号 - 在命令行上我尝试设置那些非常备份的超级块 - 但这没有帮助 - 回到第一个!

+ for i in $(grep e2fsck testdisk.log | uniq | cut -d " " -f 4)
+ sudo e2fsck -b 229376 -B 4096 -y /dev/sdc2
e2fsck 1.43.4 (31-Jan-2017)
Superblock needs_recovery flag is clear, but journal has data.
Recovery flag not set in backup superblock, so running journal anyway.
app2sd: recovering journal
Pass 1: Checking inodes, blocks, and sizes
Inode 69709 extent tree (at level 1) could be shorter.  Fix? yes

Inode 97187 extent tree (at level 1) could be shorter.  Fix? yes

Inode 98194 extent tree (at level 1) could be shorter.  Fix? yes

Inode 98215 extent tree (at level 1) could be shorter.  Fix? yes

Inode 98646 extent tree (at level 1) could be shorter.  Fix? yes

Inode 99795 extent tree (at level 1) could be shorter.  Fix? yes

Inode 100170 extent tree (at level 1) could be shorter.  Fix? yes

Inode 100186 extent tree (at level 1) could be shorter.  Fix? yes

Inode 100825 extent tree (at level 1) could be shorter.  Fix? yes

Inode 129341 extent tree (at level 1) could be shorter.  Fix? yes

Inodes that were part of a corrupted orphan linked list found.  Fix? yes

Inode 129343 was part of the orphaned inode list.  FIXED.
Inode 129344 was part of the orphaned inode list.  FIXED.
Inode 129345 was part of the orphaned inode list.  FIXED.
Inode 129371 extent tree (at level 1) could be shorter.  Fix? yes

Inode 129414 extent tree (at level 1) could be shorter.  Fix? yes

Inode 129418 extent tree (at level 1) could be shorter.  Fix? yes

Inode 129437 extent tree (at level 1) could be shorter.  Fix? yes

Inode 162145 extent tree (at level 1) could be shorter.  Fix? yes

Inode 162147 extent tree (at level 1) could be shorter.  Fix? yes

Inode 162151 extent tree (at level 1) could be shorter.  Fix? yes

Inode 194325 extent tree (at level 1) could be shorter.  Fix? yes

Inode 194408 extent tree (at level 1) could be shorter.  Fix? yes

Inode 194464 extent tree (at level 1) could be shorter.  Fix? yes

Deleted inode 195640 has zero dtime.  Fix? yes

Deleted inode 196040 has zero dtime.  Fix? yes

Inode 235473 is in use, but has dtime set.  Fix? yes

Inode 235473 has imagic flag set.  Clear? yes

Inode 235473 has a extra size (25959) which is invalid
Fix? yes

Inode 235474 has INLINE_DATA_FL flag on filesystem without inline data support.
Clear? yes

Inode 235473, i_size is 7019251879657894515, should be 0.  Fix? yes

Inode 235473, i_blocks is 81858393236329, should be 0.  Fix? yes

Inode 388501 extent tree (at level 1) could be shorter.  Fix? yes

Inode 420685 extent tree (at level 1) could be shorter.  Fix? yes

Inode 452971 extent tree (at level 1) could be shorter.  Fix? yes

Inode 452978 extent tree (at level 1) could be shorter.  Fix? yes

Inode 452981 extent tree (at level 1) could be shorter.  Fix? yes

Inode 550513 extent tree (at level 1) could be shorter.  Fix? yes

Inode 550523 extent tree (at level 1) could be shorter.  Fix? yes

Inode 550524 extent tree (at level 1) could be shorter.  Fix? yes

Inode 550525 extent tree (at level 1) could be shorter.  Fix? yes

Inode 551843 extent tree (at level 1) could be shorter.  Fix? yes

Inode 582085 has an invalid extent node (blk 593131, lblk 0)
Clear? yes

Inode 582085 extent tree (at level 1) could be shorter.  Fix? yes

Inode 582085, i_blocks is 40, should be 0.  Fix? yes

Inode 582132 extent tree (at level 1) could be shorter.  Fix? yes

Pass 1E: Optimizing extent trees
Pass 2: Checking directory structure
Directory inode 97167, block #0, offset 0: directory corrupted
Salvage? yes

Missing '.' in directory inode 97167.
Fix? yes

Setting filetype for entry '.' in ??? (97167) to 2.
Missing '..' in directory inode 97167.
Fix? yes

Setting filetype for entry '..' in ??? (97167) to 2.
Directory inode 97176, block #0, offset 0: directory corrupted
Salvage? yes

Missing '.' in directory inode 97176.
Fix? yes

Setting filetype for entry '.' in ??? (97176) to 2.
Missing '..' in directory inode 97176.
Fix? yes

Setting filetype for entry '..' in ??? (97176) to 2.
Directory inode 97213, block #0, offset 0: directory corrupted
Salvage? yes

Missing '.' in directory inode 97213.
Fix? yes

Setting filetype for entry '.' in ??? (97213) to 2.
Missing '..' in directory inode 97213.
Fix? yes

Setting filetype for entry '..' in ??? (97213) to 2.
Directory inode 161950, block #0, offset 0: directory corrupted
Salvage? yes

Missing '.' in directory inode 161950.
Fix? yes

Setting filetype for entry '.' in ??? (161950) to 2.
Missing '..' in directory inode 161950.
Fix? yes

Setting filetype for entry '..' in ??? (161950) to 2.
Inode 235473 (/data/com.abhivyaktyapps.learn.sanskrit/app_Parse/CommandCache/CachedCommand_00000160cc4ef3d9_00000000_-1326099007) has invalid mode (0166654).
Clear? yes

如果它完全是一匹死马,那么为什么我可以在实时状态下挂载和RW并且Android会退出看起来flag如果检测到坏块或损坏的块,这里会进行某种设置superblock-始终加载P1作为RO和P2是不值得的加载中。我如何清除该标志?我的安卓手机有# via 。ADB为什么我可以像在 Live 上那样挂载在 Android 上?

答案1

- 在 i 中添加所需的命令后,我可以正确安装两个分区nit.d script。如果您的手机不支持前者 - 还有其他选择magisk modulex-posed是另一个选项)并且 magisk设置应该不是isolated namespace 。对于要传播的挂载和su -mm(挂载主机)应该使用
exFAT分区已损坏我恢复了数据,现在我很高兴使用ext4

相关内容