How to fix Linux failure [html] failure to start properly without an operating system can ensure 100% reliability. One day, even Linux cannot start. This article provides you with some policies used when the Linux workstation cannot start normally. No matter how much you like your Linux machine, sometimes you... how to fix Linux failures [html] without operating systems can ensure 100% reliability. One day, even Linux cannot start. This article provides you with some policies used when the Linux workstation cannot start normally. No matter how much you like your Linux machine, sometimes you have to restore your system. Yes, even a Linux machine may suffer a system crash: whether it is due to video configuration errors, kernel update errors, or init script configuration errors, this situation is inevitable. I have seen a lot of such cases-even on my own machine, most of them are caused by X configuration errors-which is indeed frustrating. In my opinion, reinstalling the system is not the best rescue plan. Sometimes, the best rescue plan does not even need to be started from the rescue disk. This article will provide some tips and tips for how to avoid system crashes and help you build the tools required to restore Linux machines to crash. After installing a new Linux system with the correct running level, I took immediate measures to ensure that the disaster would not happen easily. One of the measures is to edit the system running level. The running level tells the system how far it is from the boot process. The running level is divided into six levels: 0: Stop (not set initdefault) Level 1: Single user mode Level 2: Multi-user mode, no NFS (same as level 3, level 3: full multi-user mode Level 4: No Level 5: X11 level 6: Restart (initdefault is not set) the new Linux system almost always uses the runtime level 5 (X11) by default, indicating that the system will stop at the graphic logon interface after the boot is complete. The system works normally before something (or someone) uses X configuration. Then you must find a logon method. You can press [Ctrl] [Alt] [F7] to enter a text-based virtual window, but why is it so troublesome? On the contrary, I always change the running level to 3 in the/etc/inittab file. The code you changed is: id: 5: initdefault: it is changed to: id: 3: initdefault: this is a very simple system recovery method when X fails. Another obvious disk restoration method is to always install a running kernel. I usually work on a kernel updated through yum. Sometimes, some kernel errors make it impossible for one or more of my machines to start. To avoid this situation, I always ensure that at least one running kernel is used on the machine. To solve this problem, you must first go to/etc/yum. add plugins = 1 in the conf file, then apply this script (written by Jeremy Katz of RedHat) and name it n-installonly.py, save it in the/usr/lib/yum-plugins file. You can update the number of kernels used by the system by modifying the tookeep variable (2 by default. Knowing that the system has a running kernel, you can perform a security upgrade. If an error occurs in the new kernel, you only need to start the old kernel to solve the problem on the new kernel (whether delete, re-compile or upgrade ). Rescue mode if you are using the Red Hat and LILO boot loaders, you can insert the product disc 1 and enter Linuxrescue at the boot prompt to enter rescue mode. After the machine is started, you will see the bash # prompt. In this mode, you can use many tools. As you can see, there are tools for checking hard disk integrity, repairing hard disks, checking kernel modules, assembling devices, and creating file systems. This is the best time for a rescue attempt (if you are using a Red Hat or Red Hat-based system ). Another rescue method is to enter the single-user mode, where your computer directs to level 1. The system assembles your local file system but does not activate the network. You get an available system maintenance shell. To enter the single-user mode, enter Linuxsingle or Linuxemergency at the LILO prompt to create a rescue CD. if you are using LILO to introduce the loader, you can use a powerful tool called mkrescue. This tool is generally used to create a boot floppy disk, but can also be used to create an ISO. The usage is as follows. If you use Mandriva: mkrescue -- iso -- initrd/boot/initrd-KERNEL-NUMBER.img -- kernel/boot/vmlinuz-KERNEL-NUMBER Note: Here the KERNEL-NUMBER indicates the kernel version NUMBER. If you cannot determine the kernel version, you can use the following command to find the intrd and vmlinuz numbers: after uname-r runs this command, you will find a rescue in the directory that runs the mkrescue command. iso file. Now you can use the following command to create an image: first, check the device number of the created CD: cdrecord-scanbus and then use the following command to create an image: cdrecord dev =, 0 rescue. iso note: dev = and 0 here are the numbers found using the scanbus command. If you use Slackware, use these steps to create a boot CD: mkrescue-iso note: Slackware automatically learns which kernel is put in ISO. Then, you can use the same method to create a Mandriva image. Systemrescuprimary is a Linux system stored on a bootable disc. it is used to repair the system and data after a system crash. It also allows you to easily execute management tasks on your computer, such as creating and editing hard disk partitions. It consists of many system utilities (parted, partimage, fstools) and basic utilities (editor, midnight commander file manager, and network tools. It is very easy to use. You only need to start from the disc to perform all operations, just like starting from the hard disk. The system kernel supports most important file systems (ext2/ext3, reiserfs, reiser4, xfs, jfs, vfat, ntfs, iso9660) and networks (samba and nfs ). Systemrescuprimary may be the best rescue system on the market. You can not only use this rescue method on a CD, but also put the rescue system on a USB flash disk. To create a systemrescumcm on a USB flash drive, you need a disk space larger than MB. Download the iso image from Sourceforge and burn it to the CD. Now you must create a file system on the USB flash drive. Run the dmesg command to find the name of the USB flash disk and run the following code to erase the USB flash disk: dd if =/dev/zero of =/dev/sda. the/dev/sda here is the name of the USB flash disk. Now install the master boot record on the USB flash drive: install-mbr/dev/sda or install-mbr -- force/dev/sda (if the command fails). now create a distributed partition: parted/dev/sda (parted) mkpartfs primary fat32 0 100% // use help or help mkpartfs command to see help (parted) print // check if the write was OK (parted) quit has now established a file system, and then copies the files in the CD burned with the systemrescuprimary image to the USB flash disk. Make sure that the file level you copied is the same as that on the CD. Now, the USB flash drive can be started using the sysLinux command: sysLinux/dev/sda1 here/dev/sda1 is the name of the disk. Now you have built a rescue USB flash drive that you can carry around all day. Because you use Linux, you do not need to use it frequently. Finally, Linux is a very stable environment, but because there are many other systems in the system, they may encounter errors. Although it is easy for us to be self-satisfied by the use of Linux (because of its many advantages), it is wise to understand how to save a machine with a system crash. Of course, not all rescue systems in the world can restore your system 100%, so you may want to consider implementing a disaster recovery plan for your Linux servers and desktop systems.
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.