1. 程式人生 > >[Linux驅動煉成記] 07-檔案系統分割槽

[Linux驅動煉成記] 07-檔案系統分割槽

檢視分割槽格式


# df -hT
// ext4 檔案格式
Filesystem           Type            Size      Used Available Use% Mounted on
/dev/system          ext4            2.0G    112.4M      1.8G   6% /
devtmpfs             devtmpfs      107.2M         0    107.2M   0% /dev
tmpfs                tmpfs         116.5M         0    116.5M   0% /dev/shm
tmpfs                tmpfs         116.5M   1004.0K    115.5M   1% /tmp
tmpfs                tmpfs         116.5M     36.0K    116.5M   0% /run
/dev/data            ext4          613.9M    976.0K    568.2M   0% /data


[
[email protected]
/]# df -hT // ubifs 檔案格式 Filesystem Type Size Used Available Use% Mounted on /dev/ubi0_0 ubifs 78.7M 67.0M 11.7M 85% / devtmpfs devtmpfs 106.9M 0 106.9M 0% /dev tmpfs tmpfs 116.5M 0 116.5M 0% /dev/shm tmpfs tmpfs 116.5M 2.3M 114.2M 2% /tmp tmpfs tmpfs 116.5M 36.0K 116.5M 0% /run /dev/ubi1_0 ubifs 86.0M 66.2M 15.4M 81% /data /dev/ubi1_1 ubifs 16.8M 92.0K 15.8M 1% /etc/sugr /dev/ubi1_2 ubifs 16.8M 32.0K 15.9M 0% /cache

檢視具體的分割槽大小

//ext4檔案系統

cat /proc/inand
dev:    size   erasesize  name
inand01:    400000     80000 "bootloader"
inand02:   4000000     80000 "reserved"
inand03:  20000000     80000 "cache"
inand04:    800000     80000 "env"
inand05:   2000000     80000 "logo"
inand06:   2000000     80000 "recovery"
inand07:    800000     80000 "rsv"
inand08:    800000     80000 "tee"
inand09:   2000000     80000 "crypt"
inand10:   2000000     80000 "misc"
inand11:    400000     80000 "instaboot"
inand12:   2000000     80000 "boot"
inand13:  82000000     80000 "system"
inand14:  28000000     80000 "data"

//ubifs 檔案系統

cat /proc/mtd 

dev:    size   erasesize  name
mtd0: 00200000 00020000 "bootloader"
mtd1: 00800000 00020000 "tpl"
mtd2: 00200000 00020000 "logo"
mtd3: 01000000 00020000 "recovery"
mtd4: 00f00000 00020000 "boot"
mtd5: 06480000 00020000 "system"
mtd6: 01400000 00020000 "config"
mtd7: 01400000 00020000 "cache"
mtd8: 14280000 00020000 "data"

計算Flash大小

# cat /proc/partitions 
major minor  #blocks  name

   7        0     102400 loop0
   7        1     102400 loop1
 179        0    3702784 mmcblk0
 179        1       4096 mmcblk0p1
 179        2      65536 mmcblk0p2
 179        3     524288 mmcblk0p3
 179        4       8192 mmcblk0p4
 179        5      32768 mmcblk0p5
 179        6      32768 mmcblk0p6
 179        7       8192 mmcblk0p7
 179        8       8192 mmcblk0p8
 179        9      32768 mmcblk0p9
 179       10      32768 mmcblk0p10
 179       11       4096 mmcblk0p11
 179       12      32768 mmcblk0p12
 179       13    2129920 mmcblk0p13
 179       14     655360 mmcblk0p14
 179       96        512 mmcblk0rpmb
 179       64       2048 mmcblk0boot1
 179       32       2048 mmcblk0boot0

//計算方法
blocks 裝置總塊數 (1024 Bytes/block)
計算方法: blocks / 1024 = ??MB
如上: 3702784 / 1024 = 3616MB 大概3.5GB
[[email protected] /]# cat /proc/partitions
major minor  #blocks  name

  31        0       2048 mtdblock0
  31        1       8192 mtdblock1
  31        2       2048 mtdblock2
  31        3      16384 mtdblock3
  31        4      15360 mtdblock4
  31        5     102912 mtdblock5
  31        6      20480 mtdblock6
  31        7      20480 mtdblock7
  31        8     330240 mtdblock8
//計算方法
2048+8192+2048+16384+15360+102912+20480+20480+330240=518144
518144/1024=506MB

知識點