我错误地格式化了 USB 闪存盘,系统无法识别它

我错误地格式化了 USB 闪存盘,系统无法识别它

我想格式化闪存驱动器,但不小心删除了它的文件系统或类似的东西。现在系统无法识别闪存驱动器,如何恢复它?

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000efcdb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1       60307   484408320   83  Linux
/dev/sda2           60307       60802     3975169    5  Extended
/dev/sda5           60307       60802     3975168   82  Linux swap / Solaris

Disk /dev/sdb: 4073 MB, 4073717760 bytes
126 heads, 62 sectors/track, 1018 cylinders
Units = cylinders of 7812 * 512 = 3999744 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007dd56

   Device Boot      Start         End      Blocks   Id  System

答案1

如果您想要格式化它,即不恢复 pen-drive 上的数据,请使用以下命令。从您的 fdisk 输出来看,驱动器似乎位于/etc/sdb。您可能需要仔细检查一下。

现在将其格式化为 ext3(仅适用于 Ubuntu),执行:

$ sudo mkfs.ext3 /dev/sdb

如果要创建 NTFS 文件系统(用于 Ubuntu 和 Windows),请执行:

$ sudo mkfs.ntfs /dev/sdb

答案2

@BloodPhilia 给出了正确的答案,但有一个警告:

如果您想在更广泛的系统上使用此功能,您可能需要使用 FAT 而不是 NTFS;从我手头的几个系统来看,FAT 似乎是 SD 卡和笔式驱动器的默认格式。

此外,至少在过去,不建议在可移动媒体上使用 NTFS。

在 CentOS 上,该命令为:

$ sudo mkfs.vfat /dev/sdb

在其他情况下,它可能是“mkfs.msdos”。

相关内容