fsck -f -y /dev/sda2Funny thing is, it appears to be fixed at the first run, but after I run fsck again, more errors are popping up for fixing.
I have to run fsck few times until no more new errors come up.
Then, I booted up the system, after running it awhile, I saw kernel error messages firing everywhere, saying some issues about kernel modules and man (man pages) binary.
I am now quite sure that there is a SD card corruption which corrupted some system files. Mounting the SD card on a Linux machine again, I copied the whole /lib folder from the original image to my SD card OS partition, which hope fixes the kernel module issues.
Then, I mounted the FAT boot partition, and copied the original kernel and initrd to the SD card.
After booting to the OS, I immediately try to rebuild the system by reinstalling "base" packages:
First batch:
sudo apt-get install --reinstall adduser base-files base-passwd bash bsdutils coreutils dash debconf debianutils diffutils dpkg e2fslibs e2fsprogs findutils gcc-6-base grep gzip hostname init init-system-helpers initscripts insserv libacl1 libapparmor1 libattr1 libaudit-common libaudit1 libblkid1 libbz2-1.0 libc-bin libc6 libcap2 libcap2-bin libcomerr2 libcryptsetup4 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libfdisk1 libgcc1 libgcrypt20 libgpg-error0 libkmod2 liblzma5 libmount1 libncurses5 libncursesw5 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3 libprocps4 libseccomp2 libselinux1 libsemanage-common libsemanage1 libsepol1 libsmartcols1 libss2 libsystemd0 libtinfo5 libudev1 libustr-1.0-1 libuuid1 locales login lsb-base makedev mawk mount multiarch-support ncurses-base ncurses-bin passwd perl-base procps sed sensible-utils systemd systemd-sysv sysv-rc sysvinit-utils tar tzdata util-linuxSecond batch:
sudo apt-get install --reinstall apt apt-utils busybox-initramfs bzip2 console-setup console-setup-linux cpio cron debconf-i18n dh-python distro-info-data eject file gcc-5-base gnupg gpgv ifupdown initramfs-tools initramfs-tools-bin initramfs-tools-core iproute2 iputils-ping isc-dhcp-client isc-dhcp-common kbd keyboard-configuration klibc-utils kmod less libapt-inst2.0 libapt-pkg5.0 libatm1 libbsd0 libdns-export162 libestr0 libexpat1 libffi6 libfribidi0 libgmp10 libgnutls-openssl27 libgnutls30 libhogweed4 libidn11 libisc-export160 libjson-c2 libklibc liblocale-gettext-perl liblz4-1 libmagic1 libmnl0 libmpdec2 libnettle6 libnewt0.52 libnih1 libp11-kit0 libpcre3 libpng12-0 libpopt0 libpython3-stdlib libpython3.5-minimal libpython3.5-stdlib libreadline6 libslang2 libsqlite3-0 libssl1.0.0 libssl1.0.2 libstdc++6 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libusb-0.1-4 libxtables11 linux-base locales logrotate lsb-release mime-support net-tools netbase netcat-openbsd python3 python3-minimal python3.5 python3.5-minimal readline-common resolvconf rsyslog sudo ubuntu-keyring ubuntu-minimal ucf udev ureadahead vim-common vim-tinyFixing manpage issues:
sudo rm -rf /var/cache/man/* sudo apt-get install --reinstall man-db manpages
It seems the system is running great now.
No comments:
Post a Comment