本文介绍: 我们要说的是,User Data Partition中的再分区

目录

## 1 emmc

## 2 uboot查看

## 3 kernel查看

方法1 

方法2

方法3

方法4

方法5

方法6

方法7

方法8

方法9

方法10


## 1 emmc

我们要说的是,User Data Partition中的再分区

可简化为

## 2 uboot查看

u-boot=> mmc part

Partition Map for MMC device 2  --   Partition Type: DOS

Part    Start Sector    Num Sectors     UUID            Type
  1     16384           131072          3bb27e95-01     0c
  2     1835008         28942336        3bb27e95-02     83
  3     147456          98304           3bb27e95-03     83
  4     245760          1589248         3bb27e95-04     0f Extd
  5     245762          16382           3bb27e95-05     83
  6     262146          1572862         3bb27e95-06     83

## 3 kernel查看

方法

/proc/partition

root@xboard:~# cat /proc/partitions 
major minor  #blocks  name

  31        0       8192 mtdblock0
 179        0   15388672 mmcblk2
 179        1      65536 mmcblk2p1
 179        2   14471168 mmcblk2p2
 179        3      49152 mmcblk2p3
 179        4          1 mmcblk2p4
 179        5       8191 mmcblk2p5
 179        6     786431 mmcblk2p6
 179       96   31154688 mmcblk1
 179       97      65536 mmcblk1p1
 179       98   31080960 mmcblk1p2

方法2

/dev/block

root@xboard:~# ls -l /dev/block/  
total 0
lrwxrwxrwx 1 root root 10 May 13  2022 179:0 -> ../mmcblk2
lrwxrwxrwx 1 root root 12 Aug 31  2023 179:1 -> ../mmcblk2p1
lrwxrwxrwx 1 root root 12 May 13  2022 179:2 -> ../mmcblk2p2
lrwxrwxrwx 1 root root 12 May 13  2022 179:3 -> ../mmcblk2p3
lrwxrwxrwx 1 root root 15 May 13  2022 179:32 -> ../mmcblk2boot0
lrwxrwxrwx 1 root root 12 May 13  2022 179:4 -> ../mmcblk2p4
lrwxrwxrwx 1 root root 12 May 13  2022 179:5 -> ../mmcblk2p5
lrwxrwxrwx 1 root root 12 May 13  2022 179:6 -> ../mmcblk2p6
lrwxrwxrwx 1 root root 15 May 13  2022 179:64 -> ../mmcblk2boot1
lrwxrwxrwx 1 root root 10 May 13  2022 179:96 -> ../mmcblk1
lrwxrwxrwx 1 root root 12 Aug 31  2023 179:97 -> ../mmcblk1p1
lrwxrwxrwx 1 root root 12 Aug 31  2023 179:98 -> ../mmcblk1p2
lrwxrwxrwx 1 root root 12 May 13  2022 31:0 -> ../mtdblock0
lrwxrwxrwx 1 root root  8 May 13  2022 7:0 -> ../loop0
lrwxrwxrwx 1 root root  8 May 13  2022 7:1 -> ../loop1
lrwxrwxrwx 1 root root  8 May 13  2022 7:2 -> ../loop2
lrwxrwxrwx 1 root root  8 May 13  2022 7:3 -> ../loop3
lrwxrwxrwx 1 root root  8 May 13  2022 7:4 -> ../loop4
lrwxrwxrwx 1 root root  8 May 13  2022 7:5 -> ../loop5
lrwxrwxrwx 1 root root  8 May 13  2022 7:6 -> ../loop6
lrwxrwxrwx 1 root root  8 May 13  2022 7:7 -> ../loop7

root@xboard:~# ls -al /dev/block/179* 
lrwxrwxrwx 1 root root 10 May 13  2022 /dev/block/179:0 -> ../mmcblk2
lrwxrwxrwx 1 root root 12 Aug 31  2023 /dev/block/179:1 -> ../mmcblk2p1
lrwxrwxrwx 1 root root 12 May 13  2022 /dev/block/179:2 -> ../mmcblk2p2
lrwxrwxrwx 1 root root 12 May 13  2022 /dev/block/179:3 -> ../mmcblk2p3
lrwxrwxrwx 1 root root 15 May 13  2022 /dev/block/179:32 -> ../mmcblk2boot0
lrwxrwxrwx 1 root root 12 May 13  2022 /dev/block/179:4 -> ../mmcblk2p4
lrwxrwxrwx 1 root root 12 May 13  2022 /dev/block/179:5 -> ../mmcblk2p5
lrwxrwxrwx 1 root root 12 May 13  2022 /dev/block/179:6 -> ../mmcblk2p6
lrwxrwxrwx 1 root root 15 May 13  2022 /dev/block/179:64 -> ../mmcblk2boot1
lrwxrwxrwx 1 root root 10 May 13  2022 /dev/block/179:96 -> ../mmcblk1
lrwxrwxrwx 1 root root 12 Aug 31  2023 /dev/block/179:97 -> ../mmcblk1p1
lrwxrwxrwx 1 root root 12 Aug 31  2023 /dev/block/179:98 -> ../mmcblk1p2

方法3

mount

cat /proc/mounts

root@xboard:~# mount
/dev/mmcblk2p2 on / type ext4 (rw,relatime)
devtmpfs on /dev type devtmpfs (rw,relatime,size=667872k,nr_inodes=166968,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /var/volatile type tmpfs (rw,relatime)
/dev/mmcblk2p6 on /cache type ext4 (rw,nosuid,nodev,relatime)
/dev/mmcblk2p5 on /run/media/mmcblk2p5 type ext2 (rw,relatime,errors=continue)
/dev/mmcblk1p1 on /run/media/mmcblk1p1 type vfat (rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk2p1 on /run/media/mmcblk2p1 type vfat (rw,relatime,gid=6,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/mmcblk1p2 on /run/media/mmcblk1p2 type ext4 (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=199396k,mode=700)

方法4

dmesg

方法5

fdisk 

root@xboard:~# fdisk -l /dev/mmcblk2
Disk /dev/mmcblk2: 14.69 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3bb27e95

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk2p1        16384   147455   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk2p2      1835008 30777343 28942336 13.8G 83 Linux
/dev/mmcblk2p3       147456   245759    98304   48M 83 Linux
/dev/mmcblk2p4       245760  1835007  1589248  776M  f W95 Ext'd (LBA)
/dev/mmcblk2p5       245762   262143    16382    8M 83 Linux
/dev/mmcblk2p6       262146  1835007  1572862  768M 83 Linux

Partition table entries are not in disk order.

类似的命令还有sfdisk

root@xboard:~# sfdisk -l /dev/mmcblk2
Disk /dev/mmcblk2: 14.69 GiB, 15758000128 bytes, 30777344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3bb27e95

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk2p1        16384   147455   131072   64M  c W95 FAT32 (LBA)
/dev/mmcblk2p2      1835008 30777343 28942336 13.8G 83 Linux
/dev/mmcblk2p3       147456   245759    98304   48M 83 Linux
/dev/mmcblk2p4       245760  1835007  1589248  776M  f W95 Ext'd (LBA)
/dev/mmcblk2p5       245762   262143    16382    8M 83 Linux
/dev/mmcblk2p6       262146  1835007  1572862  768M 83 Linux

Partition table entries are not in disk order.

方法6

sys/class/block

root@xboard:/sys/class/block# ll
total 0
lrwxrwxrwx 1 root root 0 May 13  2022 loop0 -> ../../devices/virtual/block/loop0
lrwxrwxrwx 1 root root 0 May 13  2022 loop1 -> ../../devices/virtual/block/loop1
lrwxrwxrwx 1 root root 0 May 13  2022 loop2 -> ../../devices/virtual/block/loop2
lrwxrwxrwx 1 root root 0 May 13  2022 loop3 -> ../../devices/virtual/block/loop3
lrwxrwxrwx 1 root root 0 May 13  2022 loop4 -> ../../devices/virtual/block/loop4
lrwxrwxrwx 1 root root 0 May 13  2022 loop5 -> ../../devices/virtual/block/loop5
lrwxrwxrwx 1 root root 0 May 13  2022 loop6 -> ../../devices/virtual/block/loop6
lrwxrwxrwx 1 root root 0 May 13  2022 loop7 -> ../../devices/virtual/block/loop7
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b50000.mmc/mmc_host/mmc1/mmc1:59b4/block/mmcblk1
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk1p1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b50000.mmc/mmc_host/mmc1/mmc1:59b4/block/mmcblk1/mmcblk1p1
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk1p2 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b50000.mmc/mmc_host/mmc1/mmc1:59b4/block/mmcblk1/mmcblk1p2
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2boot0 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2boot0
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2boot1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2boot1
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p1 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p1
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p2 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p2
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p3 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p3
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p4 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p4
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p5 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p5
lrwxrwxrwx 1 root root 0 May 13  2022 mmcblk2p6 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30b60000.mmc/mmc_host/mmc2/mmc2:0001/block/mmcblk2/mmcblk2p6
lrwxrwxrwx 1 root root 0 May 13  2022 mtdblock0 -> ../../devices/platform/soc@0/soc@0:bus@30800000/30bb0000.spi/spi_master/spi3/spi3.0/mtd/mtd0/mtdblock0

方法7

root@xboard:~# lsblk
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
mtdblock0     31:0    0    8M  0 disk 
mmcblk2      179:0    0 14.7G  0 disk 
|-mmcblk2p1  179:1    0   64M  0 part /run/media/mmcblk2p1
|-mmcblk2p2  179:2    0 13.8G  0 part /
|-mmcblk2p3  179:3    0   48M  0 part 
|-mmcblk2p4  179:4    0    1K  0 part 
|-mmcblk2p5  179:5    0    8M  0 part /run/media/mmcblk2p5
`-mmcblk2p6  179:6    0  768M  0 part /cache
mmcblk2boot0 179:32   0    4M  1 disk 
mmcblk2boot1 179:64   0    4M  1 disk 
mmcblk1      179:96   0 29.7G  0 disk 
|-mmcblk1p1  179:97   0   64M  0 part /run/media/mmcblk1p1
`-mmcblk1p2  179:98   0 29.7G  0 part /run/media/mmcblk1p

方法8

sudo apt install hwinfo
 

root@xboard:$ hwinfo --disk
49: SCSI 2000.0: 10600 Disk                                     
  [Created at block.245]
  Unique ID: R7kM.nTPZhtpisM9
  Parent ID: 37TO.741NuwlerHD
  SysFS ID: /class/block/sda
  SysFS BusID: 32:0:0:0
  SysFS Device Link: /devices/pci0000:00/0000:00:10.0/host32/target32:0:0/32:0:0:0
  Hardware Class: disk
  Model: "VMware Virtual S"
  Vendor: "VMware,"
  Device: "VMware Virtual S"
  Revision: "1.0"
  Driver: "mptspi", "sd"
  Driver Modules: "mptspi"
  Device File: /dev/sda (/dev/sg1)
  Device Files: /dev/sda, /dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0
  Device Number: block 8:0-8:15 (char 21:1)
  BIOS id: 0x80
  Drive status: no medium
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #7 (SCSI storage controller)

方法9

lshw 

root@xboard:$ sudo lshw -class disk
  *-disk                    
       description: SCSI Disk
       product: VMware Virtual S
       vendor: VMware,
       physical id: 0.0.0
       bus info: scsi@32:0.0.0
       logical name: /dev/sda
       version: 1.0
       size: 100GiB (107GB)
       capabilities: 7200rpm partitioned partitioned:dos
       configuration: ansiversion=2 logicalsectorsize=512 sectorsize=512 signature=e51a4690
  *-cdrom
       description: DVD-RAM writer
       product: VMware SATA CD01
       vendor: NECVMWar
       physical id: 0.0.0
       bus info: scsi@3:0.0.0
       logical name: /dev/cdrom
       logical name: /dev/cdrw
       logical name: /dev/dvd
       logical name: /dev/sr0
       version: 1.00
       capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
       configuration: ansiversion=5 status=open

方法10

root@xboard:$ sudo parted -l
Model: ATA WDC WD10EZEX-75W (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                  Flags
 1      1049kB  538MB   537MB   fat32        EFI System Partition  boot, esp
 2      538MB   1000GB  1000GB  ext4

## 4 参考

【1】eMMC深入浅出 第二章 eMMC结构 第二节 分区以及存储区域 – 知乎

【2】eMMC(二)——分区管理_emmc gpt分区-CSDN博客

原文地址:https://blog.csdn.net/gjianw217/article/details/134142305

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若转载,请注明出处:http://www.7code.cn/show_1028.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注