我使用 dd 将较小的磁盘克隆到较大的磁盘上,但是现在启动时出现 dmesg 错误:
[Fri Sep 30 11:48:43 2022] GPT:Primary header thinks Alt. header is not at the end of the disk.
[Fri Sep 30 11:48:43 2022] GPT:1953525167 != 3907029167
[Fri Sep 30 11:48:43 2022] GPT:Alternate GPT header not at the end of the disk.
[Fri Sep 30 11:48:43 2022] GPT:1953525167 != 3907029167
[Fri Sep 30 11:48:43 2022] GPT: Use GNU Parted to correct GPT errors.
我该如何解决这个问题?该错误表明要使用parted,但我不确定要运行哪些命令?
答案1
你不需要做任何特别的事情,只需用来p
打印有关磁盘的信息,parted 会告诉你分区表错误并询问你该怎么做,所以只需告诉Fix
它:
# parted /dev/loop0
GNU Parted 3.5
Using /dev/loop0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Warning: Not all of the space available to /dev/loop0 appears to be used, you can fix the GPT to use all of the space (an extra 10485760 blocks) or continue with the current setting?
Fix/Ignore? Fix
...
(当然替换/dev/loop0
为您的磁盘,例如/dev/sda
)。