- 論壇徽章:
- 0
|
clonesuse.tar
(24.5 KB, 下載次數(shù): 15)
2010-07-14 00:01 上傳
點(diǎn)擊文件名下載附件
做了個(gè)小工具,備份恢復(fù)SUSE企業(yè)版的腳本。
./clonesuse [options]
options :
-clone <backup name>
-restore <backup name>
-d <path of backup>
--hw-reconfig
-v
Description :
Clonesuse is a command line tool to backup and restore SLES 9/10/11 system,
including the files of system and 3rd party softwares.The -clone mode can run
on running system,but -restore mode can only run on SLES 10's Rescue System
which boot from installation CD/DVD or PXE.
By default,backup can be only saved to network filesystems like smbfs/cifs/nfs,
to ignore this limit,please add a parameter "--ignore-netfs", for example :
# ./clonesuse -clone sles-10-sp3 -d /mnt/hd --ignore-netfs
To restore a backup to different hardware environment,set the --hw-reconfig,it
will automatically detect and re-config SATA/SCSI/Network/X11
# ./clonesuse -restore sles-10-sp3 -d /mnt/hd --hw-reconfig
If you only want to mount the volumes in /etc/fstab to /dev/shm/hd,the clone or
restore mode is not required to specified:
# ./clonesuse --mount-fstab
# ./clonesuse --umount-fstab
恢復(fù)的時(shí)候需要一個(gè)急救系統(tǒng),要求必須是SLES10/11的rescue system,可以用sles10/11
的安裝盤啟動(dòng)到rescue system,也可以把急救系統(tǒng)做到移動(dòng)硬盤啟動(dòng),方法如下:
一、準(zhǔn)備一個(gè)移動(dòng)硬盤
不推薦使用U盤,因?yàn)閁盤的寫入性能和數(shù)據(jù)可靠性比較差。
二、在一個(gè)現(xiàn)有的SLES10環(huán)境下給移動(dòng)硬盤分區(qū)
1、插入移動(dòng)硬盤,用lsscsi命令查看是否識(shí)別出型號(hào)
# lsscsi
2、假設(shè)識(shí)別出來(lái)的硬盤為/dev/sdb,首先清空硬盤分區(qū)表
# parted /dev/sdb -s mklabel msdos
3、創(chuàng)建一個(gè)linux分區(qū)
# cfdisk /dev/sdb
在cfdisk界面中創(chuàng)建一個(gè)大小至少為4GB的Linux分區(qū),最后移動(dòng)光標(biāo)到”write”菜單寫入新分區(qū)表。
4、格式化新分區(qū)
# mkfs.ext3 /dev/sdb1
除了上述方法,您也可以插入移動(dòng)硬盤之后用yast的分區(qū)管理器來(lái)創(chuàng)建分區(qū)。
三、將急救環(huán)境的文件拷貝到移動(dòng)硬盤上
# mkdir /mnt/usb
# mount /dev/sdb1 /mnt/usb
# cd /mnt/usb
# tar zxf /tmp/rescue.tar.gz
# cd /
# umount /mnt/usb
rescue.tar.gz從這里下載:
http://d.namipan.com/d/601b2c05d ... 3adc976ad7861024304
注意,里面的clonesuse比較舊,建議用附件的版本。
四、給移動(dòng)硬盤配置啟動(dòng)管理器
1、首先檢查/boot/grub/device.map文件,確保有類似一行
(hd2) /dev/sdb
如果沒有,手動(dòng)加上
2、執(zhí)行g(shù)rub程序
# grub --no-floppy
grub> root (hd2,0)
grub> setup (hd2) |
|