Gnu parted example

From Toshiba AC100 wiki
Jump to navigation Jump to search

example of gnu parted usage

  • 8GB emmc example
parted /dev/mmcblk1 print

Model: MMC SEM08G (sd/mmc)
Disk /dev/mmcblk1: 7944MB
Sector size (logical/physical): 512B/512B
Partition table: gpt
Disk Flags:

Number  Start   End      Size    File system  Name   Flags
 1      3670kB  8913kB   5343kB  ext2         SOS
 2      8913kB  17.3MB   8389kB  ext2         LNX
 3      18.4MB  556MB    537MB   ext4         APP
 4      556MB   975MB    419MB   ext4         CAC
 5      975MB   977MB    2097kB               MSC
 6      978MB   5172MB   4194MB  ext4         UDA
 7      5173MB  7942MB   2769MB               UDB
  • Delete current partitions with parted
parted /dev/mmcblk1 rm 7 rm 6 rm 5 rm 4 rm 3 rm 2 rm 1
  • Create new table
parted /dev/mmcblk1 mklabel gpt
  • Create partitions, android oldschool variant
parted /dev/mmcblk1 mkpart SOS ext2 3670kB 8913kB
parted /dev/mmcblk1 mkpart LNX ext2 8913kB 17.3MB
parted /dev/mmcblk1 mkpart APP ext4 18.4MB 556MB
parted /dev/mmcblk1 mkpart CAC ext4 556MB 975MB
parted /dev/mmcblk1 mkpart MSC ext4 975MB 977MB
parted /dev/mmcblk1 mkpart UDA ext4 978MB 5172MB
parted /dev/mmcblk1 mkpart UDB ext4 5173MB 7942MB

new fs size

  • New sizes for test
1 3670kB 68MB
2 68MB 132MB
3 132MB 644MB
4 644MB 1156MB
5 1156MB 1158MB
6 1158MB 3942MB
7 3942MB 7942MB

  • Create script
parted /dev/mmcblk1 print
#parted /dev/mmcblk1 -s rm 7 rm 6 rm 5 rm 4 rm 3 rm 2 rm 1
parted /dev/mmcblk1 mklabel gpt
parted /dev/mmcblk1 -s mkpart primary 3670kB 68MB 
parted /dev/mmcblk1 -s mkpart primary 68MB 132MB
parted /dev/mmcblk1 -s mkpart primary 132MB 644MB
parted /dev/mmcblk1 -s mkpart primary 644MB 1156MB
parted /dev/mmcblk1 -s mkpart primary 1156MB 1158MB
parted /dev/mmcblk1 -s mkpart primary 1158MB 3942MB
parted /dev/mmcblk1 -s mkpart primary 3942MB 7943MB
parted /dev/mmcblk1 -s name 1 SOS name 2 LNX name 3 APP name 4 CAC name 5 MSC name 6 UDA name 7 UDB
parted /dev/mmcblk1 print
#mkfs.ext2 /dev/mmcblk1p1
#mkfs.ext2 /dev/mmcblk1p2
#mkfs.ext4 /dev/mmcblk1p3
#mkfs.ext4 /dev/mmcblk1p4
#mkfs.ext4 /dev/mmcblk1p6