免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1559 | 回复: 1
打印 上一主题 下一主题

clonesuse [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-14 00:04 |只看该作者 |倒序浏览
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)

论坛徽章:
0
2 [报告]
发表于 2010-07-14 10:25 |只看该作者
学习+关注
等待有人测试
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP