I. Linux backup strategy
1.tar Full Backup
-N YYYY-MM-DD Backup: Post-update documents
File See CTime
Catalogue See Atime
- p retain the original attribute permission
- P retains the original absolute path unchanged
--exclude Exclude documents that do not need to be backed up
2.touch: Modify file time and create new file
Atime: The contents of the file are taken, such as Cat
Mtime: File content data is changed
CTime: Changes in the state of a file, such as permissions and attributes
Ls-lu View Atime
L View Mtime
-lu View CTime
3.stat: View response time information for the corresponding file
4.dump-level [options] ...-f backup location source data
-0 Full Backup 1 backup after 0 changes, 2 backup after 1 changes
-j Enable bzip2
-s check how much disk space is required for this backup
-U updates the time of this backup to/etc/dumpdates when backing up a single file system
-W checks if the flagged dump partition has been backed up
5.restore [Options] ...-f backup location
-T View the list of backup documents
-R recovering data from backup location
-X refers to data from a backup device (non-compressed)
-C Compare backup files to current file differences
-I interactive recovery operation mode
6. Make a full backup for/boot
dump-0-f/root/boot.dump/dev/sda1
7. Recover/boot partition
-f Specifies the location of the backup
Cd/boot//Switch to destination folder
RESTORE-TF/ROOT/BOOT.DMP//Check Backup
RESTORE-RF/ROOT/BOOT.DMP//Recover Data
8. Make ISO image from CD
Copy disc mirroring using CP
-Direct CP device file, not mount directory
Cp/dev/cdrom/bak/linux-tools.iso
Ls/bak
Mount-o loop/bak/linux-tools.iso/mnt//Mount image file to folder
File Rhel-5.9x86_64_dvd.iso//view files type
Or
DD If=/dev/cdrom Of=/isos/rhel.iso
Or
Cat/dev/cdrom >/isos/rhel.iso
Two. System troubleshooting
1. Device Copy/Clone
DD tool, direct read and write magnetic sector
-D if= input device of= output device bs= block size count= block number
Copy disk SDA to SDB block size = 512 bytes =mbr
dd IF=/DEV/SDA of=/dev/sdb bs=512 conut=1
2. Recovering MBR sector failures
DD IF=/DEV/SDA of=/mnt/sdb1/sda.mbr bs=512 conut=1//Backup
DD If=/dev/zero OF=/DEV/SDA bs=512 conut=1//destruction
Mkdir/tdir; Create a new Folder
Mount/dev/sdb1/tdir//Mount backup disk
DD if=/tdir/sda.mbr OF=/DEV/SDA bs=512 count=1
3. (1) Fix grub boot failure
1. After the grub> prompt, manually perform the boot
Grub>root (hd0,0)
Grub>kernel/vm. RO root=/dev/sda2//the partition where the root file is located
Grub>initrd/initrd ...
Grub>boot
2. After entering the system, rebuild the grub.conf configuration file
(2) When the Grub boot program is destroyed, it needs to go into repair mode and rebuild the GRUB program.
Chroot/mnt/sysimage//Switch to the system you want to repair
cd/boot/grub/
GRUB-INSTALL/DEV/SDA//Rebuilding Grub Boot
After entering the system, rebuild the grub.conf configuration file
4./ect/inittab file is missing
Fault is now like
Start Prompt "... Init:no inittab file Found "
Solution: Reload the initscripts package in first aid mode
Chroot/mnt/sysimage
MOUNT/DEV/HDC/MNT//Mount
RPM-IVH/MNT/SERVER/INITSCRIPTS-.RPM--force//Forced installation
5. Forgotten Root User password
Boot in single user mode, then reset password
Grub>kernel ... 1//Enter the Grub interface press the E cursor to navigate to the kernel and then press the e space to write 1
Enter and press B to start the Reset password passwd 123
This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1790254
11. View and test network, configure network address, kernel and module management