4+64G userdata分割區修改記錄

2020-09-30 16:00:51

1、目前2+16G的userdata.img燒寫到4+64G版本上時,在設定介面顯示的儲存空間裡已用空間顯示不正確,需要恢復出廠設定才能顯示正常。

2、這個原因的是userdata分割區大小設定不正確引起的,需要修改檔案位置device/qcom/msm8953_64/BoardConfig.mk,變數BOARD_USERDATAIMAGE_PARTITION_SIZE := 9999220736,目前設定的是9G多,

  這個值需要根據新的flash大小修改,修改方法如下:

3、分體機adb shell  輸入cat /proc/partitions   顯示當前系統分割區,大小單位是1024b

major minor #blocks name

254 0 817260 zram0
179 0 61071360 mmcblk0
179 1 86016 mmcblk0p1
179 2 1 mmcblk0p2
179 3 8 mmcblk0p3
179 4 512 mmcblk0p4
179 5 512 mmcblk0p5
179 6 512 mmcblk0p6
179 7 512 mmcblk0p7
179 8 2048 mmcblk0p8
179 9 2048 mmcblk0p9
179 10 256 mmcblk0p10
179 11 256 mmcblk0p11
179 12 16384 mmcblk0p12
179 13 1536 mmcblk0p13
179 14 1536 mmcblk0p14
179 15 32 mmcblk0p15
179 16 1536 mmcblk0p16
179 17 16 mmcblk0p17
179 18 11264 mmcblk0p18
179 19 1024 mmcblk0p19
179 20 1024 mmcblk0p20
179 21 65536 mmcblk0p21
179 22 65536 mmcblk0p22
179 23 1024 mmcblk0p23
179 24 3145728 mmcblk0p24
179 25 262144 mmcblk0p25
179 26 32768 mmcblk0p26
179 27 1024 mmcblk0p27
179 28 512 mmcblk0p28
179 29 32 mmcblk0p29
179 30 262144 mmcblk0p30
179 31 32 mmcblk0p31
259 0 512 mmcblk0p32
259 1 1024 mmcblk0p33
259 2 32768 mmcblk0p34
259 3 512 mmcblk0p35
259 4 4096 mmcblk0p36
259 5 128 mmcblk0p37
259 6 128 mmcblk0p38
259 7 256 mmcblk0p39
259 8 256 mmcblk0p40
259 9 256 mmcblk0p41
259 10 256 mmcblk0p42
259 11 256 mmcblk0p43
259 12 256 mmcblk0p44
259 13 256 mmcblk0p45
259 14 256 mmcblk0p46
259 15 8 mmcblk0p47
259 16 65536 mmcblk0p48
259 17 5120 mmcblk0p49
259 18 10240 mmcblk0p50
259 19 56467943 mmcblk0p51
179 32 16384 mmcblk0rpmb

 

4、接著ls -l  /dev/block/bootdevice/by-name顯示如下,可以看到 userdata分割區應的分割區塊是 mmcblk0p51

lrwxrwxrwx 1 root root 21 1970-02-12 01:55 system -> /dev/block/mmcblk0p24
lrwxrwxrwx 1 root root 20 1970-02-12 01:55 tz -> /dev/block/mmcblk0p8
lrwxrwxrwx 1 root root 20 1970-02-12 01:55 tzbak -> /dev/block/mmcblk0p9
lrwxrwxrwx 1 root root 21 1970-02-12 01:55 userdata -> /dev/block/mmcblk0p51

 

5、計算實際的userdata分割區大小,(56467943-65536)*1024 = 57756064768,將變數BOARD_USERDATAIMAGE_PARTITION_SIZE改成這個值,編譯userdata.img燒錄進去後,儲存空間顯示正常