昨天我自己超频了我的树莓派 2。不过我也增加了 sd_freq。现在,重新启动后,我的 microSD 卡已安装为只读。我有一台安装了 Linux 的笔记本电脑,我可以尝试修复它。
这是 fsck:
fsck /dev/sdb6
fsck von util-linux 2.25.1
e2fsck 1.42.10 (18-May-2014)
fsck.ext2: Datei oder Verzeichnis nicht gefunden beim Versuch, /dev/sdb6 zu öffnen
Ist das Gerät möglicherweise nicht vorhanden?
那是德语。其翻译如下:
File or directory not found. Failed to open /dev/sdb6
Does the device exist?
但是,如果我运行dmesg
,我知道笔记本电脑会看到 microSD 卡出现错误:
[ 2927.961523] JFS: nTxBlock = 8192, nTxLock = 65536
[ 2928.079252] ntfs: driver 2.1.31 [Flags: R/O MODULE].
[ 2928.297070] QNX4 filesystem 0.2.3 registered.
[ 2928.459834] raid6: mmxx1 346 MB/s
[ 2928.516455] raid6: mmxx2 679 MB/s
[ 2928.573186] raid6: sse1x1 114 MB/s
[ 2928.630046] raid6: sse1x2 191 MB/s
[ 2928.686624] raid6: sse2x1 175 MB/s
[ 2928.743233] raid6: sse2x2 343 MB/s
[ 2928.799919] raid6: int32x1 171 MB/s
[ 2928.856656] raid6: int32x2 240 MB/s
[ 2928.913079] raid6: int32x4 282 MB/s
[ 2928.969883] raid6: int32x8 269 MB/s
[ 2928.969891] raid6: using algorithm mmxx2 (679 MB/s)
[ 2928.969896] raid6: using ssse3x1 recovery algorithm
[ 2928.997412] xor: measuring software checksum speed
[ 2929.029731] pIII_sse : 4652.400 MB/sec
[ 2929.063063] prefetch64-sse: 5186.400 MB/sec
[ 2929.063071] xor: using function: prefetch64-sse (5186.400 MB/sec)
[ 2929.319852] Btrfs loaded
[ 2929.678921] EXT4-fs (sda2): unable to read superblock
[ 2929.685504] EXT4-fs (sda2): unable to read superblock
[ 2929.692989] EXT4-fs (sda2): unable to read superblock
[ 2929.699864] FAT-fs (sda2): invalid media value (0x39)
[ 2929.699876] FAT-fs (sda2): Can't find a valid FAT filesystem
[ 2929.720715] XFS (sda2): Invalid superblock magic number
[ 2929.733631] FAT-fs (sda2): invalid media value (0x39)
[ 2929.733643] FAT-fs (sda2): Can't find a valid FAT filesystem
[ 2929.752486] MINIX-fs: unable to read superblock
[ 2929.789860] attempt to access beyond end of device
[ 2929.789873] sda2: rw=16, want=3, limit=2
[ 2929.789883] hfsplus: unable to find HFS+ superblock
[ 2929.798484] qnx4: no qnx4 filesystem (no root dir).
[ 2929.804082] ufs: You didn't specify the type of your ufs filesystem
mount -t ufs -o ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...
>>>WARNING<<< Wrong ufstype may corrupt your filesystem, default is ufstype=old
[ 2929.816251] hfs: can't find a HFS filesystem on dev sda2
[ 2932.646443] audit: type=1400 audit(1430243601.363:38): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/ntpd" pid=24052 comm="apparmor_parser"
[ 2947.369673] audit: type=1400 audit(1430243616.083:39): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/tcpdump" pid=27551 comm="apparmor_parser"
[ 2993.836057] EXT4-fs (sda2): unable to read superblock
[ 2993.842237] EXT4-fs (sda2): unable to read superblock
[ 2993.849180] EXT4-fs (sda2): unable to read superblock
[ 2993.856179] FAT-fs (sda2): invalid media value (0x39)
[ 2993.856192] FAT-fs (sda2): Can't find a valid FAT filesystem
[ 2993.876759] XFS (sda2): Invalid superblock magic number
[ 2993.890830] FAT-fs (sda2): invalid media value (0x39)
[ 2993.890849] FAT-fs (sda2): Can't find a valid FAT filesystem
[ 2993.907427] MINIX-fs: unable to read superblock
[ 2993.913828] attempt to access beyond end of device
[ 2993.913841] sda2: rw=16, want=3, limit=2
[ 2993.913851] hfsplus: unable to find HFS+ superblock
[ 2993.920820] qnx4: no qnx4 filesystem (no root dir).
[ 2993.926967] ufs: You didn't specify the type of your ufs filesystem
mount -t ufs -o ufstype=sun|sunx86|44bsd|ufs2|5xbsd|old|hp|nextstep|nextstep-cd|openstep ...
>>>WARNING<<< Wrong ufstype may corrupt your filesystem, default is ufstype=old
[ 2993.940394] hfs: can't find a HFS filesystem on dev sda2
[ 3039.949647] audit: type=1400 audit(1430243708.663:40): apparmor="STATUS" operation="profile_replace" name="/usr/lib/cups/backend/cups-pdf" pid=5275 comm="apparmor_parser"
[ 3039.949668] audit: type=1400 audit(1430243708.663:41): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/cupsd" pid=5275 comm="apparmor_parser"
[ 3039.960604] audit: type=1400 audit(1430243708.676:42): apparmor="STATUS" operation="profile_replace" name="third_party" pid=5275 comm="apparmor_parser"
[ 9265.005906] usb 1-2: new high-speed USB device number 4 using ehci-pci
[ 9265.131405] usb 1-2: New USB device found, idVendor=058f, idProduct=6366
[ 9265.131425] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9265.131439] usb 1-2: Product: Mass Storage Device
[ 9265.131451] usb 1-2: Manufacturer: Generic
[ 9265.131463] usb 1-2: SerialNumber: 058F0O1111B1
[ 9265.405525] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 9265.405824] scsi host2: usb-storage 1-2:1.0
[ 9265.406931] usbcore: registered new interface driver usb-storage
[ 9265.438871] usbcore: registered new interface driver uas
[ 9266.410221] scsi 2:0:0:0: Direct-Access Multi Flash Reader 1.00 PQ: 0 ANSI: 0
[ 9266.411635] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 9266.892135] sd 2:0:0:0: [sdb] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
[ 9266.893257] sd 2:0:0:0: [sdb] Write Protect is off
[ 9266.893273] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 9266.894373] sd 2:0:0:0: [sdb] No Caching mode page found
[ 9266.894385] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 9266.909425] sdb: [CUMANA/ADFS] sdb1 [ADFS] sdb1
[ 9266.914006] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 9473.723355] usb 1-2: USB disconnect, device number 4
[ 9478.755845] usb 1-2: new high-speed USB device number 5 using ehci-pci
[ 9478.881334] usb 1-2: New USB device found, idVendor=058f, idProduct=6366
[ 9478.881353] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9478.881367] usb 1-2: Product: Mass Storage Device
[ 9478.881379] usb 1-2: Manufacturer: Generic
[ 9478.881391] usb 1-2: SerialNumber: 058F0O1111B1
[ 9478.883369] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 9478.883796] scsi host3: usb-storage 1-2:1.0
[ 9479.886895] scsi 3:0:0:0: Direct-Access Multi Flash Reader 1.00 PQ: 0 ANSI: 0
[ 9479.888376] sd 3:0:0:0: Attached scsi generic sg1 type 0
[ 9480.368965] sd 3:0:0:0: [sdb] 15523840 512-byte logical blocks: (7.94 GB/7.40 GiB)
[ 9480.370089] sd 3:0:0:0: [sdb] Write Protect is off
[ 9480.370106] sd 3:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 9480.371325] sd 3:0:0:0: [sdb] No Caching mode page found
[ 9480.371342] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[ 9480.390116] sdb: [CUMANA/ADFS] sdb1 [ADFS] sdb1
[ 9480.396934] sd 3:0:0:0: [sdb] Attached SCSI removable disk
以下是分区详细信息:
fdisk -l
Disk /dev/sda: 149,1 GiB, 160041885696 bytes, 312581808 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: dos
Disk identifier: 0x000b890e
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 308406271 308404224 147,1G 83 Linux
/dev/sda2 308408318 312580095 4171778 2G 5 Extended
/dev/sda5 308408320 312580095 4171776 2G 82 Linux swap / Solaris
Disk /dev/sdb: 7,4 GiB, 7948206080 bytes, 15523840 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: dos
Disk identifier: 0x000a4ed9
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 242187 233996 114,3M e W95 FAT16 (LBA)
/dev/sdb2 245760 15458303 15212544 7,3G 85 Linux extended
/dev/sdb3 15458304 15523839 65536 32M 83 Linux
/dev/sdb5 253952 376831 122880 60M c W95 FAT32 (LBA)
/dev/sdb6 385024 15458303 15073280 7,2G 83 Linux
Partition table entries are not in disk order.
Gparted 还说 superblock 有问题......
尝试德罗伯特的建议:
mknod sdb6 b 8 22
这次成功了,因为没有错误
下一个:
e2fsck ./sdb6
e2fsck 1.42.10 (18-May-2014)
e2fsck: Kein passendes Gerät bzw. keine passende Adresse gefunden beim Versuch, ./sdb6 zu öffnen
Möglicherweise ist die Partition nicht vorhanden oder eine Swap-Partition?
翻译
No fitting device or no fitting address found while trying to open ./sdb6 Maybe the partition doesn't exist or it's a swap partition?
答案1
正如您所猜测的,由于相同的损坏,文件系统可能已变为只读。fsck
应该修复它。
由于您关心您的数据,并且它是一个相对较小的设备,因此我建议首先获取完整的磁盘映像,其中包含类似cp /dev/sdb /root/sdcard-backup.img
或pv -pterb -s 7948206080 /dev/sdb > /root/sdcard-backup.img
如果您有pv
.
当您尝试使用另一台机器运行时fsck
,它无法看到分区。内核日志实际上给出了一个解释,尽管它被隐藏起来并且很容易被忽略:
[9480.368965] sd 3:0:0:0:[sdb] 15523840 512字节逻辑块:(7.94 GB / 7.40 GiB) ⋮ [9480.390116]sdb:[库马纳/ADFS] sdb1 [ADFS] sdb1 [ 9480.396934] sd 3:0:0:0: [sdb] 连接的 SCSI 可移动磁盘
我在那里把它加粗了。事实证明,Linux 在 DOS 分区表之前查找 CUMANA 分区表,不幸的是,CUMANA 分区表签名有一个字节不同,因此错误地检测分区表相当常见(如果数据是随机的,则为1 ⁄ 256 )。有一个内核错误就错误检测提起诉讼;内核人员的解决方案基本上是,通常不应启用分区格式。
不幸的是,您的内核已CONFIG_ACORN_PARTITION_CUMANA
启用。您可以切换到不支持该选项的其他内核,或者在没有该选项的情况下重新编译内核。我检查过 Debian Jessie 内核没有启用该选项,因此使用 Jessie 内核(一个选项是Debian 直播),您应该可以看到分区并能够fsck
。
完成此操作后,您的 Raspberry Pi 应该会再次启动。当然,根据具体的损坏情况,某些文件可能需要替换。