Skip to content

Instantly share code, notes, and snippets.

@mouseos
Last active June 3, 2024 15:18
Show Gist options
  • Save mouseos/a71f84918df4d06fcc3ff57fe0fa25a1 to your computer and use it in GitHub Desktop.
Save mouseos/a71f84918df4d06fcc3ff57fe0fa25a1 to your computer and use it in GitHub Desktop.
p30のsystemパーティションを拡張してGSIを焼く
PS D:\Android\tools\all\parted_gdisk_fdisk_mkfs.ext4-AARCH64> adb push .\fdisk /tmp
.\fdisk: 1 file pushed, 0 skipped. 118.7 MB/s (541460 bytes in 0.004s)
PS D:\Android\tools\all\parted_gdisk_fdisk_mkfs.ext4-AARCH64> adb push .\gdisk /tmp
.\gdisk: 1 file pushed, 0 skipped. 410.0 MB/s (680612 bytes in 0.002s)
PS D:\Android\tools\all\parted_gdisk_fdisk_mkfs.ext4-AARCH64> adb push .\mkfs.ext4 /tmp
.\mkfs.ext4: 1 file pushed, 0 skipped. 543.8 MB/s (422068 bytes in 0.001s)
PS D:\Android\tools\all\parted_gdisk_fdisk_mkfs.ext4-AARCH64> adb push .\parted /tmp
.\parted: 1 file pushed, 0 skipped. 337.0 MB/s (470788 bytes in 0.001s)
PS D:\Android\tools\all\parted_gdisk_fdisk_mkfs.ext4-AARCH64> adb shell
charlotte:/ # cd /tmp
charlotte:/tmp # ls
fdisk gdisk mkfs.ext4 parted recovery.log twadbfifo
charlotte:/tmp # chmod +x *
127|charlotte:/tmp # ./parted /dev/block/sdd
GNU Parted 3.2
Using /dev/block/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MiB
(parted) p
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel?
OK/Cancel? OK
Model: TOSHIBA THGAF8T0T43BAIRB (scsi)
Disk /dev/block/sdd: 122008MiB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 0.50MiB 1.00MiB 0.50MiB vrl msftdata
2 1.00MiB 1.50MiB 0.50MiB vrl_backup msftdata
3 1.50MiB 10.0MiB 8.50MiB ext4 modem_secure msftdata
4 10.0MiB 15.0MiB 5.00MiB nvme msftdata
5 15.0MiB 16.0MiB 1.00MiB certification msftdata
6 16.0MiB 80.0MiB 64.0MiB oeminfo msftdata
7 80.0MiB 112MiB 32.0MiB ext4 secure_storage msftdata
8 112MiB 144MiB 32.0MiB ext4 modem_om msftdata
9 144MiB 160MiB 16.0MiB modemnvm_factory msftdata
10 160MiB 176MiB 16.0MiB modemnvm_backup msftdata
11 176MiB 196MiB 20.0MiB ext4 modemnvm_img msftdata
12 196MiB 212MiB 16.0MiB modemnvm_system msftdata
13 212MiB 216MiB 4.00MiB hisee_encos msftdata
14 216MiB 217MiB 1.00MiB veritykey msftdata
15 217MiB 218MiB 1.00MiB ddr_para msftdata
16 218MiB 245MiB 27.0MiB reserved2 msftdata
17 245MiB 325MiB 80.0MiB ext4 splash2 msftdata
18 325MiB 327MiB 2.00MiB bootfail_info msftdata
19 327MiB 329MiB 2.00MiB misc msftdata
20 329MiB 345MiB 16.0MiB dfx msftdata
21 345MiB 361MiB 16.0MiB rrecord msftdata
22 361MiB 361MiB 0.25MiB fw_lpm3_a msftdata
23 361MiB 365MiB 3.75MiB reserved3_a msftdata
24 365MiB 366MiB 1.00MiB hdcp_a msftdata
25 366MiB 370MiB 4.00MiB hisee_img_a msftdata
26 370MiB 374MiB 4.00MiB hhee_a msftdata
27 374MiB 382MiB 8.00MiB ext4 hisee_fs_a msftdata
28 382MiB 394MiB 12.0MiB fastboot_a msftdata
29 394MiB 398MiB 4.00MiB vector_a msftdata
30 398MiB 400MiB 2.00MiB isp_boot_a msftdata
31 400MiB 414MiB 14.0MiB isp_firmware_a msftdata
32 414MiB 426MiB 12.0MiB fw_hifi_a msftdata
33 426MiB 434MiB 8.00MiB teeos_a msftdata
34 434MiB 450MiB 16.0MiB sensorhub_a msftdata
35 450MiB 474MiB 24.0MiB erecovery_kernel_a msftdata
36 474MiB 506MiB 32.0MiB erecovery_ramdisk_a msftdata
37 506MiB 522MiB 16.0MiB erecovery_vendor_a msftdata
38 522MiB 546MiB 24.0MiB kernel_a msftdata
39 546MiB 558MiB 12.0MiB eng_system_a msftdata
40 558MiB 590MiB 32.0MiB recovery_ramdisk_a msftdata
41 590MiB 606MiB 16.0MiB recovery_vendor_a msftdata
42 606MiB 627MiB 21.0MiB dts_a msftdata
43 627MiB 634MiB 7.00MiB dto_a msftdata
44 634MiB 636MiB 2.00MiB trustfirmware_a msftdata
45 636MiB 692MiB 56.0MiB ext4 modem_fw_a msftdata
46 692MiB 704MiB 12.0MiB eng_vendor_a msftdata
47 704MiB 706MiB 2.00MiB recovery_vbmeta_a msftdata
48 706MiB 708MiB 2.00MiB erecovery_vbmeta_a msftdata
49 708MiB 712MiB 4.00MiB vbmeta_a msftdata
50 712MiB 728MiB 16.0MiB modemnvm_update_a msftdata
51 728MiB 768MiB 40.0MiB modemnvm_cust_a msftdata
52 768MiB 800MiB 32.0MiB reserved7 msftdata
53 800MiB 832MiB 32.0MiB ext4 version_a msftdata
54 832MiB 1784MiB 952MiB vendor_a msftdata
55 1784MiB 1792MiB 8.00MiB ext4 preload_a msftdata
56 1792MiB 1984MiB 192MiB cust_a msftdata
57 1984MiB 2128MiB 144MiB odm_a msftdata
58 2128MiB 2256MiB 128MiB ext4 cache msftdata
59 2256MiB 3512MiB 1256MiB preas msftdata
60 3512MiB 3544MiB 32.0MiB preavs msftdata
61 3544MiB 5200MiB 1656MiB product_a msftdata
62 5200MiB 7688MiB 2488MiB ext2 system_a msftdata
63 7688MiB 7888MiB 200MiB ext4 patch_a msftdata
64 7888MiB 122008MiB 114120MiB userdata msftdata
(parted) rm
Partition number? 61
(parted) rm
Partition number? 62
(parted) ?
align-check TYPE N check partition N for TYPE(min|opt) alignment
help [COMMAND] print general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table, available devices, free space, all found
partitions, or a particular partition
quit exit program
rescue START END rescue a lost partition near START and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version display the version number and copyright information of GNU Parted
(parted) quit
Information: You may need to update /etc/fstab.
charlotte:/tmp # gdisk /dev/block/sdd
/sbin/sh: gdisk: not found
127|charlotte:/tmp # ls
fdisk gdisk mkfs.ext4 parted recovery.log twadbfifo
charlotte:/tmp # ./gdisk /dev/block/sdd
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): n
Partition number (61-128, default 61): 61
First sector (34-1968127, default = 907264) or {+-}size{KMGTP}:
Last sector (907264-1968127, default = 1968127) or {+-}size{KMGTP}: +4144MiB
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 0700
Changed type of partition to 'Microsoft basic data'
Command (? for help): c
Partition number (1-64): 61
Enter name: system_a
Command (? for help): p
Disk /dev/block/sdd: 31234048 sectors, 119.1 GiB
Sector size (logical/physical): 4096/4096 bytes
Disk identifier (GUID): F9F21FFF-A8D4-5F0E-9746-594869AEC34E
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 5
First usable sector is 34, last usable sector is 31234047
Partitions will be aligned on 64-sector boundaries
Total free space is 94 sectors (376.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 128 255 512.0 KiB 0700 vrl
2 256 383 512.0 KiB 0700 vrl_backup
3 384 2559 8.5 MiB 0700 modem_secure
4 2560 3839 5.0 MiB 0700 nvme
5 3840 4095 1024.0 KiB 0700 certification
6 4096 20479 64.0 MiB 0700 oeminfo
7 20480 28671 32.0 MiB 0700 secure_storage
8 28672 36863 32.0 MiB 0700 modem_om
9 36864 40959 16.0 MiB 0700 modemnvm_factory
10 40960 45055 16.0 MiB 0700 modemnvm_backup
11 45056 50175 20.0 MiB 0700 modemnvm_img
12 50176 54271 16.0 MiB 0700 modemnvm_system
13 54272 55295 4.0 MiB 0700 hisee_encos
14 55296 55551 1024.0 KiB 0700 veritykey
15 55552 55807 1024.0 KiB 0700 ddr_para
16 55808 62719 27.0 MiB 0700 reserved2
17 62720 83199 80.0 MiB 0700 splash2
18 83200 83711 2.0 MiB 0700 bootfail_info
19 83712 84223 2.0 MiB 0700 misc
20 84224 88319 16.0 MiB 0700 dfx
21 88320 92415 16.0 MiB 0700 rrecord
22 92416 92479 256.0 KiB 0700 fw_lpm3_a
23 92480 93439 3.8 MiB 0700 reserved3_a
24 93440 93695 1024.0 KiB 0700 hdcp_a
25 93696 94719 4.0 MiB 0700 hisee_img_a
26 94720 95743 4.0 MiB 0700 hhee_a
27 95744 97791 8.0 MiB 0700 hisee_fs_a
28 97792 100863 12.0 MiB 0700 fastboot_a
29 100864 101887 4.0 MiB 0700 vector_a
30 101888 102399 2.0 MiB 0700 isp_boot_a
31 102400 105983 14.0 MiB 0700 isp_firmware_a
32 105984 109055 12.0 MiB 0700 fw_hifi_a
33 109056 111103 8.0 MiB 0700 teeos_a
34 111104 115199 16.0 MiB 0700 sensorhub_a
35 115200 121343 24.0 MiB 0700 erecovery_kernel_a
36 121344 129535 32.0 MiB 0700 erecovery_ramdisk_a
37 129536 133631 16.0 MiB 0700 erecovery_vendor_a
38 133632 139775 24.0 MiB 0700 kernel_a
39 139776 142847 12.0 MiB 0700 eng_system_a
40 142848 151039 32.0 MiB 0700 recovery_ramdisk_a
41 151040 155135 16.0 MiB 0700 recovery_vendor_a
42 155136 160511 21.0 MiB 0700 dts_a
43 160512 162303 7.0 MiB 0700 dto_a
44 162304 162815 2.0 MiB 0700 trustfirmware_a
45 162816 177151 56.0 MiB 0700 modem_fw_a
46 177152 180223 12.0 MiB 0700 eng_vendor_a
47 180224 180735 2.0 MiB 0700 recovery_vbmeta_a
48 180736 181247 2.0 MiB 0700 erecovery_vbmeta_a
49 181248 182271 4.0 MiB 0700 vbmeta_a
50 182272 186367 16.0 MiB 0700 modemnvm_update_a
51 186368 196607 40.0 MiB 0700 modemnvm_cust_a
52 196608 204799 32.0 MiB 0700 reserved7
53 204800 212991 32.0 MiB 0700 version_a
54 212992 456703 952.0 MiB 0700 vendor_a
55 456704 458751 8.0 MiB 0700 preload_a
56 458752 507903 192.0 MiB 0700 cust_a
57 507904 544767 144.0 MiB 0700 odm_a
58 544768 577535 128.0 MiB 0700 cache
59 577536 899071 1.2 GiB 0700 preas
60 899072 907263 32.0 MiB 0700 preavs
61 907264 1968127 4.0 GiB 0700 system_a
63 1968128 2019327 200.0 MiB 0700 patch_a
64 2019328 31234047 111.4 GiB 0700 userdata
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/block/sdd.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
charlotte:/tmp # ./parted /dev/block/sdd
GNU Parted 3.2
Using /dev/block/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) set 61
Flag to Invert? msftdata
New state? on/[off]? on
(parted) quit
Information: You may need to update /etc/fstab.
charlotte:/tmp # make_ext4fs /dev/block/sdd61
/sbin/sh: make_ext4fs: not found
127|charlotte:/tmp # ./make_ext4fs /dev/block/sdd61
/sbin/sh: ./make_ext4fs: not found
127|charlotte:/tmp # ls
fdisk gdisk mkfs.ext4 parted recovery.log twadbfifo
charlotte:/tmp # ./mkfs.ext4 /dev/block/sdd61
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done
Creating filesystem with 1060864 4k blocks and 265584 inodes
Filesystem UUID: 198e7d60-8d42-476e-9064-0e1a84b7b969
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
charlotte:/tmp # ./parted /dev/block/sdd
GNU Parted 3.2
Using /dev/block/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: TOSHIBA THGAF8T0T43BAIRB (scsi)
Disk /dev/block/sdd: 128GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 524kB 1049kB 524kB vrl msftdata
2 1049kB 1573kB 524kB vrl_backup msftdata
3 1573kB 10.5MB 8913kB ext4 modem_secure msftdata
4 10.5MB 15.7MB 5243kB nvme msftdata
5 15.7MB 16.8MB 1049kB certification msftdata
6 16.8MB 83.9MB 67.1MB oeminfo msftdata
7 83.9MB 117MB 33.6MB ext4 secure_storage msftdata
8 117MB 151MB 33.6MB ext4 modem_om msftdata
9 151MB 168MB 16.8MB modemnvm_factory msftdata
10 168MB 185MB 16.8MB modemnvm_backup msftdata
11 185MB 206MB 21.0MB ext4 modemnvm_img msftdata
12 206MB 222MB 16.8MB modemnvm_system msftdata
13 222MB 226MB 4194kB hisee_encos msftdata
14 226MB 228MB 1049kB veritykey msftdata
15 228MB 229MB 1049kB ddr_para msftdata
16 229MB 257MB 28.3MB reserved2 msftdata
17 257MB 341MB 83.9MB ext4 splash2 msftdata
18 341MB 343MB 2097kB bootfail_info msftdata
19 343MB 345MB 2097kB misc msftdata
20 345MB 362MB 16.8MB dfx msftdata
21 362MB 379MB 16.8MB rrecord msftdata
22 379MB 379MB 262kB fw_lpm3_a msftdata
23 379MB 383MB 3932kB reserved3_a msftdata
24 383MB 384MB 1049kB hdcp_a msftdata
25 384MB 388MB 4194kB hisee_img_a msftdata
26 388MB 392MB 4194kB hhee_a msftdata
27 392MB 401MB 8389kB ext4 hisee_fs_a msftdata
28 401MB 413MB 12.6MB fastboot_a msftdata
29 413MB 417MB 4194kB vector_a msftdata
30 417MB 419MB 2097kB isp_boot_a msftdata
31 419MB 434MB 14.7MB isp_firmware_a msftdata
32 434MB 447MB 12.6MB fw_hifi_a msftdata
33 447MB 455MB 8389kB teeos_a msftdata
34 455MB 472MB 16.8MB sensorhub_a msftdata
35 472MB 497MB 25.2MB erecovery_kernel_a msftdata
36 497MB 531MB 33.6MB erecovery_ramdisk_a msftdata
37 531MB 547MB 16.8MB erecovery_vendor_a msftdata
38 547MB 573MB 25.2MB kernel_a msftdata
39 573MB 585MB 12.6MB eng_system_a msftdata
40 585MB 619MB 33.6MB recovery_ramdisk_a msftdata
41 619MB 635MB 16.8MB recovery_vendor_a msftdata
42 635MB 657MB 22.0MB dts_a msftdata
43 657MB 665MB 7340kB dto_a msftdata
44 665MB 667MB 2097kB trustfirmware_a msftdata
45 667MB 726MB 58.7MB ext4 modem_fw_a msftdata
46 726MB 738MB 12.6MB eng_vendor_a msftdata
47 738MB 740MB 2097kB recovery_vbmeta_a msftdata
48 740MB 742MB 2097kB erecovery_vbmeta_a msftdata
49 742MB 747MB 4194kB vbmeta_a msftdata
50 747MB 763MB 16.8MB modemnvm_update_a msftdata
51 763MB 805MB 41.9MB modemnvm_cust_a msftdata
52 805MB 839MB 33.6MB reserved7 msftdata
53 839MB 872MB 33.6MB ext4 version_a msftdata
54 872MB 1871MB 998MB vendor_a msftdata
55 1871MB 1879MB 8389kB ext4 preload_a msftdata
56 1879MB 2080MB 201MB cust_a msftdata
57 2080MB 2231MB 151MB odm_a msftdata
58 2231MB 2366MB 134MB ext4 cache msftdata
59 2366MB 3683MB 1317MB preas msftdata
60 3683MB 3716MB 33.6MB preavs msftdata
61 3716MB 8061MB 4345MB ext4 system_a msftdata
63 8061MB 8271MB 210MB ext4 patch_a msftdata
64 8271MB 128GB 120GB userdata msftdata
(parted) quit
charlotte:/tmp #
@mouseos
Copy link
Author

mouseos commented Jun 3, 2024

https://blog.j7b3y.com/posts/2021-10-17-expanding-the-system-partition-of-p30/
上記記事を参考。パーティション番号やパーティションサイズは異なるのでコピペ厳禁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment