SD卡mmcblk0: unknown partition table问题

本文介绍了解决SD卡插入时提示未知分区表错误的方法,包括使用fdisk工具格式化SD卡并创建正确分区的过程。

表现:

1、插入SD卡时提示mmcblk0: unknown partition table

2、dev下只有mmcblk0,没有mmcblk0p1

3、偶尔识别了,并挂载了,ls查看会提示如图所示错误

        

 

解决办法:采用fdisk格式化SD卡,创建分区

在PC上,sudo fdisk -l看SD卡对应的分区,比如8G的卡会显示,对应的即为sdb

执行

sudo fdisk /dev/sdb

输入m会出现命令类表,简洁而强大

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

输入p查看当前sd卡的分区(partition)信息

Command (m for help): p

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 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
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     1048576      523264+   c  W95 FAT32 (LBA)
/dev/sdb2         1048577    15523839     7237631+  83  Linux

其中,需要记住的是他的容量7948206080 bytes之后会用到。
同时也留意他的heads和setcors/track

删除分区


输入d删除(delete)所有sd卡分区。因为有2个分区,需要删除2次

Command (m for help): d
Partition number (1-4): 1

Command (m for help): d
Selected partition 2

建立扇区


如果SD卡不是255 heads, 63 sectors/track,按照以下步骤建立扇区

输入x进入扩展命令列表

Command (m for help): x

Expert command (m for help): 

输入m显示扩展命令列表

Command action
   b   move beginning of data in a partition
   c   change number of cylinders
   d   print the raw data in the partition table
   e   list extended partitions
   f   fix partition order
   g   create an IRIX (SGI) partition table
   h   change number of heads
   i   change the disk identifier
   m   print this menu
   p   print the partition table
   q   quit without saving changes
   r   return to main menu
   s   change number of sectors/track
   v   verify the partition table
   w   write table to disk and exit

输入h设置heads = 255

Expert command (m for help): h
Number of heads (1-256, default 245): 255

输入s设置sectors/track = 63

Expert command (m for help): s
Number of sectors (1-63, default 62): 63

输入c设置cylinder = 966

Expert command (m for help): c
Number of cylinders (1-1048576, default 1021): 966

cylinder计算方法

cylinder = SD卡容量(bytes) / heads / sectors / 512(bytes)
cylinder = 7948206080 / 255 /63 / 512 = 966.3 = 966 

输入r返回(return)普通命令

Expert command (m for help): r

Command (m for help):

输入p再次查看当前sd卡的分区信息。
此时你会看到heads, sectors/track, cylinder都已经更新了

Command (m for help): p

Disk /dev/sdb: 7948 MB, 7948206080 bytes
255 heads, 63 sectors/track, 966 cylinders, total 15523840 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
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System

建立分区


输入n新建(new)一个分区

输入p选择新建一个主分区

输入1创建分区1

输入分区1的‘First sector’和‘Last sector’

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-15523839, default 2048): 2048
Last sector, +sectors or +size{K,M,G} (2048-15523839, default 15523839): 
Using default value 15523839

输入t改变分区系统ID,
一般windows的用,则输入分区类型码cFAT32,
而linux的为默认的分区类型码83EXT3

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

输入a激活分区的bootable标志

Command (m for help): a
Partition number (1-4): 1

输入w将建立完成对分区表写入sd卡,并退出

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

格式化分区

重新运行sudo fdisk -l

会发现对应的是sdb1,进行格式化操作:

sudo mkfs.vfat /dev/sdb1

至此,SD卡又可以重新正常被使用了~

 

 

 

[11:00:47.201] DDR Version 2.12 20190926 [11:00:47.201] In [11:00:47.206] ID:0xFFF [11:00:47.206] 1A1A1A1B 3 [11:00:47.206] DDR3 [11:00:47.206] 1A1B1A1B F [11:00:47.212] Bus Width=32 Col=10 Bank=8 Row=14 CS=1 Die Bus-Width=16 Size=512MB [11:00:47.218] mach:1 [11:00:47.218] OUT [11:00:47.393] Boot1 Release Time: Sep 25 2020 14:49:05, version: 2.63 [11:00:47.398] ChipType = 0xa, 2278 [11:00:47.432] mmc2:cmd19,100 [11:00:47.432] SdmmcInit=2 0 [11:00:47.432] BootCapSize=1000 [11:00:47.438] UserCapSize=3776\CD&\A7\AC\8B\C5,20 [11:00:47.519] SdmmcInit=0 1 [11:00:47.519] StorageInit ok = 125713 [11:00:47.526] SecureMode = 0 [11:00:47.526] Secure read: 4 128636 [11:00:47.526] mmc2:cmd18,10 [11:00:47.526] mmc2:cmd12,20 [11:00:47.526] _DataErrorHandle SEND STATUS ret=20 [11:00:47.533] Secure read: 404 136468 [11:00:47.533] Secure read: 804 138895 [11:00:47.541] Secure read: c04 140971 [11:00:47.541] Secure read: 1004 143139 [11:00:47.541] Secure read: 1404 145392 [11:00:47.541] Secure read: 1804 147683 [11:00:47.549] Secure read: 1c04 149938 [11:00:47.549] SecureInit ret = 0, SecureMode = 0 [11:00:47.556] GPT part: 0, name: uboot, start:0x2000, size:0x1000 [11:00:47.564] GPT part: 1, name: trust, start:0x3000, size:0x1000 [11:00:47.564] GPT part: 2, name: misc, start:0x4000, size:0x800 [11:00:47.571] GPT part: 3, name: boot, start:0x4800, size:0x6800 [11:00:47.580] GPT part: 4, name: recovery, start:0xb000, size:0xa000 [11:00:47.580] GPT part: 5, name: rootfs, start:0x15000, size:0x60000 [11:00:47.590] GPT part: 6, name: oem, start:0x75000, size:0x90000 [11:00:47.600] GPT part: 7, name: userdata, start:0x105000, size:0x65afdf [11:00:47.600] find part:uboot OK. first_lba:0x2000. [11:00:47.600] find part:trust OK. first_lba:0x3000. [11:00:47.632] LOADER Check OK! 0x2000, 238620 [11:00:47.654] TOS Check OK! 0x3000, 260506 [11:00:47.662] Enter Trust OS [11:00:47.671] INF [0x0] TEE-CORE:init_primary_helper:385: Core0 Initializing (1.1.0-449-g24f5da14f #hisping.lin #1 Mon Aug 14 06:20:42 UTC 2023 arm) [11:00:47.689] [11:00:47.689] INF [0x0] TEE-CORE:init_primary_helper:386: Release version: 1.2 [11:00:47.689] [11:00:47.689] INF [0x0] TEE-CORE:init_primary_helper:387: Next entry point address: 0x60000000 [11:00:47.700] [11:00:47.700] INF [0x0] TEE-CORE:init_teecore:83: teecore inits done [11:00:47.723] [11:00:47.768] [11:00:47.768] U-Boot 2017.09-230909-dirty #joss (Feb 07 2025 - 14:52:30 +0800) [11:00:47.778] [11:00:47.778] Model: Rockchip RK3126 Evaluation board [11:00:47.778] MPIDR: 0x80000f00 [11:00:47.789] Serial: rawDRAM: 497.9 MiB [11:00:47.799] Sysmem: init [11:00:47.799] Relocation Offset: 1dc24000 [11:00:47.799] Relocation fdt: 7bc19eb0 - 7bc1aded [11:00:47.875] CR: M/C/I [11:00:47.884] DM: v1 [11:00:47.884] rk3036_pll_set_rate: wait pll lock timeout! pll_id=0 [11:00:47.895] rk3036_pll_set_rate: wait pll lock timeout! pll_id=2 [11:00:47.895] dwmmc@1021c000: 0 [11:00:47.895] MMC Device 1 not found [11:00:47.895] no mmc device at slot 1 [11:00:47.938] switch to partitions #0, OK [11:00:47.938] mmc0(part 0) is current device [11:00:47.947] Bootdev(scan): mmc 0 [11:00:47.947] MMC0: High Speed, 52Mhz [11:00:47.947] PartType: EFI [11:00:47.984] MMC error: The cmd index is 17, ret is -110 [11:00:48.044] MMC error: The cmd index is 0, ret is -110 [11:00:48.051] mmc_init: -110, time 61 [11:00:48.051] *** ERROR: Can't read MBR header *** [11:00:48.061] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.105] MMC error: The cmd index is 16, ret is -110 [11:00:48.111] *** ERROR: Can't read MBR header *** [11:00:48.111] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.164] MMC error: The cmd index is 16, ret is -110 [11:00:48.170] *** ERROR: Can't read MBR header *** [11:00:48.170] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.223] MMC error: The cmd index is 16, ret is -110 [11:00:48.230] *** ERROR: Can't read MBR header *** [11:00:48.230] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.282] MMC error: The cmd index is 16, ret is -110 [11:00:48.289] *** ERROR: Can't read MBR header *** [11:00:48.289] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.341] MMC error: The cmd index is 16, ret is -110 [11:00:48.348] *** ERROR: Can't read MBR header *** [11:00:48.348] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.400] MMC error: The cmd index is 16, ret is -110 [11:00:48.409] *** ERROR: Can't read MBR header *** [11:00:48.409] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.459] MMC error: The cmd index is 16, ret is -110 [11:00:48.466] *** ERROR: Can't read MBR header *** [11:00:48.466] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.478] No misc partition [11:00:48.478] boot mode: None [11:00:48.521] MMC error: The cmd index is 16, ret is -110 [11:00:48.529] *** ERROR: Can't read MBR header *** [11:00:48.529] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.580] MMC error: The cmd index is 16, ret is -110 [11:00:48.586] *** ERROR: Can't read MBR header *** [11:00:48.586] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.639] MMC error: The cmd index is 16, ret is -110 [11:00:48.647] *** ERROR: Can't read MBR header *** [11:00:48.647] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.698] MMC error: The cmd index is 16, ret is -110 [11:00:48.704] *** ERROR: Can't read MBR header *** [11:00:48.704] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.757] MMC error: The cmd index is 16, ret is -110 [11:00:48.763] *** ERROR: Can't read MBR header *** [11:00:48.763] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.816] MMC error: The cmd index is 16, ret is -110 [11:00:48.823] *** ERROR: Can't read MBR header *** [11:00:48.823] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.876] MMC error: The cmd index is 16, ret is -110 [11:00:48.883] *** ERROR: Can't read MBR header *** [11:00:48.883] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:48.935] MMC error: The cmd index is 16, ret is -110 [11:00:48.942] *** ERROR: Can't read MBR header *** [11:00:48.942] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:48.954] Failed to load DTB, ret=-19 [11:00:48.954] No valid DTB, ret=-22 [11:00:48.954] Failed to get kernel dtb, ret=-22 [11:00:49.002] MMC error: The cmd index is 16, ret is -110 [11:00:49.009] *** Warning - read failed, using default environment [11:00:49.009] [11:00:49.019] Model: Rockchip RK3126 Evaluation board [11:00:49.019] MPIDR: 0x80000f00 [11:00:49.069] MMC error: The cmd index is 16, ret is -110 [11:00:49.120] MMC error: The cmd index is 16, ret is -110 [11:00:49.127] rockchip_set_ethaddr: vendor_storage_write failed -5 [11:00:49.176] MMC error: The cmd index is 16, ret is -110 [11:00:49.227] MMC error: The cmd index is 16, ret is -110 [11:00:49.235] *** ERROR: Can't read MBR header *** [11:00:49.235] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.285] MMC error: The cmd index is 16, ret is -110 [11:00:49.293] *** ERROR: Can't read MBR header *** [11:00:49.293] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.345] MMC error: The cmd index is 16, ret is -110 [11:00:49.352] *** ERROR: Can't read MBR header *** [11:00:49.352] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.404] MMC error: The cmd index is 16, ret is -110 [11:00:49.411] *** ERROR: Can't read MBR header *** [11:00:49.411] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.463] MMC error: The cmd index is 16, ret is -110 [11:00:49.471] *** ERROR: Can't read MBR header *** [11:00:49.471] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.522] MMC error: The cmd index is 16, ret is -110 [11:00:49.529] *** ERROR: Can't read MBR header *** [11:00:49.529] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.581] MMC error: The cmd index is 16, ret is -110 [11:00:49.588] *** ERROR: Can't read MBR header *** [11:00:49.588] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.640] MMC error: The cmd index is 16, ret is -110 [11:00:49.647] *** ERROR: Can't read MBR header *** [11:00:49.647] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.658] CLK: (uboot. arm: enter 300000 KHz, init 600000 KHz, kernel 0N/A) [11:00:49.658] apll 600000 KHz [11:00:49.658] dpll 600000 KHz [11:00:49.668] cpll 400000 KHz [11:00:49.668] gpll 594000 KHz [11:00:49.668] armclk 600000 KHz [11:00:49.668] aclk_cpu 148500 KHz [11:00:49.668] hclk_cpu 74250 KHz [11:00:49.668] pclk_cpu 74250 KHz [11:00:49.679] aclk_peri 148500 KHz [11:00:49.679] hclk_peri 74250 KHz [11:00:49.679] pclk_peri 74250 KHz [11:00:49.724] MMC error: The cmd index is 16, ret is -110 [11:00:49.731] *** ERROR: Can't read MBR header *** [11:00:49.731] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.783] MMC error: The cmd index is 16, ret is -110 [11:00:49.792] *** ERROR: Can't read MBR header *** [11:00:49.792] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.842] MMC error: The cmd index is 16, ret is -110 [11:00:49.848] *** ERROR: Can't read MBR header *** [11:00:49.848] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:49.901] MMC error: The cmd index is 16, ret is -110 [11:00:49.908] *** ERROR: Can't read MBR header *** [11:00:49.908] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:49.918] Net: Net Initialization Skipped [11:00:49.918] No ethernet found. [11:00:49.918] Hit key to stop autoboot('CTRL+C'): 0 [11:00:49.969] MMC error: The cmd index is 16, ret is -110 [11:00:49.976] *** ERROR: Can't read MBR header *** [11:00:49.976] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.028] MMC error: The cmd index is 16, ret is -110 [11:00:50.035] *** ERROR: Can't read MBR header *** [11:00:50.035] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.087] MMC error: The cmd index is 16, ret is -110 [11:00:50.094] *** ERROR: Can't read MBR header *** [11:00:50.094] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.146] MMC error: The cmd index is 16, ret is -110 [11:00:50.152] *** ERROR: Can't read MBR header *** [11:00:50.152] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.162] Could not find misc partition [11:00:50.162] ANDROID: reboot reason: "(none)" [11:00:50.162] optee api revision: 2.0 [11:00:50.214] MMC error: The cmd index is 16, ret is -110 [11:00:50.222] *** ERROR: Can't read MBR header *** [11:00:50.222] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.273] MMC error: The cmd index is 16, ret is -110 [11:00:50.280] *** ERROR: Can't read MBR header *** [11:00:50.280] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.332] MMC error: The cmd index is 16, ret is -110 [11:00:50.339] *** ERROR: Can't read MBR header *** [11:00:50.339] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.391] MMC error: The cmd index is 16, ret is -110 [11:00:50.398] *** ERROR: Can't read MBR header *** [11:00:50.398] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.410] TEEC: Waring: Could not find security partition [11:00:50.456] MMC error: The cmd index is 16, ret is -110 [11:00:50.464] *** ERROR: Can't read MBR header *** [11:00:50.464] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.514] MMC error: The cmd index is 16, ret is -110 [11:00:50.522] *** ERROR: Can't read MBR header *** [11:00:50.522] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.574] MMC error: The cmd index is 16, ret is -110 [11:00:50.581] *** ERROR: Can't read MBR header *** [11:00:50.581] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.633] MMC error: The cmd index is 16, ret is -110 [11:00:50.641] *** ERROR: Can't read MBR header *** [11:00:50.641] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.652] Not AVB images, AVB skip [11:00:50.695] MMC error: The cmd index is 16, ret is -110 [11:00:50.702] *** ERROR: Can't read MBR header *** [11:00:50.702] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.754] MMC error: The cmd index is 16, ret is -110 [11:00:50.761] *** ERROR: Can't read MBR header *** [11:00:50.761] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.813] MMC error: The cmd index is 16, ret is -110 [11:00:50.820] *** ERROR: Can't read MBR header *** [11:00:50.820] part_get_info_efi: *** ERROR: Invalid GPT *** [11:00:50.872] MMC error: The cmd index is 16, ret is -110 [11:00:50.880] *** ERROR: Can't read MBR header *** [11:00:50.880] part_get_info_efi: *** ERROR: Invalid Backup GPT *** [11:00:50.891] android_image_load_by_partname: Can't find part: boot [11:00:50.891] Android image load failed [11:00:50.891] Android boot failed, error -1. [11:00:50.891] Unknown command 'boot_fit' - try 'help' [11:00:50.945] MMC error: The cmd index is 16, ret is -110 [11:00:50.952] *** ERROR: Can't read MBR header *** [11:00:50.952] part_get_info_efi: *** ERROR: Invalid GPT ***
08-14
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值