我有一个带有 ext4 分区的外部驱动器,/dev/sda1
用于本地 borg 备份。
它只需通过 USB 端口插入,并使用fstab
生成的 systemd 自动挂载条目进行安装。昨天晚上我运行了一个备份,没有任何错误,今天早上,我将其插入,它不再被识别。该驱动器将显示 lsblk,但其下没有分区。
我运行sudo fsck -R -C -V -t ext4 /dev/sda1
并得到以下输出:
fsck from util-linux 2.39.2
[/usr/bin/fsck.ext4 (1) -- /dev/sda1] fsck.ext4 -C0 /dev/sda1
e2fsck 1.47.0 (5-Feb-2023)
fsck.ext4: Attempt to read block from filesystem resulted in short read while trying to open /dev/sda1
Could this be a zero-length partition?
/dev/sda1: status 8, rss 3232, real 0.002321, user 0.001784, sys 0.000000
我不知道如何解释这一点。我只能看到退出代码状态 8,手册页将其描述为“操作错误”。
开始编辑
输出为sudo parted /dev/sda print
Error: Invalid partition table on /dev/sda -- wrong signature 0.
Ignore/Cancel? I
Model: SABRENT (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 8225kB 1000GB 1000GB extended lba
sudo dmesg
插入驱动器后立即输出
[16265.871467] usb 2-6.4: new SuperSpeed USB device number 15 using xhci_hcd
[16265.889474] usb 2-6.4: New USB device found, idVendor=152d, idProduct=1561, bcdDevice= 2.04
[16265.889486] usb 2-6.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[16265.889491] usb 2-6.4: Product: SABRENT
[16265.889495] usb 2-6.4: Manufacturer: SABRENT
[16265.889499] usb 2-6.4: SerialNumber: DB9876543214E
[16265.899660] scsi host4: uas
[16265.900160] scsi 4:0:0:0: Direct-Access SABRENT 0204 PQ: 0 ANSI: 6
[16268.706521] sd 4:0:0:0: [sda] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
[16268.706530] sd 4:0:0:0: [sda] 4096-byte physical blocks
[16268.706759] sd 4:0:0:0: [sda] Write Protect is off
[16268.706768] sd 4:0:0:0: [sda] Mode Sense: 53 00 00 08
[16268.707113] sd 4:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[16268.707265] sd 4:0:0:0: [sda] Preferred minimum I/O size 4096 bytes
[16268.707270] sd 4:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
[16268.724287] sda: sda1 < >
[16268.724396] sd 4:0:0:0: [sda] Attached SCSI disk
[16296.811964] usb 2-6.3: reset SuperSpeed USB device number 14 using xhci_hcd
[16340.865861] sda: sda1 < >
根据电信公司的建议,我跑了sudo losetup --sector-size 4096 -P -f /dev/sdx
。我现在有一个loop1p1设备/分区。
❯ sudo parted /dev/loop1p1 print
Error: /dev/loop1p1: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/loop1p1: 4096B
Sector size (logical/physical): 4096B/4096B
Partition Table: unknown
Disk Flags:
❯ sudo fsck.ext4 -f /dev/loop1p1
e2fsck 1.47.0 (5-Feb-2023)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/loop1p1
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>
结束编辑
我应该放弃尝试恢复该分区吗? (我有多余的备份,这对我来说不是一场灾难,我只是想学习以期待有一天它可能会发生)。
在此先感谢您的帮助。
答案1
我的第一个假设是一个错误的情况,特别是当您涉及可插拔 USB 时。检查是否已正确插入(电缆两端)并且电源是否充足。
我还会检查您添加到问题中的分区表。不幸的是,它也显示设备读取错误,这就是我怀疑硬件的原因。
遗憾的是,有很多“它不起作用”的帖子,其中包含您所显示的特定供应商 ID ( 0x152d
) 和产品 ID ( 0x1561
)。举个例子,我在谷歌上搜索了“linux sabrent 152d 1561 USB“。使用不同的机箱可能会更好(我发现我的 RSHTECH 3.5in SATA 机箱没有任何问题,但由于它们都是按照低预算打造的,我的经验表明这通常是一个聚餐问题。)