我的 SD 卡有一些问题,但我无法修复它们。
这是磁盘在 GNOME 磁盘中的样子:
当我运行时gdisk /dev/sdb
,它给出以下输出:
sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.3
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.
Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: hybrid
BSD: not present
APM: not present
GPT: damaged
Found valid MBR and corrupt GPT. Which do you want to use? (Using the
GPT MAY permit recovery of GPT data.
我不确定应该使用哪个分区表,但我使用了 GPT(创建空白 GPT 没有帮助)分区如下所示:
Command (? for help): p
Disk /dev/sdb: 125067264 sectors, 59.6 GiB
Model: Multi-Card
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 76A0F070-E171-475B-9409-53840D61AD12
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 4194270
Partitions will be aligned on 2048-sector boundaries
Total free space is 671677 sectors (328.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 67583 32.0 MiB 0C01 hassos-boot
2 67584 116735 24.0 MiB 8300 hassos-kernel0
3 116736 641023 256.0 MiB 8300 hassos-system0
4 641024 690175 24.0 MiB 8300 hassos-kernel1
5 690176 1214463 256.0 MiB 8300 hassos-system1
6 1214464 1230847 8.0 MiB 8300 hassos-bootstate
7 1230848 1427455 96.0 MiB 8300 hassos-overlay
8 1427456 3524607 1024.0 MiB 8300 hassos-data
当我想验证磁盘时,我会得到这个信息:
Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.
Problem: The secondary header's self-pointer indicates that it does not reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.
Identified 2 problems!
我可以设法解决这些问题,然后我得到了这个按摩:
No problems found. 121544637 free sectors (58.0 GiB) available in 2
segments, the largest of which is 121542623 (58.0 GiB) in size.
但在写完之后我得到了这个:
OK: writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.
但是当我再次检查分区时,它仍然是一样的。我试图一个一个地删除所有分区,然后创建一个新的空 GUID 分区表,但写完后我得到了这个:
OK: writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.
但是当我再次检查分区时,它仍然是一样的。我认为这是因为混合 MBR 和损坏的 GPT。有没有办法同时删除这两个表?或者我还能做些什么来解决这个问题?
提前致谢
我实际上最近遇到了同样的问题。您的 SD 卡可能处于某种写保护模式。可能的原因:
在我的例子中,闪存盘控制器在闪存出现故障后默默地丢弃了我的写入,因此即使写入看起来成功,但损坏的分区表在下一次读取时又回来了。
如果您的 SD 卡出现这种情况,很可能是它发生了故障,您需要换一张新卡。
我怀疑您遇到了第一个问题,因为如果写保护开关处于活动状态,您会看到某种“只读”通知,因为 Linux 可以检测闪存盘或 SD 卡是否被写保护。(见
/var/log/syslog
)写保护闪存驱动器示例
/dev/sdc
:演示
/dev/sdb
是我损坏的闪存驱动器静静地丢弃了写入。尝试清除分区表:
坏分区表立即返回:
擦除磁盘的开头
dd
也没有任何效果: