Help!!! How to clone a harddisk with qnx os install

Hi all

What are the proper means of cloning a harddisk with qnx installed to a flesh new harddisk. Just want to have a back up just in case the old harddisk fail me

Please advise


Finally clone a hard disk

just in case any one face the same problem

Try searching for the software “g4u” is free and work pretty well

I have recently carried out the same task for a dual-boot QNX/WinXP machine.

I used a “live” bootable linux CD (Knoppix) and then used “dd” to create an image
of the hard drive on an external USB drive.

dd if=/dev/hda of=/media/usbDrive/image.bin

Then boot the live CD on the other machine and restore with

dd if=/media/usbDrive/image.bin of=/dev/hda

In this case the hard drives were identical, and the USB drive was large enough to hold a full copy of the original disk. You could also use dd and gzip to compress the image as you create it.

To go a step further I have also taken this disk image and restored it inside a VMware virtual machine and use the free VMplayer to boot and run this machine under Win XP.


If the QNX partition is all you need you can just copy the data. This is tricky in 6.2.x because of the package file system, but it’s no problem on 6.3.

Here’s the sequence, assuming that you have a blank hard drive showing up as /dev/hd1 and your source disk is mounted as /

  1. Create a QNX partition (usually type 79), add the boot loader, and mark the partition as loadable using fdisk. I usually do this using fdisk interactively, but the following would also work:
    fdisk /dev/hd1 add -b
    fdisk /dev/hd1 loader

  2. Enumerate the partitions; this will happen automatically if you reboot, but you can just type:
    mount -e /dev/hd1

  3. You now have a /dev/hd1t79. Before you can mount it you need to dinit it:
    dinit -h /dev/hd1t79

  4. Mount the partition (I’ve chose “hdnew” as the name, but it doesn’t matter):
    mount /dev/hd1t79 /hdnew

  5. Now we’re ready to copy, but there are some caveats. It is extremely important NOT to overwrite .inodes and .bitmap. So the copy command will only copy files that don’t yet exists. But .boot and .altboot also already exist, even though they are empty. So manually copy .boot and .altboot, and remember that QNX treats them as special files:
    cp /.boot /hdnew/.boot
    cp /.altboot /hdnew/.altboot

If you try “cp /.boot /hdnew” it will NOT work. You actually have to specify that you are overwriting .boot by explicitly typing out the whole path. This is a QNX OS-level thing.

  1. Copy everything else:
    cp -vpRNX / /hdnew

The only flag you can think about skipping is the “v”, which shows you the files as they go. The rest of the flags:
p - (lower case) duplicate ownership, permissions, and dates
R - (upper case) recurse, and create directories
N - (upper case) do not recurse across device boundaries, e.g. don’t copy the /dev or /fs/cd0 directories
X - (upper case) copy only files that don’t exists, thus preserving .bitmap and .inodes
I assure you that you really do need those flags, and that the capitalization is not an accident.

I usually like to time this operation:
time cp -vpRNX / /hdnew

Should be easy.

-James Ingraham
Sage Automation, Inc.

If you are copying root to root, the .bitmap and .inodes files will not be copied. If you copy root to some directory, you might end up with these bogus files, but they are benign.