Linux fault recovery skills

zhaozj2021-02-16  50

No matter what operating system you run, in many cases, you will face disaster recovery operations. Your main boot area is overwritten, your hard drive can not start, or an important file is deleted, or your display card is flashing when you start. This article will make some skillful discussions on these issues, helping you have no hand in hand when encountering these problems.

First, it is necessary to start the floppy disk. When you install Linux, you will generally ask for a one, so you should have this disk. If you haven't built it yet, hurry to build a one, what? I don't know how to do it? Very simple, usually using the mkbootdisk command under the general Linux system. The following parameters, as long as you look at your help, you should understand.

First use

# uname -a

system hint:

Linux Albertxu 2.2.16-2.0 # 1 Sun May 20 16:53:41 Est 2001 i586 Unknown

To look at the system's kernel version. We know that the system's kernel version is 2.2.16-2.0.

Then use

# mkbootdisk - DEVICE / DEV / FD0 2.2.16-2.0

system hint:

INSERT A Disk In / dev / fd0. Any Information on the disk will be lost.

Press to Continue or ^ c to Abort:

Insert the disk and wait for a while until the disk is established. In this way, the emergency start floppy disk is built.

In addition to the above approach, another method is to use TomsRTBT to establish a boot floppy disk. First introduce the installation steps for this program:

# Gunzip TomsRTBT-1.7.218.tar.gz # tar -xvf TomsRTBT-1.7.218.tar # rm TomsRTBT-1.7.218.TAR # cd TomsRTBT-1.7.218 / # ./install.s

According to the screen, this software uses high-density compression to compress a variety of Linux tools to a single 1.7 MB of floppy disks.

The default disk contains the following programs, drivers and kernels:

2.0.37 3c589_cs BusLogic DEC_ELCP EEXPRESS EEXPRESS_PRO EL2 EL3 EXT2 FAT FAT32 FD IDE IDECD IDEFLOPPY IDEPCMCIA IDETAPE ISO9660 JOLIET LOOP MATH_EMULATION MINIX MSDOS NE2000 NFS PROC RAM SD SERIAL SLIP SMC SR ST TR ULTRA VFAT VORTEX WD80x3 ah152x_cs aha152x aha1542 aic7xxx ash awk badblocks bdflush bzip2 cardbus cardmgr cat ce ce.help chattr chgrp chmod chown chroot clear cmp cp cpio cut date dd ddate debugfs df dirname dmesg ds du dumpe2fs e2fsck eata echo egrep elvis emacs extend false fdflush fdformat fdisk fdomain filesize find findsuper fmt fsck.ext2 fsck.msdos fstab grep gzip halt head hexedit hostname i82365 ifconfig ifport ile init inittab insmod kill killall5 ksyms length less libc.so.5.4.13 lilo lilo.conf ln loadkeys login losetup ls lsattr mawk md5sum memtest mingetty miterm mkdir mkdosfs mke2fs mkfifo mkfs.minix mklost found mknod MKSWAP MNSED MOUNT MT MV NC NCR53C8XX NMCLAN_CS NTFS PAX PCMCIA PCMCIA_CORE PCNET_CS PING PLIP PPA Printf PS PWD QLogic_CS QLogicfas Reboot rescuept reset rm rmdir rmmod route rsh rshd script scsi_info seagate sed serial_cs setserial sh slattach sleep slip snarf sort split stty swapoff swapon sync tail tar tcic tee telnet test touch tune2fs umount undeb update vi vi.help wc most reassuring is that, tomsrtbt is A program that is not related to the release version, even you can use it to restore Windows 9x.

After losing the main boot record, Linux can't start. The boot floppy disk using the Red Hat is simple, as long as you start, log in with root, and then run LILO.

The method of using TomsRTBT is to log in with root after startup, then take the floppy disk.

# mount -t ext2 / dev / hda4 / mnt # chroot / mnt # / sbin / lilo added linux * added dos # EXIT # CD / # umount mnt

A rescue.img file is provided before the version of Red Hat 6.2, which can be used to create a separate emergency disk and use it with the boot floppy disk. At the LILO: prompt, type Linux Rescue and follow the prompt operation, after the 6.2 version, the Red Hat uses the emergency recovery function to install the CD. After using the CD, type "rescue". Now suppose your / etc / fstab exists an input error, you write the boot disk / dev / hda4 to / dev / hda44 so your system cannot start.

Start with TomsRTBT floppy disk, modify / etc / fstab as follows.

# mount -t ext2 / dev / hda4 / mnt # VI / MNT / ETC / FSTAB # umount / mnt

Another common problem is that there is no normal shutdown, and TomsRTBT can be used to repair a corrupted disk partition.

# e2fsk -f / dev / hda2

For a serious damaged partition, this command needs to be repeated several times.

If a partition can't completely fix it, you can write important files to disk. When TomsRTBT starts, load these files into memory and can use disk space for other applications.

# fdformat / dev / fd0h1440 # mke2fs / dev / fd0 # mkdir / mnt / image # mnt / mnt / floppy # mount -t ext2 / dev / hda4 / mnt / image # mount -t ext2 / dev / fd0 / mnt / floppy # CD / mnt / floppy # cp /mnt/image/etc/*.conf. # cp /mnt/image/etc/conf.modules. # CP / MNT / Image / VAR / NAMED / *. # CP / MNT / Image / home / gwilburn / docs / myrecipes.txt. # cd / mnt # umount floppy # umount image

The above steps use FDFormat, MKE2FS, Mount, CD, and CP commands, which are included in TomsRTBT. In this case, we make back up the / etc directory profiles and DNS files.

The following example is to use TomsRTBT to restore an example of Windows.

# MKDIR / MNT / WIN # MKDIR / MNT / FLOPPY # mount -t vfat / dev / hda1 / mnt / win # mount -t vfat / dev / fd0 / mnt / floppy # vi /mnt/win/autoexec.bat # CD / mnt / floppy # cp /mnt/win/autoexec.bat. # cp /mnt/win/config.sys. # cp "/ mnt / win / program file / netscape / bookmarks.htm". # CD / MNT # umount FLOPPY # umount win

The disaster does not happen frequent, but the most important thing for disaster preparation is to back up the data. All the technologies we discussed is only some of the measures that can be taken in the event that data can be recovered. As a professional system management personnel, if there is no data backup, then this so-called "professional" is unrestrained.

转载请注明原文地址:https://www.9cbs.com/read-19665.html

New Post(0)