Debian Buster fsck 失敗,退出狀態為 4

Debian Buster fsck 失敗,退出狀態為 4

我已經在其他地方發布了此內容,但沒有得到任何回應。

我已經將我的樹莓派從 Jessie 更新為 Buster,從那時起我終於能夠讓 domoticz 再次工作,但又出現了另一個問題。

當我插入樹莓派時,它會啟動但不完全啟動。

它說緊急模式並帶有訊息

can not access to console, the root account is locked
press enter to continue

我按 Enter 鍵,PI 就啟動了,一切正常。

問題是通常我從來沒有連接過鍵盤或顯示器。

所以我需要它像過去五年那樣完全開始。

我在日誌中發現了一些錯誤,包括這個

fsck failed with exit status 4
failed to start file system Check on root device

查了很多步驟卻找不到解決方法

sudo fsck -f
fsck from util-linux 2.33.1
e2fsck 1.44.5 (15-Dec-2018)
/dev/mmcblk0p2 is mounted.
e2fsck: Cannot continue, aborting.

       cat  /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, so no using swapon|off from here on, use  dphys-swapfile swap[on|off]  for that

希望這可能是我能找到的第一個方向,但我是一個菜鳥,所以我不知道下一步該做什麼

答案1

您可以使用下列指令讓tune2fs在啟動時執行fsck

sudo tune2fs -c 1 /dev/mmcblk0p2

這告訴系統每次重新啟動時在根/設備上執行 fsck。差點忘了說,然後reboot應該fsck /。請注意,這僅適用於 ext2/3/4 檔案系統

您可以使用以下命令查看 fsck 的最後日期

tune2fs -l /dev/mmcblk0p2 |grep -i "last checked"

相關內容