Successful backup of UNIX system


SCO UNIX system is widely used in finance, insurance and other industries because of its stable and reliable characteristics, but its installation and maintenance is not an easy task for professional and technical personnel. The system maintained by the author is equipped with SCO UNIX operating system, Informix database and other application software. After installation, the core parameters, installation equipment and link core should be adjusted. It takes hours to install a complete system. If a backup of the system is made, then when the system fails, it is no longer necessary to install and configure the system in a hurry. The following are four methods of making UNIX system backup summarized by the author.

Method 1: Using hdcopy
It is a real hard disk physical copy software, requiring that the physical structure of two hard disks must be the same, and hdcopy supports any file system. The following examples are given to illustrate:

If the blank target disk to be copied is cLys = 4969, heads = 16, sec = 63, the source disk of SCO UNIX system is cLys = 2484, heads = 16, sec = 63, and the SCO UNIX partition in the source disk accounts for 528M (cly = 1024, heads = 16, sec = 63), then:

1. Connect the target disk with the SCO UNIX system source disk that needs backup on the same machine and use the target disk as the second hard disk.

2. Start the machine, enter the CMOS settings and set the above two hard disk parameters as: cLys = 1024, heads = 16, sec = 63 (note that in this case, the cLys value should be greater than or equal to 1024).

3. Restart, after booting with DOS disk, run hdcopy. This setting is simple. After input cLys = 1024, heads = 16, sec = 63 according to the prompt, the prompt line appears: Please sure CLY = 1024, sec = 63, heads = 16 [Y/N], input “Y” and start copying.

This method can make system backup quickly, and the process of copying in the preceding example only takes 4 minutes.

Method 2: Using Ghost replication system
When installing the SCO UNIX operating system partition, 65 tracks are reserved for boot and diagnostic purposes, rather than allocating them to UNIX partitions. If Ghost “disk-to-disk replication” is used, the remaining 65 tracks will be automatically added to UNIX partitions during the process, which will result in some applications not working properly. So in practice, we should choose another method provided by Ghost to clone: partition to partition. The methods are as follows:

1. Ibid. First connect the SCO UNIX system source disk and the blank target disk as the second hard disk.

2. Firstly, the target disk is partitioned to make it completely consistent with the partition in the source disk. There are two specific methods:

(1) Using aefdisk.exe, it is a disk partitioning program under DOS. It supports all partition formats. It is easy to use and can create and delete any partition format known at present. First boot the system with DOS disk and then execute the aefdisk command line. Assuming you want to build a 1.2G SCO UNIX partition on the second hard disk and activate the boot partition, enter the following command:

Aefdisk 2/pri: 1200:63:1 (2 for the second hard disk, 63 for the Unix partition, 1 for the partition number)
Aefdisk 2/activate:1 (activate boot partition)

(2) Turn on and enter the UNIX system as root, and type the fdisk command. Fdisk will operate the / dev / rhd00 device, which is the source disk. Display the partition table by number 1, write down the starting and ending position of SCO UNIX partition, then return to the command state and install the second hard disk.

# mkdev HD 10 (installing the main hard disk on the second IDE interface)

There are three options. If the hard disk to be added is IDE type, choose 1; if SCSI type, choose 2. Then some hard disk information is required, which is typically input by default. There is the fdisk menu option, which operates on / dev / rhd10 and partitions the target hard disk as needed. In this case, the start and end positions of the SCO UNIX partition just recorded should be entered into the new partition to activate the boot partition. When prompted:

Hard disk initialization procedure completed.

The installation and partition of the target disk have been completed.

3. Shut down. Then use the DOS disk to start the computer to run Ghost and select Partition to Partition under local. With the mouse to select the source and target partitions, Ghost will give a warning prompt, confirm it once, press the “yes” button, and start the replication process.

Method 3: Using Ghost image
Step 1: Making. GHO image file with Ghost

Connect the DOS partition hard disk with the SCO UNIX system source disk that needs backup on the same machine. The former serves as the second hard disk for storing image files. Start the machine, boot with DOS disk, run Ghost (version 5.0 or above), select Local Partion To Image, then specify the source partition and the disk and file name of the image file (such as Unix. GHO), select the “high compression ratio” and confirm, then Ghost starts to work.

Step 2: Use Ghost to restore the backup system, and give an example of its operation.

1. The SCO UNIX partition of the backup system source disk is 1.2G (if you don’t know the size, you can see the size of the source UNIX partition when running Ghost from the description of the generated image file). A new 1.2G SCO UNIX partition is created on the target disk to activate the boot partition.

2. Connect the hard disk with the target disk that contains the image file (assuming the name is Unix.GHO) and use the target disk as the second hard disk. After booting the system with DOS disk and running Ghost, select Local_Partion_From Image, specify the image file name Unix.GHO and the target partition 1.2G, then Ghost starts to restore the image file.

Method 4: Use “dd” command and “cpio” command
This method can make UNIX system backup by copying between hard disks of different UNIX partition sizes, while Ghost requires that the UNIX partition of the target disk be larger or equal than the UNIX partition of the source disk, but this method is slower than using Ghost. The following is the backup process in SCO OpenServer 5.0.4 environment.

1. Ibid. First connect the SCO UNIX system source disk and the blank target disk as the second hard disk. Then boot up, add a hard disk rhd10 to the source disk by superuser root, and activate the boot partition by UNIX partition according to the needs of the target hard disk (the specific method is described in Method 2).

2. Copy the SCO UNIX bootstrap program from the source disk to the target disk with the “dd” command:

#dd if=/dev/hd0a of=/dev/hdla bs=1024 count=40

3. Use the “divvy” command to set up an installable file system on the target disk:


The process is clear and can be typed by default.

4. Use the “divvy” command to view the inner partition name:


Remember the partition names d1150, d1151 and d1152 in 0, 1 and 2 and enter “q” to exit.

5. Install the target disk boot file system on the source disk and copy its contents:

#find.-print|cpio-pdumv /mnt

6. Install the target disk root file system on the source disk and copy its contents:

# mount/dev/d1152/mnt
#find/-mount print|cpio-pdumv/mnt

7. Establish the file system installation point in the target disk root file system:

#cd /mnt
#mkdir mnt stand;chmod 755 mnt stand;chgrp bin mnt stand

This successfully backed up the UNIX system.