我的微型 SD 卡已损坏,但我不小心将其拔出。我想搜索并修复任何错误FSCK公用事业。
$ umount /dev/mmcblk0
$ fsck --help
fsck from util-linux 2.29.2
fsck.ext3: invalid option -- 'h'
Usage: fsck.ext3 [-panyrcdfktvDFV] [-b superblock] [-B blocksize]
[-l|-L bad_blocks_file] [-C fd] [-j external_journal]
[-E extended-options] [-z undo_file] device
Emergency help:
-p Automatic repair (no questions)
-n Make no changes to the filesystem
-y Assume "yes" to all questions
-c Check for bad blocks and add them to the badblock list
-f Force checking even if filesystem is marked clean
-v Be verbose
-b superblock Use alternative superblock
-B blocksize Force blocksize when looking for superblock
-j external_journal Set location of the external journal
-l bad_blocks_file Add to badblocks list
-L bad_blocks_file Set badblocks list
-z undo_file Create an undo file
$ fsck /dev/mmcblk0
fsck from util-linux 2.29.2
exfatfsck 1.2.6
Checking file system on /dev/mmcblk0.
File system version 1.0
Sector size 512 bytes
Cluster size 128 KB
Volume size 59 GB
Used space 25 GB
Available space 35 GB
ERROR: unknown entry type 0x86.
ERROR: cluster 0x111ee of file 'expunged' is not allocated.
Totally 260 directories and 3182 files.
File system checking finished. ERRORS FOUND: 2.
$ fsck -p /dev/mmcblk0
fsck from util-linux 2.29.2
exfatfsck 1.2.6
fsck.exfat: invalid option -- 'p'
Usage: fsck.exfat [-V] <device>
-p
当帮助中说选项无效时,为什么选项无效Automatic repair (no questions)
?那么我该如何修复我的 SD 卡呢?
答案1
查看两种情况下输出的第二行。fsck --help
使用fsck.ext3
(系统上的默认设置)并显示对该工具有效的选项,但fsck -p /dev/mmcblk0
使用exfatfsck
它是因为这适合您的 SD 卡。
很遗憾exfatfsck
无法修复错误,它只能报告它们。所以跑
fsck /dev/mmcblk0
查看是否有任何错误;如果有,您将需要一些其他策略来修复文件系统:
- 使用另一个带有能够修复文件系统的工具的操作系统(Windows?);
- 或者在 Linux 上,将所有文件复制到其他位置并重新格式化卡。