mount android system.img 后,提示文件系统只读
Tofloor
poster avatar
qiushao
deepin
2017-06-05 18:57
Author
系统环境:deepin 15.4
在做android 系统精简包时,
使用 sudo mount -o loop system.img  system 命令挂载system.img到system目录后,可以查看文件,但更改文件时,提示文件系统只读。
  1. qiushao@qiushao-PC:~/rom/system/priv-app$ sudo rm DownloadProvider.apk
  2. rm: 无法删除'DownloadProvider.apk': 只读文件系统
Copy the Code

想使用 sudo mount -o remount,rw 重新挂载,增加写权限时提示文件系统写保护
  1. qiushao@qiushao-PC:~/rom$ sudo mount -o remount,rw system
  2. mount: cannot remount /dev/loop0 read-write, is write-protected
  3. qiushao@qiushao-PC:~/rom$
Copy the Code


这个操作方式在ubuntu 12.10上是没问题的。
不知道有同学知道怎么解决这个问题不?

Reply Favorite View the author
All Replies
avatar
jingle
deepin
2017-06-05 19:01
#1
Reply View the author
avatar
a946488029
deepin
2017-06-05 19:02
#2
mount -o rw 文件 路径
Reply View the author
avatar
qiushao
deepin
2017-06-05 19:21
#3
https://bbs.deepin.org/post/140547
mount -o rw 文件 路径

贴子已经说过了,提示文件系统写保护
Reply View the author
avatar
a946488029
deepin
2017-06-05 20:00
#4
https://bbs.deepin.org/post/140547
贴子已经说过了,提示文件系统写保护

ls -l 文件,看看是否文件属性只读。
Reply View the author
avatar
qiushao
deepin
2017-06-05 21:09
#5
dmesg 输出如下:
  1. [13302.273516] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null)
  2. [13929.294280] perf: interrupt took too long (3166 > 3141), lowering kernel.perf_event_max_sample_rate to 63000
  3. [14939.818648] QDBusConnection[19717]: segfault at 7fe41ef90069 ip 00007fe41ff7c7af sp 00007fe407ffe8c0 error 4 in libQt5Core.so.5.6.1[7fe41fcc6000+4c6000]
  4. [15054.485433] EXT4-fs error (device loop0): ext4_ext_check_inode:510: inode #14: comm ls: pblk 0 bad header/extent: invalid extent entries - magic f30a, entries 3, max 4(4), depth 0(0)
  5. [15054.792700] Aborting journal on device loop0-8.
  6. [15054.853763] EXT4-fs (loop0): Remounting filesystem read-only
  7. [15075.745891] EXT4-fs error (device loop0): ext4_ext_check_inode:510: inode #14: comm ls: pblk 0 bad header/extent: invalid extent entries - magic f30a, entries 3, max 4(4), depth 0(0)
Copy the Code


看起来像是system.img文件系统有错误,系统自动重新挂载成 read-only 了


Reply View the author
avatar
sendlan
deepin
2017-06-05 23:53
#6
你也可以复制出来,然后取消挂载
Reply View the author
avatar
qiushao
deepin
2017-06-06 06:04
#7
https://bbs.deepin.org/post/140547
你也可以复制出来,然后取消挂载

我也是这么想的,先把文件复制出来,修改后,再打包成ext4镜像
Reply View the author
avatar
sendlan
deepin
2017-06-10 00:04
#8
https://bbs.deepin.org/post/140547
我也是这么想的,先把文件复制出来,修改后,再打包成ext4镜像

因为我以前忘了改错东西了,刷进去主板挂了
Reply View the author