如何修复我的磁盘的 EFI 分区?

如何修复我的磁盘的 EFI 分区?

我有一台配备 NVME M2 磁盘的 Intel NUC (NUC10i7FNH2)。我通过 USB 密钥安装了 Ubuntu 20.04。一段时间内一切都运行正常,但电脑突然崩溃了。它只运行一个简单的 Python Web 服务器,因此没有连接到屏幕。我关闭了它,并将其连接到屏幕和键盘。尝试重新启动时,我收到以下消息

A bootable device has not been detected.

我从 USB 密钥启动,然后找到了我的磁盘。它有 2 个分区:EFI 系统分区和 Linux 文件系统。

我跑了文件系统检查在 2 个分区上。在第二个分区上,对于文件系统,它发现了一些问题并解决了。在 EFI 分区上,它失败了

Bad magic number in super block while trying to open /dev/nvme0n1p1

这可能吗?我怎样才能修复我的 EFI 分区而不丢失其他分区中的数据?

答案1

我在网上找到了一个解决方案,也许可以解决你的情况

Solution
1) Find the backup of superblocks using dumpe2fs or mke2fs

dumpe2fs will work on mounted or unmounted disk but mke2fs require disk unmounted.
You can try this.
#dumpe2fs -h /dev/sdb

[root@sss ~]# dumpe2fs /dev/sdb |grep -i superblock
dumpe2fs 1.42.9 (28-Dec-2013)
Primary superblock at 0, Group descriptors at 1-2
Backup superblock at 32768, Group descriptors at 32769-32770
Backup superblock at 98304, Group descriptors at 98305-98306
Backup superblock at 163840, Group descriptors at 163841-163842
Backup superblock at 229376, Group descriptors at 229377-229378
Backup superblock at 294912, Group descriptors at 294913-294914
Backup superblock at 819200, Group descriptors at 819201-819202
Backup superblock at 884736, Group descriptors at 884737-884738
Backup superblock at 1605632, Group descriptors at 1605633-1605634
Backup superblock at 2654208, Group descriptors at 2654209-2654210
OR THIS
[root@sss ~]# #mke2fs -n /dev/sdb
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
720896 inodes, 2883584 blocks
144179 blocks (5.00%) reserved for the superuser
First data block=0
Maximum filesystem blocks=2952790016
88 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32769, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

2) Replace the superblock using the backup superblock

#fsck -b 32768 /dev/sdb
or
#mount sb=32768 /dev/sdb /mountpoint
or
#e2fsck -b 32768 /dev/sdb

If we are getting the same error with superblock located on 32768, repeat the step with another superblock location.

我不知道它是否可行,但我看到了另外两篇帖子,它们处理与此相同的问题,希望它对你有用。[这是我找到可能的解决方案的地方][1] [1]:https://www.serveradminz.com/blog/bad-magic-number-in-superblock/

相关内容