unmount file system at shutdown in Android.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

unmount file system at shutdown in Android.

5,386件の閲覧回数
johnturnur
Contributor III

Hello,

In some specific application on IMX6Q SABRE SD, I need to unmount /data and /system partition of android at  shutdown time. I have called function umount("/data") and umount2("/data",MNT_FORCE) at very low level of  function android_reboot ( ) function which is called from ShutdownThread.java file.

function umount fails at this point.


can anyone suggest the place where i can call umount function to unmount the file system successfully ?


Also, is remount function first umount the media and then mount?


Thanks,

ラベル(3)
0 件の賞賛
返信
2 返答(返信)

2,251件の閲覧回数
YixingKong
Senior Contributor IV

John, please click Correct Answer/Helpful Answer if your questions had been resolved.

Thanks,

Yixing

0 件の賞賛
返信

2,251件の閲覧回数
JayTu
NXP Employee
NXP Employee

If there is process accessing the partition, it won't be allowed to umount/remount.

Take data partition for example, I can see zygote, setting, lock screen, ... are accessing it. There are no ways to let those processes release accessing now.

The simple way is just to kill zygote then other processes spawned by zygote will also got killed then release. (Since your use case is at shutdown)

So, you can try the command in your console:

root@android:/ # stop

root@android:/ # umount /data

root@android:/ # mount

...

/dev/block/mmcblk0p5 /system ext4 ro,relatime,user_xattr,barrier=1,data=ordered 0 0

/dev/block/mmcblk0p6 /cache ext4 rw,nosuid,nodev,relatime,user_xattr,barrier=1,nomblk_io_submit,data=ordered 0 0

/dev/block/mmcblk0p7 /device ext4 ro,nosuid,nodev,relatime,user_xattr,barrier=1,data=ordered 0 0


As above showed, umount or remount worked.