大约一个月前,我完成了新 Arch 系统的设置。由于我有两个 nvme 驱动器用于系统,因此我研究了如何使用它们来充分利用两个驱动器的容量。nvme0n1 是一个 2 TB 驱动器(KIOXIA EXCERIA PLUS G2),nvme3n1 是一个 1 TB 驱动器(CRUCIAL P5)。按照 Arch WiKi 将 Arch 安装在由两个物理卷组成的逻辑卷上创建的 BTRFS 分区上。几天前,我的系统驱动器无缘无故地变为只读。我重新启动后,一切都恢复正常 - 愚蠢的我没有注意到这件事。今天早上又发生了这种情况,所以我重新启动了,然后我的系统无法再启动。消息是
mount: /new_root: can't read superblock on /dev/mapper/vg.fermat-lv.fermat
ERROR: Failed to mount '/dev/mapper/vg.fermat -lv.fermat' on real root
You are now being dropped into an emergency shell.
我现在启动了 Live CD,试图找出问题的解决方案,但我陷入了困境。以下是我的情况
[root@ArcoLinuxB-plasma liveuser]# pvdisplay
--- Physical volume ---
PV Name /dev/nvme0n1p2
VG Name vg.fermat
PV Size <1.82 TiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 476803
Free PE 0
Allocated PE 476803
PV UUID 1yXIyW-r3kZ-TRRW-VyVs-dwtW-GtWZ-HA2BkO
--- Physical volume ---
PV Name /dev/nvme3n1p1
VG Name vg.fermat
PV Size 931.51 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 238466
Free PE 0
Allocated PE 238466
PV UUID B4BQsn-pffm-fMfw-QjPb-22da-v13l-vbcoiz
[root@ArcoLinuxB-plasma liveuser]# vgdisplay
--- Volume group ---
VG Name vg.fermat
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size <2.73 TiB
PE Size 4.00 MiB
Total PE 715269
Alloc PE / Size 715269 / <2.73 TiB
Free PE / Size 0 / 0
VG UUID ayLDzU-tD0J-AQyN-G3lV-BdgH-wn9D-TbRZsp
[root@ArcoLinuxB-plasma liveuser]# lvdisplay
--- Logical volume ---
LV Path /dev/vg.fermat/lv.fermat
LV Name lv.fermat
VG Name vg.fermat
LV UUID NxCCrP-cA6K-4eZh-2O2p-gaBs-rSex-jh2MJR
LV Write Access read/write
LV Creation host, time archiso, 2023-11-27 15:49:45 +0000
LV Status available
# open 0
LV Size <2.73 TiB
Current LE 715269
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
[root@ArcoLinuxB-plasma liveuser]# mount /dev/vg.fermat/lv.fermat /mnt/test
mount: /mnt/test: can't read superblock on /dev/mapper/vg.fermat-lv.fermat.
dmesg(1) may have more information after failed mount system call.
[root@ArcoLinuxB-plasma liveuser]# dumpe2fs -h /dev/vg.fermat/lv.fermat
dumpe2fs 1.47.0 (5-Feb-2023)
dumpe2fs: Bad magic number in super-block while trying to open /dev/vg.fermat/lv.fermat
Couldn't find valid filesystem superblock.
/dev/vg.fermat/lv.fermat contains a btrfs file system labelled 'Root'
[root@ArcoLinuxB-plasma liveuser]# dumpe2fs -h /dev/nvme0n1
dumpe2fs 1.47.0 (5-Feb-2023)
dumpe2fs: Bad magic number in super-block while trying to open /dev/nvme0n1
Couldn't find valid filesystem superblock.
/dev/nvme0n1 contains `DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 3907029167 sectors, extended partition table (last)' data
[root@ArcoLinuxB-plasma liveuser]# dumpe2fs -h /dev/nvme3n1
dumpe2fs 1.47.0 (5-Feb-2023)
dumpe2fs: Bad magic number in super-block while trying to open /dev/nvme3n1
Couldn't find valid filesystem superblock.
/dev/nvme3n1 contains `DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 1953525167 sectors, extended partition table (last)' data
我不知道这是否有帮助,但这也是我的 fdisk 信息
[root@ArcoLinuxB-plasma liveuser]# fdisk -l
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: T-FORCE 1TB
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: F844A08E-4F0E-46B5-B392-B36AAF2495D3
Device Start End Sectors Size Type
/dev/sda1 2048 1953523711 1953521664 931.5G Linux filesystem
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: T-FORCE 1TB
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: 9D2D5B13-1C00-554A-9F37-400A05AC3B5F
Device Start End Sectors Size Type
/dev/sdb1 2048 1953521663 1953519616 931.5G Microsoft basic data
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: KIOXIA-EXCERIA PLUS G2 SSD
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: C61199F3-F473-42D5-80B5-60BD7C0DFE06
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 3907028991 3905978368 1.8T Linux filesystem
Disk /dev/nvme2n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Samsung SSD 960 PRO 512GB
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: 1E1A4C9E-E48E-4848-9EC6-DCB3FA1A5817
Device Start End Sectors Size Type
/dev/nvme2n1p1 2048 206847 204800 100M EFI System
/dev/nvme2n1p2 206848 239615 32768 16M Microsoft reserved
/dev/nvme2n1p3 239616 998932479 998692864 476.2G Microsoft basic data
/dev/nvme2n1p4 998932480 1000212479 1280000 625M Windows recovery environment
Disk /dev/nvme1n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: Samsung SSD 960 PRO 512GB
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: 8FCA4CDE-8E68-47B8-A973-991CCEE89354
Device Start End Sectors Size Type
/dev/nvme1n1p1 40 409639 409600 200M EFI System
/dev/nvme1n1p2 409640 1000215175 999805536 476.7G Apple APFS
Disk /dev/nvme3n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: CT1000P5PSSD8
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: B76AA81C-93F9-4489-8E50-7AF9B725D84F
Device Start End Sectors Size Type
/dev/nvme3n1p1 2048 1953523711 1953521664 931.5G Linux filesystem
Disk /dev/sdc: 58.59 GiB, 62914560000 bytes, 122880000 sectors
Disk model: MyUSB Drive
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: 0xf70f22b6
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 122814463 122812416 58.6G 7 HPFS/NTFS/exFAT
/dev/sdc2 122814464 122879999 65536 32M ef EFI (FAT-12/16/32)
Disk /dev/mapper/ventoy: 2.45 GiB, 2634657792 bytes, 5145816 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: 0xfcb65ee5
Device Boot Start End Sectors Size Id Type
/dev/mapper/ventoy-part1 * 64 5114431 5114368 2.4G 0 Empty
/dev/mapper/ventoy-part2 5114432 5145151 30720 15M ef EFI (FAT-12/16/32)
Disk /dev/loop0: 2.31 GiB, 2481229824 bytes, 4846152 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
Disk /dev/mapper/vg.fermat-lv.fermat: 2.73 TiB, 3000055627776 bytes, 5859483648 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
从我在其他帖子中读到的内容来看,我需要找到一个备份超级块,替换坏的超级块,然后可能修复逻辑卷(?)。有什么想法可以继续吗?为什么会发生这种情况?
感谢您的关注...
编辑1
我通过运行以下命令获取了有关备份超级块的一些信息
[root@ArcoLinuxB-plasma liveuser]# mke2fs -n /dev/vg.fermat/lv.fermat
mke2fs 1.47.0 (5-Feb-2023)
/dev/vg.fermat/lv.fermat contains a btrfs file system labelled 'Root'
Proceed anyway? (y,N) y
Creating filesystem with 732435456 4k blocks and 183115776 inodes
Filesystem UUID: 3964e616-a731-49c1-80e5-e27777a87a39
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000, 550731776, 644972544
编辑2
在两个磁盘上运行smartctl
会产生一些奇怪的结果
[root@ArcoLinuxB-plasma liveuser]# smartctl -a /dev/nvme0n1
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.5.8-arch1-1] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: KIOXIA-EXCERIA PLUS G2 SSD
Serial Number: 61AA1019KLF2
Firmware Version: ECFA11.1
PCI Vendor/Subsystem ID: 0x1e0f
IEEE OUI Identifier: 0x8ce38e
Total NVM Capacity: 2,000,398,934,016 [2.00 TB]
Unallocated NVM Capacity: 0
Controller ID: 1
NVMe Version: 1.3
Number of Namespaces: 1
Namespace 1 Size/Capacity: 2,000,398,934,016 [2.00 TB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 8ce38e 030068c2cf
Local Time is: Mon Dec 18 09:10:33 2023 UTC
Firmware Updates (0x12): 1 Slot, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x0a): Cmd_Eff_Lg Telmtry_Lg
Maximum Data Transfer Size: 512 Pages
Warning Comp. Temp. Threshold: 72 Celsius
Critical Comp. Temp. Threshold: 90 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 11.09W - - 0 0 0 0 1 1
1 + 8.05W - - 1 1 1 1 1 1
2 + 6.54W - - 2 2 2 2 1 1
3 - 0.0500W - - 3 3 3 3 7000 5000
4 - 0.0050W - - 4 4 4 4 13000 36000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 2
1 - 4096 0 1
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 33 Celsius
Available Spare: 100%
Available Spare Threshold: 5%
Percentage Used: 1%
Data Units Read: 925,560 [473 GB]
Data Units Written: 6,645,795 [3.40 TB]
Host Read Commands: 7,141,610
Host Write Commands: 72,308,821
Controller Busy Time: 74
Power Cycles: 35
Power On Hours: 389
Unsafe Shutdowns: 13
Media and Data Integrity Errors: 0
Error Information Log Entries: 394
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Error Information (NVMe Log 0x01, 16 of 63 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS Message
0 394 0 0x8015 0x4004 0x004 0 1 - Invalid Field in Command
1 393 0 0x800b 0x4004 0x004 0 1 - Invalid Field in Command
2 392 0 0x200d 0x4004 0x004 0 1 - Invalid Field in Command
3 391 0 0x7014 0x4004 0x004 0 1 - Invalid Field in Command
4 390 0 0x100c 0x4004 0x004 0 1 - Invalid Field in Command
5 389 0 0x0000 0x4004 0x028 0 0 - Invalid Field in Command
Read Self-test Log failed: Invalid Field in Command (0x2002)
和
[root@ArcoLinuxB-plasma liveuser]# smartctl -a /dev/nvme3n1
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.5.8-arch1-1] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: CT1000P5PSSD8
Serial Number: 22343ACCCC43
Firmware Version: P7CR403
PCI Vendor/Subsystem ID: 0xc0a9
IEEE OUI Identifier: 0x00a075
Total NVM Capacity: 1,000,204,886,016 [1.00 TB]
Unallocated NVM Capacity: 0
Controller ID: 0
NVMe Version: 1.4
Number of Namespaces: 1
Namespace 1 Size/Capacity: 1,000,204,886,016 [1.00 TB]
Namespace 1 Formatted LBA Size: 512
Namespace 1 IEEE EUI-64: 00a075 013acccc43
Local Time is: Mon Dec 18 09:11:17 2023 UTC
Firmware Updates (0x14): 2 Slots, no Reset required
Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test
Optional NVM Commands (0x0057): Comp Wr_Unc DS_Mngmt Sav/Sel_Feat Timestmp
Log Page Attributes (0x1b): S/H_per_NS Cmd_Eff_Lg Telmtry_Lg Pers_Ev_Lg
Maximum Data Transfer Size: 512 Pages
Warning Comp. Temp. Threshold: 80 Celsius
Critical Comp. Temp. Threshold: 82 Celsius
Namespace 1 Features (0x08): No_ID_Reuse
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 8.25W - - 0 0 0 0 0 0
1 + 4.00W - - 1 1 1 1 0 0
2 + 2.00W - - 2 2 2 2 0 0
3 - 0.1000W - - 3 3 3 3 5000 6000
4 - 0.0050W - - 4 4 4 4 12000 35000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 0
=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 35 Celsius
Available Spare: 100%
Available Spare Threshold: 5%
Percentage Used: 1%
Data Units Read: 6,706,996 [3.43 TB]
Data Units Written: 10,961,060 [5.61 TB]
Host Read Commands: 53,749,530
Host Write Commands: 177,816,661
Controller Busy Time: 160
Power Cycles: 95
Power On Hours: 810
Unsafe Shutdowns: 51
Media and Data Integrity Errors: 0
Error Information Log Entries: 541
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Temperature Sensor 1: 35 Celsius
Error Information (NVMe Log 0x01, 16 of 256 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS Message
0 541 0 0x000c 0x8004 0x000 0 0 - Invalid Field in Command
Read Self-test Log failed: Invalid Field in Command (0x002)
因此它通过了健康测试,但日志中存在一些无法识别的错误。
编辑3
目前我还不知道到底发生了什么。是某个磁盘的硬件问题,还是逻辑卷上的分区lvm
问题?btrfs
我认为我需要先回答这个问题,然后才能利用可用的备份超级块进行任何修复尝试......