Android分区查看

android 下面没有像以前windows 那样那么方便的查看分区情况. 前两天提到说查看android 下面的分区情况. 今天好好的看了下. 发现android下面查看分区也挺简单的..

~ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes
1 heads, 16 sectors/track, 1923584 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1               1     1923584    15388671+ ee EFI GPT
Partition 1 does not end on cylinder boundary


这种方法查看到的信息还是有限, 因为分区是GPT的.. 所以可以使用这个命令

~ # parted /dev/block/mmcblk0 print all
parted /dev/block/mmcblk0 print all
Model: MMC MAG2GC (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name      Flags
 1      4194kB  19.9MB  15.7MB               apnhlos
 2      19.9MB  80.2MB  60.2MB               modem
 3      80.2MB  80.7MB  524kB                sbl1
 4      80.7MB  80.7MB  32.8kB               dbi
 5      80.7MB  80.7MB  32.8kB               ddr
 6      80.7MB  82.8MB  2097kB               aboot
 7      82.8MB  83.4MB  524kB                rpm
 8      83.4MB  83.9MB  524kB                tz
 9      83.9MB  94.4MB  10.5MB               pad
10      94.4MB  105MB   10.5MB               param
11      105MB   120MB   14.7MB  ext4         efs
12      120MB   123MB   3146kB               modemst1
13      123MB   126MB   3146kB               modemst2
14      126MB   137MB   11.5MB               boot
15      137MB   151MB   13.6MB               recovery
16      151MB   165MB   13.6MB               fota
17      165MB   172MB   7331kB               backup
18      172MB   175MB   3146kB               fsg
19      175MB   175MB   1024B                fsc
20      175MB   175MB   8192B                ssd
21      175MB   184MB   8389kB  ext4         persist
22      184MB   193MB   9437kB  ext4         persdata
23      193MB   2559MB  2366MB  ext4         system
24      2559MB  2923MB  365MB   ext4         cache
25      2923MB  2934MB  10.5MB  ext4         hidden
26      2934MB  15.8GB  12.8GB  ext4         userdata
这样就把所有分区显示完整了.. 分区真多. 有很多都不知道是什么用的..同时也可以使用这条命令观察分区的链接情况

~ # cd /dev/block/platform/msm_sdcc.1/by-name/
cd /dev/block/platform/msm_sdcc.1/by-name/
/dev/block/platform/msm_sdcc.1/by-name # ls -l
ls -l
lrwxrwxrwx    1 root     root            20 Mar 19  1970 aboot -> /dev/block/mmcblk0p6
lrwxrwxrwx    1 root     root            20 Mar 19  1970 apnhlos -> /dev/block/mmcblk0p1
lrwxrwxrwx    1 root     root            21 Mar 19  1970 backup -> /dev/block/mmcblk0p17
lrwxrwxrwx    1 root     root            21 Mar 19  1970 boot -> /dev/block/mmcblk0p14
lrwxrwxrwx    1 root     root            21 Mar 19  1970 cache -> /dev/block/mmcblk0p24
lrwxrwxrwx    1 root     root            20 Mar 19  1970 dbi -> /dev/block/mmcblk0p4
lrwxrwxrwx    1 root     root            20 Mar 19  1970 ddr -> /dev/block/mmcblk0p5
lrwxrwxrwx    1 root     root            21 Mar 19  1970 efs -> /dev/block/mmcblk0p11
lrwxrwxrwx    1 root     root            21 Mar 19  1970 fota -> /dev/block/mmcblk0p16
lrwxrwxrwx    1 root     root            21 Mar 19  1970 fsc -> /dev/block/mmcblk0p19
lrwxrwxrwx    1 root     root            21 Mar 19  1970 fsg -> /dev/block/mmcblk0p18
lrwxrwxrwx    1 root     root            21 Mar 19  1970 hidden -> /dev/block/mmcblk0p25
lrwxrwxrwx    1 root     root            20 Mar 19  1970 modem -> /dev/block/mmcblk0p2
lrwxrwxrwx    1 root     root            21 Mar 19  1970 modemst1 -> /dev/block/mmcblk0p12
lrwxrwxrwx    1 root     root            21 Mar 19  1970 modemst2 -> /dev/block/mmcblk0p13
lrwxrwxrwx    1 root     root            20 Mar 19  1970 pad -> /dev/block/mmcblk0p9
lrwxrwxrwx    1 root     root            21 Mar 19  1970 param -> /dev/block/mmcblk0p10
lrwxrwxrwx    1 root     root            21 Mar 19  1970 persdata -> /dev/block/mmcblk0p22
lrwxrwxrwx    1 root     root            21 Mar 19  1970 persist -> /dev/block/mmcblk0p21
lrwxrwxrwx    1 root     root            21 Mar 19  1970 recovery -> /dev/block/mmcblk0p15
lrwxrwxrwx    1 root     root            20 Mar 19  1970 rpm -> /dev/block/mmcblk0p7
lrwxrwxrwx    1 root     root            20 Mar 19  1970 sbl1 -> /dev/block/mmcblk0p3
lrwxrwxrwx    1 root     root            21 Mar 19  1970 ssd -> /dev/block/mmcblk0p20
lrwxrwxrwx    1 root     root            21 Mar 19  1970 system -> /dev/block/mmcblk0p23
lrwxrwxrwx    1 root     root            20 Mar 19  1970 tz -> /dev/block/mmcblk0p8
lrwxrwxrwx    1 root     root            21 Mar 19  1970 userdata -> /dev/block/mmcblk0p26

可以查看到分区以后, 最检查做的两个操作, 一个是重新分区.

http://www.cnblogs.com/freeliver54/archive/2013/06/26/3157599.html

http://bbs.ydss.cn/thread-496703-1-1.html

一个是像windows的ghost那样备份分区..

http://bbs.zoopda.com/thread-145901-1-1.html

网友评论:

  1. zhetenger 说:

    不少android都有U盘模式,或者叫USB大容量存储。这个功能在/sys下一般都能找到file文件来控制。
    adb shell,然后echo就可以控制。
    echo /dev/block/mmcblk0 > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file即可直接把整个flash都挂上U盘。如果改成echo > /sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file,Windows会提示无媒体。
    除了file,还有只读ro也可以控制。
    有时候Windows不能成功识别,重新插拔一下USB线就好。

    刚发现我的手机EMMC也是GPT时,我也是吃了一惊。
    但好像这个GPT没有备份,GParted打开时有警告提示的。

  2. joen 说:

    dd if=/dev/block/mmcblk0p13 of=/data/local/tmp/boot.img

  3. joen 说:

    针对不同的机型查看分区信息
    cat /proc/mtd
    cat /proc/emmc
    cat /proc/partitions
    ls -l /dev/block/platform/*/by-name/
    http://www.cnblogs.com/shangdawei/p/4514128.html

发表评论

发表评论前,请选对水果: 菠萝