我最近在 SD 卡上安装了适用于 raspberry pi 的 android 映像后对其进行了格式化。格式化后,SD 卡未在 中列出fdisk
。我这样做了dmesg
,并得到了以下结果:
[29329.965881] mmc0: new ultra high speed SDR50 SDHC card at address aaaa
[29329.968812] mmcblk0: mmc0:aaaa JULIE 29.7 GiB
[29329.977085] mmcblk0: p1
[29330.280006] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
然后我运行fsck
,得到了这个输出:
fsck from util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/mmcblk0
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
我运行了fdisk
,输出如下:
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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: 5ED03E36-159D-481F-BFFF-FB1F690C6077
Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 781461504 898648063 117186560 55.9G Linux swap
/dev/sda3 1050624 781461503 780410880 372.1G Linux filesystem
Partition table entries are not in disk order.
我想使用 Etcher 向其中写入另一幅图像。但 Etcher 仅进行检查,/dev
因此无法读取卡。因此无法继续刻录。
/media
SD 卡正在加载。之前出现问题时,SD 卡已加载/dev
。尽管它正在加载到媒体中,但我可以复制文件并对其进行更改。如何才能让它像以前一样工作。
编辑
输出mount | grep media
:
/dev/mmcblk0p1 on /media/mi07/E type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
答案1
首先运行正确的 fsck
sudo umount /dev/mmcblk0p1
sudo fsck.fat -V /dev/mmcblk0p1
sudo fsck.fat -a /dev/mmcblk0p1
如果这不起作用,请fsck.vfat
尝试fsck.fat
最后,
您不需要 Etcher 在 SD 卡上“刻录”新的驱动器映像。您可以启动如下命令:
sudo dd if=/path/to/image.img of=/dev/mmcblk0 bs=1M conv=notrunc