Ubuntu MATE 17.10多次出现initramfs错误及系统异常求助
Hey there! Let's work through this problem together—it sounds like your Ubuntu MATE 17.10 system is dealing with some persistent filesystem issues that are starting to spill over into other parts like your network and sudo access. Let's break this down step by step to fix both the immediate problems and the root cause.
The repeated initramfs errors and need for fsck are red flags that your filesystem is either corrupted or your disk has underlying hardware issues. Here's how to diagnose and fix this:
- First, check your disk's health. Install the smart monitoring tool with
sudo apt install smartmontools(if sudo works, or use/usr/bin/sudoif the command isn't recognized). Then run:
Replacesudo smartctl -a /dev/sda/dev/sdawith your main disk identifier (uselsblkto find it if unsure). Look for Reallocated_Sector_Ct or Current_Pending_Sector values greater than 0—this means your disk has bad sectors, and you should back up data immediately and consider replacing the disk. - If the disk checks out, perform a full filesystem check from a live environment (use an Ubuntu MATE 17.10 USB installer, select "Try Ubuntu without installing"). Once in live mode:
- Identify your root partition with
lsblk(look for the partition labeled/in your normal system). - Run
fsckon that partition (replace/dev/sda1with your actual root partition):sudo fsck /dev/sda1
fsckon a mounted filesystem, which can miss corruption. - Identify your root partition with
sudo command This is likely either a broken PATH environment variable or a corrupted sudo binary:
- Try running sudo with its absolute path first:
/usr/bin/sudo. If this works, your PATH is messed up. Reset it to the default with:
Then edit yourexport PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin~/.bashrcor/etc/profileto remove any lines that might be overriding the PATH, and restart your terminal. - If
/usr/bin/sudodoesn't work, the binary is probably corrupted. Use the live environment again:- Mount your root partition to
/mnt(replace/dev/sda1):sudo mount /dev/sda1 /mnt - Reinstall sudo to repair the binary:
sudo dpkg --root=/mnt reinstall sudo
- Mount your root partition to
The missing WiFi icon and no internet are likely side effects of filesystem corruption affecting network configs or drivers:
- First, check if the NetworkManager service is running. Use the absolute path for sudo if needed:
If it's not active, start it and enable it on boot:/usr/bin/sudo systemctl status NetworkManager/usr/bin/sudo systemctl start NetworkManager /usr/bin/sudo systemctl enable NetworkManager - Check your wireless driver. Identify your network card with:
Install the appropriate driver for your card. For example, Broadcom cards often needlspci | grep Networkbcmwl-kernel-source:/usr/bin/sudo apt install bcmwl-kernel-source - Reset corrupted network configurations:
Then re-add your WiFi network manually./usr/bin/sudo rm /etc/NetworkManager/system-connections/* /usr/bin/sudo systemctl restart NetworkManager
- Avoid forced shutdowns (holding the power button)—this is the most common cause of filesystem corruption.
- Schedule regular disk health checks with
smartctlto catch hardware issues early. - If you found bad sectors on your disk, mark them as unusable to prevent the system from writing to them:
sudo badblocks -v /dev/sda > badblocks.txt sudo e2fsck -l badblocks.txt /dev/sda1
内容的提问来源于stack exchange,提问作者Nahid

