我的UNIX装在一个4GB 的SCSI硬盘上,但是想对整个系统做备份,于是新买了一个4GB的SCSI硬盘,容量比老硬盘小几十兆,不能通进GHOST进行备份,能否利用dd 命令和 cpio 命令制作系统备份,希望有此经验的高手能尽快给予周详的解决方法.很感谢!

【发表回复】【查看CU论坛原帖】【添加到收藏夹】【关闭】
studyingunix 回复于:2004-01-02 11:33:57
必要条件:
目标盘空间应该>=源盘空间.

lvgreen 回复于:2004-01-02 11:53:57
我想,不能用分区对分区或盘对盘的方式克隆,但是用分区到映像应该能够吧。

areuhow 回复于:2004-01-02 12:07:00
我也遇过这个问题,就是买的SCSI盘较原来的SCSI盘稍小所以无法做GHOST,当时也没想过用DD或cpio命令,所以就重装了系统,再将其他复盖过来使其同原系统相同了

unix_sco 回复于:2004-01-02 14:17:19
转贴
在开始硬盘对拷之前,首先应将已安装好系统的源盘和空白目标盘分别配置跳线,安装在电脑上。开机,进入CMOS配置两块硬盘的参数,然后进入源盘的终极用户root,就能够开始拷贝了。
  以下是在digital P200微机上,SCO Open Server Release 5环境下进行硬盘对拷的过程。
  1.增加一块硬盘
  #mkdev hd 1 0
  Your root hard disk is attached to an IDE controller.
  Pick one of the choices below or you may quit and
  Invoke mkdev hd -u for a detail usage message.
  1)Add a hard disk to IDE controller
  2)Add a hard disk to SCSI controller
  3)Add a hard disk to an IDA controller(EISA)
  Enter 1,2,3,or enter 'q' to quit:(输入1)
  ……
  If you wish to exit the entire installation at this menu,
  Press the <DEL>key.
  Hard Disk Drive 1 Configuration
  1.Display current disk parameters
  2.Modify current disk parameters
  3.Select default disk parameters
  Enter an option or 'q' to quit:
  (这是dkinit程式的菜单。在此能够选1显示目标硬盘参数,如不符需要,可选2进行修改,然后输入q继续)
  ……
  1.Display Partition Table
  2.Use Entire Disk for UNIX
  3.Use Rest of Disk for UNIX
  4.Create UNIX Partition
  5.Activate Partition
  6.Delete Partition
  7.Create Partition
  Enter your choice or 'q' to quit:
  (这是fdisk程式的菜单。在此能够对目标硬盘按需要进行分区,然后输入q继续)
   ……
  1.Print Current Bad Track Table
  2.Scan Disk (You may choose Read-Only or Destructive later)
  3.Add Entries to Current Bad Track Table by Cylinder/Head Number
  4.Add Entries to Current Bad Track Table by Sector Number
  5.Delete Entries Individually from Current Bad Track Table
  6.Delete All Entries from Bad Track Table Please enter your choice or 'q' t 廯 t:
  (这是badtrk程式的菜单,选择2能够扫描查找硬盘上有问题的磁道,并对应到硬盘别处的正常磁道上,另外还建立一个坏道表。输入q继续)
  Enter the number of bad tracks to allocate space for
  (or press<return>to use the recommended value of 15):
  (回车)
  There are 2110657 blocks in the UNIX area.
  Please enter the number of file systems you want this area
  To be divided into,or press<Return>to get the default of 2 file system(s).
  (回车)
  The layout of the filesystems and swap area is now prepared.
  Do you wish to make any manual adjustments to the sizes or
  names of the filesystems or swap area before they are created
  on the hard disk?(y/n)
  (输入n)
  Making filesystems
  Hard disk initialization procedure completed.
  2.用dd命令将SCO UNIX硬盘自举程式从源盘拷入目标盘
  #dd if=/dev/hd0a of=/dev/hdla bs=1024 count=40
  3.用divvy命令在目标盘上建立可安装的文档系统
  #divvy-im /dev/rhdla
  There are 2095537 lk blocks in the UNIX area.
  Between 16000 and 512000 lk blocks should be reserved for the swap area.
  Please enter the swap-space allocation ,or press <Return>
  To get the default allocation of 24000 lk blocks:
  (回车)
  There are 2095537 lk blocks in the UNIX area.
  Between 15000 and 64000 lk blocks should be reserved for the boot filesystem.
  Please enter the boot-space allocation,or press <Return>
  To get the default allocation of 20000 lk blocks:
  (回车)
  Do you want a separate /u filesystem?(y/n)
  (输入n)
  The layout of the filesystems and swap area is now prepared.
  Do you wish to make any manual adjustments to the sizes or
  names of the filesystems or swap area before they are created
  on the hard disk?(y/n)
  (输入n)
  Making filesystems
  4.用divvy 命令查看并修改内分区(division)名
  #divvy/dev/rhdla
  Name Type New FS # First Block
  Last Block dll50 EAFS     no     0
  0 19999
  d1151 NON Fs          no     1 20000
  43999
  HTFS              no     2 44000
  2045725
  Not USED            no     3 -
  -
  Not USED            no     4 -
  -
  Not USED            no     5 -
  -
  recover NON FS         no     6 2045726
  2045735
  hdla WHOLE DISK        no     7 0
  2061831
  2045736 lk blocks for divisions,16096 lk blocks reserved for the system.
  n[ame] Name or rename a division.
  c[reate] Create a new file system on this division.
  t[ype] Select or change filesystem type on new filesystems.
  p[revent] Prevent a new file system from being created on
this.
  s[tart] Start a division on a different block.
  e[nd] End a division on a different block.
  r[estore] Restore the original division table.
  Please enter your choice or 'q' to quit:
  (输入n修改内分区名。在此分别将0,1,2内分区名修改为rb ,rs,rr)
  i[nstall] Install the division set-up shown.
  r[eturn] Return to the previous menu.
  e[xit] Exit without installing a division table.
  Please enter your choice:
  (输入i将内分区情况安装在目标盘上)
  Making filesystems.
  5.将目标盘引导文档系统安装到源盘上,并拷贝其内容
  #mount/dev/rb/mnt
  #cd/stand
  #find.-print|cpio-pdumv /mnt
  #umount/mnt
  6.将目标盘根文档系统安装到源盘上,并拷贝其内容
  # mount/dev/rr/mnt
  #find/-mount print|cpio-pdumv/mnt
  7.建立目标盘根文档系统中的文档系统安装点
  #cd /mnt
  #mkdir mnt stand;chmod 755 mnt stand;chgrp bin mnt stand
  #umount /mnt
  至此,拷贝完毕。

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!