无法使用 gparted 和 fdisk 保存分区表并格式化 SD 卡

无法使用 gparted 和 fdisk 保存分区表并格式化 SD 卡

我有一张 SanDisk 32 GB microSD 卡,一直用于我的智能手机。几天前,SD 卡崩溃了,我无法访问卡上的任何文件。

我尝试使用 testdisk 实用程序,因为我之前确实使用它来拯救我的 pendrive 数据,但是 testdisk 无法访问任何分区。

然后我尝试使用 fdisk 并删除该分区并创建一个新分区:

Disk /dev/sdb: 29.7 GiB, 31914983424 bytes, 62333952 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: gpt
Disk identifier: 5CB171C8-5A20-4253-9A15-61DF908359A5

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048    34815    32768   16M unknown
/dev/sdb2  34816 62333918 62299103 29.7G unknown
d
Partition number (1,2, default 2): 1

Partition 1 has been deleted.

Command (m for help): d
Selected partition 2
Partition 2 has been deleted.
Command (m for help): n
Partition number (1-128, default 1): 1    
First sector (34-62333918, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-62333918, default 62333918): 
Created a new partition 1 of type 'Linux filesystem' and of size 29.7 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

现在应该已经创建一个分区并将其保存到分区表中,但是现在当我再次运行 fdisk 并查看分区表时,SD 卡仍然有两个未知类型的分区。

Device     Start      End  Sectors  Size Type
/dev/sdb1   2048    34815    32768   16M unknown
/dev/sdb2  34816 62333918 62299103 29.7G unknown

我尝试使用 gparted 做同样的事情,将分区格式化为 NTFS 或 Fat 文件格式,它运行了完整的过程并显示成功消息,但它又回到了同样的情况。

有什么东西阻止我在 SD 卡上写入内容,好像它是只读的,所以我尝试了在互联网上找到的解决方案:

sudo hdparm -r0 /dev/sdb
/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)

现在,当我重复所有步骤时,没有任何区别。我想知道发生了什么。我现在不关心数据,正如你一定已经意识到的那样,我只想知道我是否可以再次使用该卡。

这实际上也非常有趣,卡内部发生了什么,导致它变成只读?

答案1

您是否启用了 SD 卡边缘的锁定开关?这将从硬件角度将其设置为只读。

相关内容