- 论坛徽章:
- 0
|
clonesuse.tar
(24.5 KB, 下载次数: 15)
做了个小工具,备份恢复SUSE企业版的脚本。
./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
恢复的时候需要一个急救系统,要求必须是SLES10/11的rescue system,可以用sles10/11
的安装盘启动到rescue system,也可以把急救系统做到移动硬盘启动,方法如下:
一、准备一个移动硬盘
不推荐使用U盘,因为U盘的写入性能和数据可靠性比较差。
二、在一个现有的SLES10环境下给移动硬盘分区
1、插入移动硬盘,用lsscsi命令查看是否识别出型号
# lsscsi
2、假设识别出来的硬盘为/dev/sdb,首先清空硬盘分区表
# parted /dev/sdb -s mklabel msdos
3、创建一个linux分区
# cfdisk /dev/sdb
在cfdisk界面中创建一个大小至少为4GB的Linux分区,最后移动光标到”write”菜单写入新分区表。
4、格式化新分区
# mkfs.ext3 /dev/sdb1
除了上述方法,您也可以插入移动硬盘之后用yast的分区管理器来创建分区。
三、将急救环境的文件拷贝到移动硬盘上
# 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比较旧,建议用附件的版本。
四、给移动硬盘配置启动管理器
1、首先检查/boot/grub/device.map文件,确保有类似一行
(hd2) /dev/sdb
如果没有,手动加上
2、执行grub程序
# grub --no-floppy
grub> root (hd2,0)
grub> setup (hd2) |
|