移動根分割區後 Ubuntu 凍結啟動

移動根分割區後 Ubuntu 凍結啟動

【到最後查看解決方案】
我有Ubuntu和Windows 10雙啟動系統。

當我啟動系統時,我可以正確地看到 grub 選單,從中我可以選擇 Ubuntu 或 Windows 10。我嘗試在恢復模式下啟動內核,但在列印以下內容後它凍結了:

Loading Linux 5.4.0-65-generic ...
Loading initial ramdisk ...

我猜分區資料沒有損壞。您知道比重裝系統更好的解決方案嗎?


更新
我已經從即時 USB 執行了啟動修復,以產生 Bootinfo 摘要報告(如 @oldfred 所建議):https://paste.ubuntu.com/p/wn3XRs94Jq/

我也嘗試過以下3種策略,但沒有成功。

1. 從boot-repairGUI重新安裝 grub

正如這裡所解釋的:https://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/。它告訴我找不到軟體包grub-efigrub-efi-amd64-signed.
參考:

2. 從航站出發:

掛載 root 和 efi 分割區(是的,我有一個單獨的 efi 分割區)並從 live usb Ubuntu 導入有用的分割區

sudo mount /dev/nvme0n1p3 /mnt
for i in /sys /proc /run /dev /var /lib /usr /etc; do sudo mount --bind "$i" "/mnt$i"; done
sudo mount /dev/nvme0n1p1 /mnt/boot/efi

根分區中的 chroot

sudo chroot /mnt

重新安裝 grub (efi)。
由於我是從 Ubuntu 根分割區執行此操作(感謝 chroot),因此它也可以正確識別 Windows 作業系統。

sudo apt-get update
sudo apt-get purge grub-common
sudo apt-get install grub-efi-amd64
sudo update-grub
grub-probe -t device /boot/grub
sudo grub-install /dev/nvme0n1p1 # also tried with /dev/nvme0n1
sudo update-grub

但一切都沒有改變。
參考:

3.來自GParted live USB

  • 對 Ubuntu 根分割區 /dev/nvme0n1p13 執行「檢查」(透過)
  • sudo fsck /dev/nvme0n1p3 -y
  • sudo e2fsck -C0 -p -f -v /dev/nvme0n1p3
  • sudo e2fsck -f -y -v /dev/nvme0n1p3

參考:


更新
在 chroot 中從即時 USB 重新安裝核心後,在復原模式下啟動時會收到核心恐慌日誌。
最後幾行是:

0.4762681 eun: security.SMACK64TRANSMUTE

0.477044] eun: security.SMACK64MMAP 0.477951) eun: security.apparnor

0.4787371 eun: security. ina

8.479513] eum: security.capability

0.4802771 eum: HMAC attrs: 0x1

0.4819921 PM: Magic number: 13:566:676 0.482765] vtconsole vtcon1: hash matches

0.4837521 rtc_chos 00:01: setting system clock to 2021-11-06T09:39:59 UTC (1636191599) 0.4848431 md: Maiting for all devices to be available before autodetect

0.485623] nd: If you don't use raid, use raid-noautodetect 0.486981) nd: Autodetecting RAID arrays.

0.4877591 nd: autorun ...

0.488526] md: ... autorun DONE.

0.4893201 UFS: Cannot open root device "UUID-b13c4a4c-9205-4547-83d8-641391500749" or unknown-block(0,0): error -6

8.4903641 Please append a correct "root=" boot option: here are the available partitions: 0.4911841 Kernel panic - not syncing: UFS: Unable to mount root fs on unknown-black(0,0)

8.4919711 CPU: 1 PID: 1 Conn: suapper/0 Not tainted 5.4.0-65-generic #73-Ubuntu 8.4927551 Hardware name: Dell Inc. Inspiron 5593/09PY2G, BIOS 1.17.0 07/27/2821

0.4935341 Call Trace:

8.494659] dump_stack Ox6d/0x9a

8.4957351 panic +0x101/0x2e3

8.496847] mount block_root+0x23f/0x2e8

0.4988051 mount_root 0x38/0x3a 0.4991241 prepare_nanespace 0x13f/0x194

8.580253] kernel_init_freeable 0x231/0x255

0.5013811 ? rest_init+0xb0/0xb0

8.5825991 kernel_init+0xe/0x110

0.503723] ret_from_fork 0x1f/0x10

8.5049351 Kernel Offset: 0x24000000 from Oxffffffff81000000 (relocation range: 0xffffffff80000000-0xfffffffffffffff) 8.586156] [ end Kernel panic - not syncing: UFS: Unable to mount root fs on unknown-block(0.0) 1

註:本文是透過谷歌鏡頭的圖片提取的。所以可能會有一些小錯字。原圖是 在此輸入影像描述


解決方案

最終我不得不使用 live USB 在我的根分割區中重新安裝一個全新的 Ubuntu,而不會遺失我的資料(這些資料位於我的 /home 分割區,磁碟上的另一個分割區)。對於每個嘗試過的解決方案,我不斷遇到錯誤,這讓我損失了大量時間,而重新安裝只花了 15 分鐘。強烈建議! 我遇到的錯誤可能是由於我的根分區中的核心是 5.4.0-65,而 us live key 上的核心是 5.11.0。
參考:

相關內容