linux系统GHOST备份方案
Windows系统备份可以用ghost工具软件完成,Linux系统不能完全依赖于ghost工具,一则是ghost本身是有版权的软件,二则ghost只支持ext2、ext3文件系统的Linux分区,不支持reiserfs、xfs等比较高级的文件系统,ghost本身并不备份mbr,因此常造成恢复后的系统grub出错的问题。
linux本身自带有着优秀的备份工具,传统如:tar、cpio、dd,新的有:bzip2、afio等。这里介绍两款备份整个Linux系统,类似于ghost的工具:ghost for linux和partition image for linux。
g
1。g
下载ISO文件刻录成光盘或者在VM中加载启动。
放入g
F1 选择核心版本 F2 准备映象 F3 启动 F4 条款说明
g
选择一个核心启动进入g
g
以指定的帐号备份linux系统到指定FTP服务器的指定目录下的映象文件。
像:g
2。partition image
该软件易用性比g
可能是由于晚上上网的原因,partition image官方网站一直上不去,没有下载,在此不继续做使用讨论,以屏幕截图来看,此款软件好于g
3.
以上两款软件都要求有FTP服务器,以存放备份映像文件。
**************************************************************************
G
200705 环境: WINXP+VM+CENTOS5 目标:DISK TO DISK备份CENTOS。 1.1.下载G 1.2. 为CENTOS4。3增加一个虚拟硬盘(目标盘),大小和系统盘一样(母盘)。 1.3。启动CENTOS4。3,把目标盘分成一个区,建立EXT3文件系统。不挂载。重启。 1.4。用G 1.5。#sh g 选择“RAW MODE ” 选择”CLICK N CLONE“ 整盘克隆。 选择母盘 SELECT SOURCE 选择目标盘 SELECT TARGET 选择”CLICK N CLONE“ 确认。 1.6。完成后,退出G 顺利启动,检查,一切和原来一样。 恢复测试:新加一个虚拟磁盘,用G 过程略,和上面一样。 备注: 如果目标盘容量》母盘,DISK TO DISK后,目标盘默认能用的容量和母盘一样大。 解决方法: ------------------------------- 5.1检查母盘的分区情况并记录: # df –h /dev/sda2 /dev/sda1 /dev/sda5 /dev/sda6 5.2检查母盘的分区表并记录 # fdisk /dev/sda Command (m for help ) : p Disk /dev/sda: 255 heads,63 sectors/track,1106 cylinders Units=cylinders of 16065*512=8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 459 3582495 83 Linux /dev/sda3 460 524 522112+ 82 Linux swap /dev/sda4 525 1106 4674915 5 Extended /dev/sda5 525 1041 4152771 83 Linux /dev/sda6 1042 1106 522081 83 Linux 5.3关机,将母盘下掉,然后将子盘设置成启动:
5.4顺利启动进入了系统,看来G 5.5检查子盘的分区情况并记录: # df –h /dev/sda2 /dev/sda1 /dev/sda5 /dev/sda6 这里可以看到G 5.5查看子系统分区表: # fdisk /dev/sda Command (m for help ) : p Disk /dev/sda: 255 heads,63 sectors/track,8924 cylinders Units=cylinders of 16065*512=8225280 bytes #### 这里的73402398720 bytes=8924*16065*512 ####### Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 459 3582495 83 Linux /dev/sda3 460 524 522112+ 82 Linux swap /dev/sda4 525 1106 4674915 5 Extended /dev/sda5 525 1041 4152771 83 Linux /dev/sda6 1042 1106 522081 83 Linux 分区表上显示的与母盘一致。 尝试着在最后增加新的分区: Command (m for help ) : n No free sectors available 没有多余的空间??? Command (m for help ) : v 显示还有 尝试着将最后一个分区删掉,然后新增分区,以为可能会找回丢失的容量 Command (m for help ) : d Partition number (1-6): 6 Command (m for help ) : n First cylinder (1042-1106,default 1042): 这里让我有点担心了,剩余的空间怎么会是:1042-1106呢?这个空间就是刚才删除的那个分区的空间啊, 看来什么地方有点问题。
继续查看分区表,发现: /dev/sda4 525 1106 4674915 5 Extended 原来是这里的Extended 已经将最后的结束柱面指定为1106了,只要修改成8924应该就可以找回丢失的容量 ,原因找到了,马上动手。
Command (m for help ) :d (删除分区) Partition number (1-5) :4 (这里的4是sda4,Extended) Command (m for help ) : p Disk /dev/sda: 255 heads,63 sectors/track,8924 cylinders Units=cylinders of 16065*512=8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 459 3582495 83 Linux /dev/sda3 460 524 522112+ 82 Linux swap Command (m for help ) :n (新建Extended分区) Command action e extended p Primary partion (1-4) e (输入e ,创建Extended分区) Select partion 4 First cylinder (525-8924,default 525):回车(终于看到8924了,^_^) Last Cylinder or +size or +sizeM or +sizeX (525-8924,default 8924): 回车 Command (m for help ) :p Disk /dev/sda: 255 heads,63 sectors/track,8924 cylinders Units=cylinders of 16065*512=8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 459 3582495 83 Linux /dev/sda3 460 524 522112+ 82 Linux swap /dev/sda4 525 8924 67473000 5 Extended Command (m for help ) :n(新建原来的sda5分区,注意一定要与原来的起始与结束的柱面一致) First cylinder (525-8924,default 525):回车 Last Cylinder or +size or +sizeM or +sizeX (525-8924,default 8924): 1041 Command (m for help ) :n(新建原来的sda6分区,同样注意一定要与原来的起始与结束的柱面一致) First cylinder (1042-8924,default 1042):回车 Last Cylinder or +size or +sizeM or +sizeX (1042-8924,default 8924): 1106 Command (m for help ) :n(新建多余空间的分区) First cylinder (1107-8924,default 1107):回车 Last Cylinder or +size or +sizeM or +sizeX (1107-8924,default 8924):回车 (全部做为新的分区 ,也可以继续进行细分,看个人需要了)
#### 查看所有的分区情况 #### Command (m for help ) :p Disk /dev/sda: 255 heads,63 sectors/track,8924 cylinders Units=cylinders of 16065*512=8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 459 3582495 83 Linux /dev/sda3 460 524 522112+ 82 Linux swap /dev/sda4 525 8924 67473000 5 Extended /dev/sda5 525 1041 4152771 83 Linux /dev/sda6 1042 1106 522081 83 Linux /dev/sda7 1107 8924 62798053+ 83 Linux 注意对应的Blocks的大小是否与母盘一致!! Command (m for help ) :w (保存并退出) 5.6建立新分区的文件系统: mkfs –t ext3 /dev/sda7 (小心操作,一定要注意是不是你所要建立的分区) 5.7建立新分区卷标: tune2fs –L/store /dev/sda7 (卷标自己根据需要定) 5.8加载新分区 mkdir /store mount –t ext3 /dev/sda7 /store |
附件下载:
linux
linux
