LILO, LinuxCrashRescueHOW-TO (1)

Source: Internet
Author: User
Article title: LILO, LinuxCrashRescueHOW-TO (1 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Al Dev (Alavoor Vasudevan) [1] alavoor@yahoo.com
Huang Guowei (u4561055@cc.ncu.edu.tw)
  
This document explores how to reply from Linux system failures. Various causes of Linux system failure
This may be because-LILO is damaged, linux cannot be started, and hard disk Master Boot Records (Master Boot
Record, MBR) is damaged, or other operating systems such as Windows NT are installed and LILO or
Linux cannot start up after MBR is written.
_________________________________________________________________
  
1. Introduction
  
* 1.1 quick steps for replying to the system
* 1.2 Preventive Measures
* 1.3 remove LILO
* 1.4 mistakes
  
2. Related links
  
3. other formats of this file
  
4. Copyright
_________________________________________________________________
  
1. Introduction
  
You cannot avoid unexpected events. if an accident occurs in a linux system, this may damage the hard drive master.
Boot Records (MBR) or LILO (Linux boot Loader ). When linux is caused by a hard drive failure
This will occur when the instance cannot be started. If you accidentally re-partition the disk or
Install Other operating systems on your computer, such as Windows 98/NT. LILO may also become invalid.
  
This document provides you with ideas, tips, and quick guidance to quickly reply to the system without any effort
Read a hundred pages of LILO or Linux files.
  
1.1 quick steps for replying to the system
  
Follow these steps to respond from LILO or system failure.
  
1. status 1: If the system cannot be started-
Get and build tomsrtbt boot disk [3] http://www.toms.net/rb and use
Tomsrtbt boot disk boot. Use the fdisk command to find partitions ). Try
Use the following command to identify the root partition-
_____________________________________________________________
  
Bash # fdisk/dev/hda
Bash # mkdir/test
Bash # mount/dev/hda1/test
Bash # ls/test
You will see the root partition shown as follows-
Bin fd lib mnt proc sbin usr
Boot dev etc home lost + found opt root tmp var
_____________________________________________________________
  
If this partition is not the root partition, try the next partition/dev/hda2. Try again
Try hda3, hda4, and hda5 until you find the root partition. For example, in hda
Still cannot be found. Please repeat the above steps on other devices, such as hdb, hdc, hdd ..
When you create a new lilo setting, the/usr,/var, and/boot partitions are also required.
Take my system as an example. the root partition is in/dev/hda4:
_____________________________________________________________
  
Bash # mkdir/hda4
Bash # mount/dev/hda4/hda4
Bash # cat/hda4/etc/fstab
Read the fstab content and separate the fstab files by mount. As shown below-
Bash # mount/dev/hda5/hda4/boot
Bash # mount/dev/hda6/hda4/usr
Bash # mount/dev/hda7/hda4/var
Bash # mount/dev/hda8/hda4/opt
Bash # mount/dev/hda9/hda4/root
Bash # mount/dev/hda10/hda4/home
_____________________________________________________________
  
Take my system as an example. according to fstab, hda5 is boot and hda6 is usr,
Hda7 is var, hda8 is opt, hda9 is root, hda10 is home, and hda11 is
Windows 95 Directory
Edit/etc/fstab (not/hda4/etc/fstab) and add (the following simple code)
_____________________________________________________________
  
/Dev/hda4/hda4 ext2 defaults 1 1
/Dev/hda5/hda4/boot ext2 defaults 1 1
/Dev/hda6/hda4/usr ext2 defaults 1 1
/Dev/hda7/hda4/var ext2 defaults 1 1
/Dev/hda8/hda4/opt ext2 defaults 1 1
/Dev/hda9/hda4/root ext2 defaults 1 1
/Dev/hda10/hda4/home ext2 defaults 1 1
/Dev/hda11/hda4/win95part vfat defaults 1 1
  
In my computer, hda4 contains linux root partitions, hda5 has boot partitions,
Hda11 has a windows 95 vfat system.
  
Bash # mkdir/hda4/win95part
Bash # mount/hda4/win95part
Use the fsck or e2fsck command to fix the system.
Bash # man fsck
Bash # man e2fsck
_____________________________________________________________
  
2. condition 2: If LILO is invalid ..
Follow the steps in status 1 to troubleshoot the problem. If the problem persists, follow these steps. Now you
The/hda4 file has been attached and the/etc/fstab file has been edited.
_____________________________________________________________
  
Bash # mount-
Bash # chroot/hda4/sbin/lilo-q
Bash # man chroot
Bash # chroot/hda4/sbin/lilo
_____________________________________________________________
  
You can also use/sbin/lilo to replace chroot. Lilo and option-r are actually
The command is the same as that of chroot. We strongly recommend that you use chroot instead of lilo
-R, because it is more convenient to use chroot and it is easier to identify errors.
_____________________________________________________________
  
Bash # man lilo
Bash #/sbin/lilo-r/hda4
_____________________________________________________________
  
3. Status 3: If LILO is invalid ..
If steps 1 and 2 fail to be resolved
'Mkbootdisk' has been used to create a boot chip (during installation or reference to 'Man mkbootdisk)
, Use your boot disk to boot and repair the split zone. Mkbootdisk exists in
Mkbootdisk *. rpm kit. you must install it. Notes: varies with releases
Difference; please contact your distribution kit vendor or organization)
4. status 4: If the preceding steps 1, 2, and 3 cannot solve the problem, and you have not started the system
Disk
If you have a computer in another linux system, log in as root and run the following command-
_____________________________________________________________
  
Bash $ man mkbootdisk
Bash # cp/etc/lilo. conf/etc/lilo-original.conf
_____________________________________________________________
  
Edit/etc/lilo. conf and enter the root partition format you obtained in 'condition 1'
Insert a blank disk and execute-
_____________________________________________________________
  
Bash # mkbootdisk/dev/fd0
_____________________________________________________________
  
Mkbootdisk exists in the mkbootdisk *. rpm kit. you must install it. Note:
Different release kits vary. please contact your release kit vendor or organization.) you must ensure that
/Etc/lilo-original.conf change back to the original file name/etc/lilo. conf !! Start with this
Perform step 3.
5. situation 5: This is the worst case. I hope you will not go to this level. Status 1 to 4 included
But if the connectivity steps 1, 2, 3, and 4 cannot be solved-
Step 1: Start the disk with tomsrtbt, mount the partition, and run the following command
Backup root partition to other partitions with disk space-
_____________________________________________________________
  
Edit/etc/fstab and write (the following simple code,
You may have to change according to the actual situation of your drive )-
/Dev/hda4/hda4 ext2 defaults 1 1
/Dev/hda11/b1 vfat defaults 1 1
Bash $ mkdir/hda4; mount/hda4
Bash $ mkdir/b1; mount/b1
Bash $ cd/
Bash $ df
Check whether/b1 has enough disk space to use tar to back up the root partition.
Bash $ tar cvf/b1/root-hda4.tar/hda4
_____________________________________________________________
  
Step 2: Add a Linux optical disc, reboot and install redhat linux
Linux distribution kit) in/dev/hda4 (but do not install any redundant suites, you only need
Install the root, boot system, and LILO manager. That is to say, select the minimum installation
Yes ). The installer will also install LILO on your hard drive. Restart linux now
Log on as the root user and run-
_____________________________________________________________
  
Bash $ man mkbootdisk
Bash # cp/etc/lilo. conf/etc/lilo-original.conf
_____________________________________________________________
  
Note: You must remember to copy the lilo-original.conf back to lilo. conf !! Edit
/Etc/lilo. conf and enter the format of the root partition obtained in 'condition 1 ';
Insert blank disk and execute-
_____________________________________________________________
  
Bash # mkbootdisk/dev/fd0
Bash # cp/etc/lilo-original.conf/etc/lilo. conf
__________
Related Article

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.