Using Norton Ghost to copy QNX 4.25 partition, success.

I had read some posts from the past where folks had trouble copying QNX partitions with Norton Ghost and not be able to get it to boot properly. I couldn’t find any success stories so I thought I would post what I did…

  • Installed the new hard drive as a slave.
  • Used fdisk on the new drive to create a QNX (77) partition larger than the one to be copied and set it up with a QNX loader and boot flag. (the destination partition will need to be at least the same size or larger for ghost to copy)
  • Reboot and used Norton Ghost 2003 floppy boot disk to perform a copy of the partition from the old drive to the new drive.

I have not fully tested this out long term, but so far it boots up and seems to work just fine. :slight_smile:

One last note: Ghost does not seem to recognize the data on the QNX partition so it will then simply copy the entire partition. In my case the partition was 20GB but the data was only about 200MB. It copied the entire 20GB which took about an hour to do. I know when copying a MS Windows partition, it will only copy the actual data on that partition. Not a problem, just beware it may take longer than you think.

It won’t work properly, you probably don’t have all available space, the .bitmap from the small disk will be too small and won’t have mapping for the extra space.

Maybe chkfsys can correct that problem and grow the .bitmap file.

I managed to by using the disk image option in Ghost and no compression.

For copying partition it is necessary to execute the following steps:

  1. Installed the new hard drive as a slave.
  2. Used fdisk on the new drive to create a QNX (77, 78 or 79) partition
  3. Initialized partition with dinit
  4. mount this partition as the directoty of the partition-source
  5. with command “cpâ€

The text of a script for performance of a step 2-5:

#!/bin/sh
#***********************************************************************
#ifdef __USAGE

#%C duplicates QNX hard drives.

File: QNX_drive_copy

Description:

This program creates logical copies of hard drives, as opposed to “dd”

image copies. Therefore it does not rely on matching drive geometeries,

does not copy unused parts of the drive and the copy is defragmented.

This script assumes the drives use Logical Block Addressing (LBA) mode,

and are only one partition, and that partition is QNX of course.

Licenses and "bootability is preserved. A log of is saved in /tmp/log.

Keywords: duplicate hard drive disk copy image format master

Supplemental:

Only tested with QNX 4.24, single partition, LBA, IDE drives only.

The complete procedure to copy drives involves the following steps:

1. Insert the master (source) and slave (blank) hard drives.

Depending of the machine setup, slave drives usually needs to

have a jumper removed.

2. Boot QNX in a safe mode where there are no programs running that

may asynchronously write to the hard drive during the following

procedure. If you can’t guarantee this, you should use a QNX

boot floppy and mount the hard drive manually.

3. Login as root.

4. Verify the Master drive has the kernel built to force LBA option

during boot up. Check /boot/build/hard.?? has the line

“Fsys.eide fsys -h 64,63”, (i.e, sectors,heads for LBA mode.)

5. Run this script.

#endif
#***********************************************************************

LOG=/tmp/log # Must be an absolute path.

read ANS?“Do you want copy QNX to /dev/hd1 on free space? Press “y” to continue.”
[ x"$ANS" = x"y" ] || exit

exec 4>&1 # Use file descriptor 4 to remember where stdin used to go to.

{
set -x # to show commands as they are exectued.

# Display number of cylinders free.

fdisk /dev/hd1 QUERY FREE

# Creating default entries on the partition table.
#  1.  Creating a single partition table using all available disk space
#  2.  QNX Loader
#  3.  Setting the boot flag

fdisk /dev/hd1 add -f1 QNX ALL BOOT QNX LOADER

mount -p /dev/hd0.0t78

dinit -h /dev/hd0.0t78
dinit -hb /dev/hd0.0t78
if mount /dev/hd0.0t78 /hd1 ; then
    :
else
    echo "############ ERROR #############"
    use $0
    exit
fi

# Output of dcheck has been left out of the log file, due to to enormous
# amount of information dcheck outputs.  Also you can remove it for modern
# big drives, where I've never seen it fail and it takes a long time.
dcheck -m /dev/hd0.0t78 1>&4

# Copy files from master to slave drive, except for those to do with
# drive geometries and the current growing log file.
cp -Rpv -P!/hd78/.inodes -P!/hd78/.bitmap -P!/hd78/tmp/log /hd78/ /hd1

#Delete own directories
rm -rf /hd1/tmp/*
rm -rf /hd78/etc/config/trap/*

rm -rf /hd1/install/*

rmdir /hd1/install

# Due to the encrypting mechanism on /etc/licenses we use license program.
rm -rf /hd1/etc/licenses/*
license /hd78/etc/licenses /hd1/etc/licenses

fdisk /dev/hd1 LOADER BOOT QNX # Install QNX boot loader.

fdisk /dev/hd1 QUERY BOOT LOADER # Display # of cylinders.

} 2>&1 | tee /hd78/tmp/log

cp -v /hd78/tmp/log /hd1/tmp # Place the final full log file on the copied drive.
sync
exit