在不同容量硬盘之间拷贝安装UNIX的方法:
在开始硬盘对拷之前,首先应将已安装好系统的源盘和空白目标盘分别设置跳线,安装在计算机上。开机,进入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 dll50EAFSno0
0 19999
d1151 NON Fsno120000
43999
HTFSno244000
2045725
Not USEDno3-
-
Not USEDno4-
-
Not USEDno5-
-
recover NON FSno62045726
2045735
hdla WHOLEDISKno70
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
至此,拷贝完毕。