方案 A:進入救援模式修復 GRUB 配置
/boot/grub/menu.lst(GRUB Legacy)或 /boot/grub/grub.cfg(GRUB2)。方案 B:備份與還原 MBR
# 備份 MBR(含分區表,512 bytes)
dd if=/dev/sda of=/path/to/MBR-backup bs=512 count=1
# 還原 MBR(謹慎操作,會覆蓋分區表!)
dd if=/path/to/MBR-backup of=/dev/sda bs=512 count=1
⚠️ 僅還原開機程式碼(前 446 bytes)較安全:bs=446 count=1。
編輯 /boot/grub/menu.lst,找到 kernel 行,移除 splash 參數:
kernel /boot/vmlinuz-2.6.xx root=/dev/sda1 ro quiet
sudo dpkg-reconfigure xserver-xorg
# 或手動編輯 /etc/X11/xorg.conf
按 Alt+F2 → 輸入 fonts:/// → 將字體檔拖入開啟的資料夾。
md5sum ubuntu-20.04.iso
# 對照官方提供的 MD5/SHA256 校驗碼
ls -asudo systemctl restart gdm(舊版 sudo /etc/init.d/gdm restart)# 清空垃圾桶
# 清理 APT 快取
sudo apt-get clean
sudo apt-get autoclean
# 移除孤立套件
sudo apt-get autoremove
Windows 覆寫了 MBR。使用 Ubuntu Live CD 進入救援模式:
grub-install /dev/sda
# 或 GRUB2:
grub-install --root-directory=/mnt /dev/sda
update-grub
linux 行尾加入 init=/bin/bash 或 single。mount -o remount,rw /passwd usernameexec /sbin/init 或 reboot -fAlt+F2 → 輸入 xkill → 滑鼠變骷髏頭 → 點擊欲關閉視窗。
啟用光碟機 DMA 模式:
sudo hdparm -d1 /dev/sr0
# 永久生效:編輯 /etc/hdparm.conf
/dev/sr0 {
dma = on
}
#!/bin/bash
IPTABLES=/usr/sbin/iptables
EXTIF=ppp0
INTIF=bnep0
echo 1 > /proc/sys/net/ipv4/ip_forward
$IPTABLES -F; $IPTABLES -X
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 22 -j ACCEPT
$IPTABLES -A INPUT -p tcp --dport 80 -j ACCEPT