Fix Ubuntu system crash--hard disk space remaining 0 bytes and mistakenly delete current (all) kernel

Source: Internet
Author: User

Phenomenon and background

Tip Hard disk space remaining 0 bytes, not when the event is selected to ignore, and want to resolve the "failure" by restarting. However, "reboot" failed to start successfully. There is a background to prompt the system update, I choose to update all, that is, the kernel upgrade to 3.19*61, the original is 3.19*25, as well as to crack Sony's binocular camera Ps4eye driver, may be related to "bug" (the remaining 0 bytes).

New problem in fix--delete current kernel

Because the disk space remaining 0 bytes, noting that the upgrade of memory caused this failure, the first thought of removing the redundant kernel, "the system does not allow the deletion of the current kernel" is actually just a reminder, because the access to the permissions, so very wonderful I have all the kernel deleted. At this point, it is best not to reboot immediately reload the kernel, however, I restarted thought can recover, the result of natural tragedy.

Boot-repair, repairing Startup items

In the case of the system does not start, the first thought is to repair the startup item, actually made a mistake, because, at this time the startup item is not a problem, just because the hard disk does not have space to enter the system. But boot-repair this tool is still very useful, but also let me more clearly grasp the problems that arise.

Reference: http://jingyan.baidu.com/article/5553fa82cd48a765a23934ae.html

Specific:

USB disk Boot disk to open the computer:

Sudo-i

Add-apt-repository ppa:yannubuntu/boot-repair && apt-get Update

Apt-get install-y Boot-repair && Boot-repair

Click the first option recommended repair, the rest of the software will operate on its own, without the need for human intervention depending on the computer configuration, the time spent.

For me, Boot-repair successfully fixed the startup item, but the system could not be started because the available space is still zero, which also leads to the problem of unloading kernel space between the time between the lack of expansion. After the repair success prompt me to lack of space, let delete some files, I get permission to delete the *.log (greater than 160G) of the file, but still alarm the remaining space is zero.

Resolution 1:

Find the culprit that fills the entire hard disk space:

How to find large files under Linux (http://www.2cto.com/os/201412/358960.html)

1. Find a directory with high disk utilization, du command

DU-SH/*

List the size of all directories under the root directory

And then, under the catalogue, analyze it slowly.

2. Find the file size, find command

For example:

Find files larger than 20MB on disk

Find/-size +20000k-exec ls-lh {} \;

Find files larger than 400MB on disk, delete directly, usually log files

Find/-size +400000k-exec rm-rf {} \;

Other useful commands are:

Df-h

(Found Var/log under a Uv*.log (may be Sony camera Ps4eye crack caused) more than 160G, in the U disk Startup disk, delete it, but still the alarm hard disk space is insufficient.

Solution: Back up the downloaded data set, delete the space around 30G, reload the kernel.

Resolution 2: Reload the kernel (reload kernel in case of current kernel removal)

Reference Links:

Http://blog.sina.com.cn/s/blog_77bd35590102we6b.html

http://www.laifuying.com/archives/521

Http://www.blogjava.net/stone2083/archive/2011/06/18/352551.html

http://blog.csdn.net/ad4546/article/details/7292554

Http://www.cnblogs.com/xiangzi888/p/3675725.html

(1) Copy the files/media/cdrom/casper/vmlinuz.efi and/media/cdrom/casper/initrd.lz files from the USB drive to the/media/xxx/boot/directory (boot of the original system)

(2)

sudo mount/dev/sda7/mntchroot/mntdpkg--get-selections | grep linux

The discovery did remove the kernel and had to reload the Linux kernel.

Mount the necessary stuff (the root partition is already mounted to/mnt):
Exit #退出chroot

sudo mount--bind/proc/mnt/proc #绑定当前进程到/mnt/mnt Devsudo under Procsudo mount--bind/dev/mnt/dev #绑定设备文件到 chroot/mnt

Install Linux kernel

Apt-get Install Linux-image-3.***-generic
Here, I looked at the boot of the USB flash drive in the boot of the thing, one by one in the original system (chroot) boot installed side, after restarting the success.

Reboot the system and return to normal.

If you have a problem installing the kernel, you can also use Root-repair to resolve it.

Resolution 3: Actually delete the file that fills the hard disk

Locate large files: sudo find/-size +20000k-exec ls-lh {} \;

CD to the appropriate directory (/. Trash)
RM-Corresponding file
The bug file is actually deleted.



Other references:
1. Copy the files from/etc/aaa.gz to the/tmp/directory:
CP /etc/aaa.gz /tmp/
Copy the file from the/etc/aaa.gz to the/tmp/directory and name it bbb.gz
CP /etc/aaa.gz /tmp/bbb.gz
Copy the directory/etc/fold/to the/tmp/directory
CP -RF /etc/fold /tmp/
Note:-r is used to copy folders,-F to force copying without prompting for confirmation

Postscript

Write more verbose, mainly because of the novice one, find a lot of methods, may be the final problem of the solution has an impact, are written to reference it.

Fix Ubuntu system crash--hard disk space remaining 0 bytes and mistakenly delete current (all) kernel

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.