×ðÁú¿­Ê±¹ÙÍøµÇ¼

³£ÓõÄLinux ϵͳ±¸·Ý¡¢»Ö¸´ÏÂÁî

ɾ¿âÅÜ·µÄʾ­³£Ìý˵£¬²»¹ý£¬ÕâÖ»ÄÜÊǸöÞÉÂäµÄ»°Ì⣬ÕæÕýµÄÊÂÇéÖпɲ»¿ÉÕâô¸É£¬²»È»£¬¿âÊÇɾÁË£¬Â·ÅÂÊÇÅܲ»ÁËÁË¡£

ÒÔÊÇ£¬±¸·ÝºÜÖ÷Òª£¡£¡£¡£¡£¡

tar ÏÂÁî

¸±±¾£¨±¾»ú±¸·ÝÕû¸öϵͳ£¬ÒÔºó»¹Ô­Õվɻ¹Ô­µ½±¾»ú£©

×¢ÖظùĿ¼ÏÂÒªÓи»×ãµÄ¿ÉÓÿռäÓÃÓÚ±¸·Ý¡£

cd /
#tar.gzÃûÌÃ
tar cvpzf system_backup.tar.gz / --exclude=/proc --exclude=/lost+found --exclude=/system_backup.tar.gz --exclude=/mnt --exclude=/sys

#tar.bz2ÃûÌÃ
tar cvpjf system_backup.tar.bz2 / --exclude=/proc --exclude=/lost+found --exclude=/system_backup.tar.bz2 --exclude=/mnt --exclude=/sys


# »Ö¸´ÏµÍ³
cd /
#ÉÏ´«Îļþµ½¸ùĿ¼ÏÂ
tar xvpfz system_backup.tar.gz -C /
»ò
tar xvpfj system_backup.tar.bz2 -C /

#½¨×°±¸·Ýʱɨ³ýµÄĿ¼
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys

µÇ¼ºó¸´ÖÆ

/proc ȨÏÞ£ºÎļþËùÓÐÕߣºrootȺ×飺root ËùÓÐÕߣº¶ÁÈ¡ Ö´ÐРȺ×飺¶ÁÈ¡ Ö´ÐÐ ÆäËü£º¶ÁÈ¡ Ö´ÐÐ

/lost+found ȨÏÞ£ºÎļþËùÓÐÕߣºrootȺ×飺root ËùÓÐÕߣº¶ÁÈ¡ дÈë Ö´ÐРȺ×飺¶ÁÈ¡ Ö´ÐÐ ÆäËü£º¶ÁÈ¡ Ö´ÐÐ

/mnt ȨÏÞ£ºÎļþËùÓÐÕߣºrootȺ×飺root ËùÓÐÕߣº¶ÁÈ¡ дÈë Ö´ÐРȺ×飺¶ÁÈ¡ Ö´ÐÐ ÆäËü£º¶ÁÈ¡ Ö´ÐÐ

/sys ȨÏÞ£ºÎļþËùÓÐÕߣºrootȺ×飺root ËùÓÐÕߣº¶ÁÈ¡ дÈë Ö´ÐРȺ×飺¶ÁÈ¡ Ö´ÐÐ ÆäËü£º¶ÁÈ¡ Ö´ÐÐ

ËÑË÷ÃñÖÚºÅLinuxÖÐÎÄÉçÇøºǫ́»Ø¸´¡°Ë½·¿²Ë¡±£¬»ñÈ¡Ò»·Ý¾ªÏ²Àñ°ü¡£

»Ö¸´Íê³ÉÖØÆôÒÔºó£¬ÒÔÊǵÄÊÂÇ鶼»áºÍÄ㱸·ÝµÄʱ¼äһģһÑù¡£

¾µÏñ£¨±¾»ú±¸·Ýϵͳ£¬»¹Ô­µ½ÐÂÖ÷»úÉÏ£©

1,¼ì²éϵͳ°æ±¾£¬ÔÚÄ¿µÄ»úÉÏ×°ÖÃÒ»Ñù°æ±¾µÄϵͳ(×î¼ò×°Öü´¿É),·ÖÇøÃûÌã¬ÀàÐÍÒ²Ò»Ñù£¨ÎÒûÊÔ¹ý·×ÆçÑùµÄÇéÐΣ¬²»ÖªµÀÄÜ·ñÀֳɣ©

lsb_release -a
uname -a
df -Th
free -h

µÇ¼ºó¸´ÖÆ

2£¬±¸·ÝԴϵͳ

# ÓÉÓÚÄ¿µÄ»úºÍÔ´Ö÷»úÓ²¼þÉèÖòî±ð£¬ÒÔÊÇɨ³ýdev£¬tmp£»ÔÙÊʵ±ÔöÌíÄãҪɨ³ýµÄÎļþ£¬È磺--exclude=/root/*.bz2
# ÕâÀïÔÙmntÏÂÓи»×ã¿Õ¼ä£¬ÒÔÊÇÉúÑĵ½mntÏ¡£
cd /
tar cvpzf /mnt/system_backup.tar.gz / --exclude=/mnt/system_backup.tar.gz \
--exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/dev \
--exclude=/tmp --exclude=/media

# ÉÏ´«µ½Ä¿µÄÖ÷»ú
scp /mnt/system_backup.tar.gz root@192.168.0.166:/mnt

µÇ¼ºó¸´ÖÆ

3,ÔÚÄ¿µÄ»úÉÏÓÃISO¡¢LiveCDµÈÆô¶¯£¬¹ÒÔØ´ÅÅÌ£¨Ò»Ñùƽ³£»á×Ô¶¯¹ÒÔص½/mediaÎļþ¼Ð£©

sudo -s  
cd /media/<¶ÔÓ¦µÄuuidºÅ>
# ±¸·ÝÖ÷ÒªÉèÖÃÎļþ/boot/gurb/gurb.cfg /etc/fstab
¼Í¼ÄÚÀïµÄUUID£¬

# ɾ³ýÖظ´Îļþ
# ³ýÁËÉÏÃ汸·Ýϵͳʱɨ³ýµÄһЩÎļþ¼ÐÍ⣬ºÃ±È˵dev mnt media sysÕâЩÎļþ¼Ð£¬ÆäËûËùÓÐɾ³ý¡£
rm -rf root home usr lib lib64 etc var bin sbin opt boot run selinux vmlinuz initrd.img

# »¹Ô­±¸·Ý
mount /dev/vda1 /mnt/1
# ÕâÀï×¢ÖØÍòÍò²»ÒªÐ´/Ŀ¼£¬»á°ÑÏÖÓеÄϵͳ¸ã¹Ò£¡£¡£¡Ó¦¸ÃÊǹÒÔصÄĿ¼
tar xvpfz system_backup.tar.gz -C /mnt/1
cd /mnt/1       #´ËʱÄã¿ÉÒÔ¿´µ½¸ùĿ¼µÄ½á¹¹£¬¿ÉÊDZ༭fstabÎļþ·¢Ã÷ÊÇÏÖÓÐϵͳµÄfstab
chroot ./       #Ö´ÐÐchrootºó»áÒÔ./Ŀ¼Ϊ¸ùĿ¼£¬Õâʱ±à¼­µÄÎļþ¾ÍÊÇÕæÕýµÄÄ¿µÄÔ´ÎļþÁË¡£

µÇ¼ºó¸´ÖÆ

»¹Ô­ºóÐÞ¸Ä/etc/fstabÀïµÄUUIDΪ¸Õ¸Õ±¸·ÝµÄÎļþÄÚÀïµÄÐÅÏ¢£¬×¢ÖØ·ÖÇøÃûÌÃÒ²Òª¶ÔÓ¦¡£

ÐÞ¸Ä/boot/gurb/gurb.cfgÀïµÄUUIDΪ¸Õ¸Õ±¸·ÝµÄÎļþÄÚÀïµÄÐÅÏ¢¡£ÐÞ¸ÄÍø¿¨¡¢IPÉèÖÃÎļþ£¬ÒÔ·ÀÎÞ·¨·ÖÅÉIP¡££¨ÈôÊÇÊÇÐéÄâ»ú¼ÇµÃÌí¼ÓÍø¿¨£¬ÉèÖÃÖеÈÐÔÄܵÄÏÔ¿¨£©

ÈôÊÇÓÐÒÀÀµÓÚÔ­ÓÐƽ̨µÄЧÀÍ£¬ÈçÄÚ½¨NTP£¬AgentµÈ¼à¿Ø³ÌÐò £»¹Ø±ÕЧÀÍ£¬¹Ø±Õ¿ª»ú×ÔÆô £»

Ubuntu£ºÔÚÏÂÁîÐÐÊäÈërunleve¿ÉÒÔÉó²éÄ¿½ñÔËÐ춱ð£¬Ò»Ñùƽ³£Ä¬ÈÏÊÇ2

Éó²é/etc/rc2.dĿ¼ÖеÄS¿ªÍ·µÄЧÀͶ¼ÊǻῪ»ú×Ô¶¯ÔËÐеÄ £»ÄÚÀïÊÇÈíÁ´½Ó£¬ÏëÌí¼ÓµÄ»°×Ô¼º½¨Ò»¸öÁ´½ÓÎļþ¾Í¿ÉÒÔ£¬S´ú±ístart£¬ºóÃæÊý×ÖÊÇÆô¶¯Ë³Ðò£¬É¾³ýÈíÁ´½Ó¡£Í¬Ê±É¾³ý/etc/init.d/϶ÔÓ¦µÄ¾ç±¾¡£

vim /etc/init.d/rc.local
Centos:ÓÃsystemctl

µÇ¼ºó¸´ÖÆ

Íê³ÉÉÏÊö°ì·¨ºó

exit      #Í˳öchroot
cd ~
umount /mnt/1

# Ò»ÇÐÍê³Éºó¾Í¿ÉÒÔÖØÆôÁË£¬²»³öÒâÍâ¾ÍÕý³£Æô¶¯Ï½µµÍË£¨Æô¶¯ºóÔ­À´×°ÖÃϵͳʱÉèÖõÄÕË»§µÈËùÓÐÏûÊÅ£»ÕË»§ºÍÔ´Ö÷»úÒ»Ö£©¡£
Èô¿ª»úGrubÌáÐÑ¡°boot error 15 :Error 15 file not found¡±
½â¾öÒªÁ죺Çë¼ì²éGRUBÏà¹ØÎļþµÄÄÚºËÎļþËùÔÚλÖá£Í¨³£Óë/boot·ÖÇøÓйØ¡£
 
Èô¿ª»úGrubÌáÐÑ¡°dracut:dono't how to hand root=f078¡±
½â¾öÒªÁ죺½«root=UUID¸Ä³Éroot=/dev/sdaXÕâÖÖÃûÌá£
 
Èô¿ª»úϵͳÌáÐÑ/usr/libexec/gconf-sanity-check-2Í˳ö״̬256µÄ½â¾ö
½â¾öÒªÁ죺chmod 777 /tmp

µÇ¼ºó¸´ÖÆ

rsyncÏÂÁî

×¢ÖØÄ¿µÄ·ÖÇøµÄÃûÌÃ×îºÃÊÇNTFS¡¢FAT¡¢EXTÖ®ÀàµÄÃûÌã¬×èÖ¹Óöµ½´óÓÚ4GµÄÎļþÎÞ·¨±¸·ÝµÄÎÊÌâ¡£

#×îºÃÓÐÆäËû·ÖÇø»òÍâ½Ó´æ´¢×°±¸£¬¹ÒÔغã¬df -lh¿´¹ÒÔصã¡£
#±¸·Ý
rsync -Pa / /media/usb/backup_20170410 --exclude=/media/* --exclude=/sys/* --exclude=/proc/* --exclude=/mnt/* --exclude=/tmp/*

#»Ö¸´

rsync -Pa /media/usb/backup_20170410 /

µÇ¼ºó¸´ÖÆ

ddÏÂÁî

ddÏÂÁîÊôÓÚÉÈÇø¿Ë¡£¬Ä¿µÄ·ÖÇøÒª±È±¸·Ý·ÖÇøÒª´ó£¬×ÝȻûÓÐʹÓõĿռäÒ²»á±»Ô­Ñù¿Ë¡ÏÂÀ´£¬»á½ÏÁ¿Âý¡£

#±¸·Ý
df -h   #Éó²éϵͳËùÔÚ·ÖÇø
dd if=/dev/sda1 of=/dev/sdb3     #±¸·Ýsda1µ½sdb3ÖÐ

#»Ö¸´
dd if=/dev/sdb3 of=/dev/sda1     #»Ö¸´sdb3µ½sdb1ÖÐ

µÇ¼ºó¸´ÖÆ

ÒÔÉϾÍÊdz£ÓõÄLinux ϵͳ±¸·Ý¡¢»Ö¸´ÏÂÁîµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ