Problem with Cloning a QNX6 partition to another HD

Hi everyone,

I tried to clone a QNX6 partition to another HD,
the source HD is 1 GB with 450 MB used
the destination HD is 520 MB.

Therefore, I couldn’t simply make/copy/paste an image.

So, I tried like in the good old QNX4 days, to clone the partition by hand.

I look up on QDN and could only find QNX4 information,
there was no article on cloning a QNX6 partition.

Basically,

I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition

I copy-pasted boot files

and tar c /boot/* | tar xv /dest/boot/
for all directories: /etc /usr /bin /home
put all the directory permissions.

I rebooted, the OS asked me if I want hda/ or hdb/
both worked perfectly.

I disconnected the source HD and put destination HD as master alone.

I rebooted nothing works !?

What’s wrong ?

I probably forgot something but I don’t know what exactly.

Does anybody can help me out, please!

Have a nice day!

Sincerely yours,

Fred.

“Fred” <fprog@nowhere.users.sourceforge.net> wrote in message
news:a1fk0p$lfj$1@inn.qnx.com

Hi everyone,

I tried to clone a QNX6 partition to another HD,
the source HD is 1 GB with 450 MB used
the destination HD is 520 MB.

Therefore, I couldn’t simply make/copy/paste an image.

So, I tried like in the good old QNX4 days, to clone the partition by
hand.

I look up on QDN and could only find QNX4 information,
there was no article on cloning a QNX6 partition.

Basically,

I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition

I copy-pasted boot files

and tar c /boot/* | tar xv /dest/boot/
for all directories: /etc /usr /bin /home
put all the directory permissions.

I rebooted, the OS asked me if I want hda/ or hdb/
both worked perfectly.

I disconnected the source HD and put destination HD as master alone.

I rebooted nothing works !?

What’s wrong ?

I probably forgot something but I don’t know what exactly.

What exaclty is happening when it’s not working.
I would guess the partition isn’t made bootable or has no
loader

Does anybody can help me out, please!

Have a nice day!

Sincerely yours,

Fred.
\

Hi everyone,

I tried to clone a QNX6 partition to another HD,
the source HD is 1 GB with 450 MB used
the destination HD is 520 MB.

Therefore, I couldn’t simply make/copy/paste an image.

So, I tried like in the good old QNX4 days, to clone the partition by
hand.

I look up on QDN and could only find QNX4 information,
there was no article on cloning a QNX6 partition.

Basically,

I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition

I copy-pasted boot files

and tar c /boot/* | tar xv /dest/boot/
for all directories: /etc /usr /bin /home
put all the directory permissions.

I rebooted, the OS asked me if I want hda/ or hdb/
both worked perfectly.

I disconnected the source HD and put destination HD as master alone.

I rebooted nothing works !?

What’s wrong ?

I probably forgot something but I don’t know what exactly.


What exaclty is happening when it’s not working.
I would guess the partition isn’t made bootable or has no loader

No loader, bootable I dunno ?

As far as I remember I put the switch for bootable…

something like… dinit -b -h -R /dev/hd1t78

Does anybody can help me out, please!

Have a nice day!

Sincerely yours,

Fred.

I copy-pasted the man page for reference purposes…

fdisk - create QNX disk partition (QNX)

fdisk [-pzf] [-B loader] drive cmd [args]
Options:
-z Zero the partition table (interactive mode only)
-p Pause before starting
-B loader Use filename ‘loader’ as the primary loader for the device.
-8 Use 8G loader
-f Force boot loader to be written on demand, even if it is
impossible to save the old loader which had been on the disk.
Where:
drive is the name of the disk (e.g. /dev/fd1, /dev/hd0)
cmd is a mandatory command. Recognised commands are:
add [-f slot] part’n size Create a partition.
boot [part’n | slot] Make partition bootable.
loader Copy boot loader to disk.
show Display partition table.
query [FREE|TOTAL|part’n] Size in cylinders.
info Show mount info for raw
drive.

slot (partition slot) must be in the range 1 - 4. This is used to
reference a partition by its ‘slot’ in the partition table.
part’n (partition type) may be ‘t’ followed by a numerical partition
type, or an (all caps or all lower case) OS name. e.g.
t77 - QNX partition (t7, t8 or t9 for QNX2.xxx)
t1 - DOS partition (DOS also uses t4 & t6)
t5 - Extended partition (both QNX and DOS)
Recognised OS names are QNX, DOS and OS2.
size (partition size) is the size in cylinders (720) or megabytes (98m)
of the partition to be added. Size may also be specified as a
fraction of the disk size: ALL, HALF, THIRD, QUARTER, or TENTH.

Note: The Neutrino version of fdisk does not current support an
interactive mode.

======================================================================
dinit - disk initialization (QNX)

dinit [-bhpqr] [-B filename] [-l | -L label] [-m message] drive
Options:
-b Do not initialize the filesystem. Write the OS Loader (ONLY)
to disk (can be combined with -B, -m or -O).
-B filename Use 512 byte OS loader from this file instead of the standard
QNX OS loader. To write only the loader (and not wipe the
filesystem clean) you must also specify the -b option.
-d drive_num The BIOS drive number to put in disk header (default: 1)
This is required for booting from secondary hard drives.
-f bootfile Preload ‘.boot’ on the disk with the contents of the
specified boot file.
-h Disk is Hard (fixed).
-m message Message for ‘Alternate OS’ booting (’.’ terminated) (see -b).
-O Use old qnx boot loader. (see -b)
-8 Use int 13 extended loader for disks bigger than 8.4Gig
(see -b)
-p Pause before starting.
-q Quiet (do not report or question).
-r Write root block to disk for REBUILD (must run CHKFSYS after
this).
-R Create a /.diskroot file in the root directory.
-S size When used on a file grow it to this size. You may end the size
with k (kilo), m (mega) or g (giga).
-l label Volume label (not required).
-L label Write volume label (ONLY) to disk.
Where:
drive is the name of the disk (as: /dev/fd1, /dev/hd0t77, etc)
Note:
OS loader is in this case referring to the loader which actually
loads the OS. In the case of a partitioned hard drive, this is
the secondary loader residing on the first block of the partition.

On an unpartitioned hard drive or a floppy, this will be the primary
bootstrap loader.

To write the QNX bootstrap loader onto the first block of a partitioned
hard drive, use the fdisk utility.

======================================================================

Currently, the booting process gives the following:

Notice: TEXT means the TEXT is displayed in bold.
{ COMMENT } means COMMENT is a simply a comment not an actual
output…

Normal boot: (HD0 master only)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
Unable to access “/dev/pci” (2)

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
[8197] fs-pkg built: Sep 7 2000 16:00:23
FS-PKG: Open configuration [/etc/system/package/packages]
FS-PKG: Ready to handle requests
Enumeration error: Can’t locate PNP bios (no error)
Installing /dev/par port 378
file /.swapfile added as swap device
File /.swapfile successfully added as a swap device
Starting extra run commands
Starting NFS modules…(this may take a while)
Mounting home directory
Initializing random device
[…]
login:
password:


Failure boot: (HD1 master only)

[ Display BIOS Info inside a square box ]

{ Nothing is display, computer hangs }
{ QNX Loader message never show up ?!? }


Dual HD boot: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
Unable to access “/dev/pci” (2)

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
Unable to mount a qnx file system as /fs/hd1-qnx4-qnxbase.qfs
on /fs/hd1-qnx4/boot/fs/qnxbase.fs (corrupted file system detected)

You have more than one .diskroot file which wanbts to mount as /
1 /dev/hd0t79
2 /dev/hd1t78

Which one do you wish to mount ? 1
{ 1 or 2 doesn’t matter both give the same results }

[8197] fs-pkg built: Sep 7 2000 16:00:23
FS-PKG: Open configuration [/etc/system/package/packages]
FS-PKG: Ready to handle requests
Enumeration error: Can’t locate PNP bios (no error)
Installing /dev/par port 378
file /.swapfile added as swap device
File /.swapfile successfully added as a swap device
Starting extra run commands
Starting NFS modules…(this may take a while)
Mounting home directory
Initializing random device
[…]
login:
password:


Dual HD boot partition 2: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 2
Error loading Operating System



The file system is corrupted ?!
but works with a nice QNX Loader how to fix this ?

The file is said to be “corrupted”, I tried several time fdisk/dinit
it always gives the same error. Is the disk broken ?

What is more strange then ever is that I had no format problem with DOS
and the file system works fine with “another QNX Loader” from the hd0
drive…

Weird. Any suggestions !?

Thanks for your help!

Sincerely,

Fred.

Hi Fred,
Fred <fprog@nowhere.users.sourceforge.net> wrote in article <a1j629$86m$1@inn.qnx.com>…
<…>

I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition




I would guess the partition isn’t made bootable or has no loader

No loader, bootable I dunno ?

You need couple of loaders. The first one is in Master Boot Record (first 512 bytes of hdd), it’s
created by fdisk. The second one is in boot sector of partition (first 512 bytes of partition),
it’s created by dinit.

As far as I remember I put the switch for bootable…

something like… dinit -b -h -R /dev/hd1t78

Have you done something like… fdisk -8?

<…>

Normal boot: (HD0 master only)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1

It’s output of first loader (it’s sitting in mbr)

Press ESC for alternate OS…

It’s output of second loader (it’s sitting in boot sector of QNX partition)

<…>

Failure boot: (HD1 master only)

[ Display BIOS Info inside a square box ]

{ Nothing is display, computer hangs }
{ QNX Loader message never show up ?!? }

As Mario said, you have no QNX Loader :wink: I have no other idea at the moment.

Dual HD boot: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
b>Unable to access “/dev/pci” (2) </b

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
Unable to mount a qnx file system as /fs/hd1-qnx4-qnxbase.qfs
on /fs/hd1-qnx4/boot/fs/qnxbase.fs (corrupted file system detected)

You have more than one .diskroot file which wanbts to mount as /
1 /dev/hd0t79
2 /dev/hd1t78

Which one do you wish to mount ? 1
{ 1 or 2 doesn’t matter both give the same results }

So, you have both partitions quite good :wink: but perhaps there is no loader on hd1.

[8197] fs-pkg built: Sep 7 2000 16:00:23
FS-PKG: Open configuration [/etc/system/package/packages]
FS-PKG: Ready to handle requests
Enumeration error: Can’t locate PNP bios (no error)
Installing /dev/par port 378
file /.swapfile added as swap device
File /.swapfile successfully added as a swap device
Starting extra run commands
Starting NFS modules…(this may take a while)
Mounting home directory
Initializing random device
[…]
login:
password:


Dual HD boot partition 2: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 2
Error loading Operating System

Have you any OS installed in partition 2 on HD0 ?

The file system is corrupted ?!
but works with a nice QNX Loader how to fix this ?

The file is said to be “corrupted”, I tried several time fdisk/dinit
it always gives the same error. Is the disk broken ?

What is more strange then ever is that I had no format problem with DOS
and the file system works fine with “another QNX Loader” from the hd0
drive…

Weird. Any suggestions !?

Look at the mbr of hd1 (use fdisk or dd command to copy first block to a file). If you have
partition table, but have no startup code - just add loader by fdisk. If you didn’t creat partition
table, but only partition (like you did it on floppy) - you have to remake all disk, I think.

Thanks for your help!

Sincerely,

Fred.

Best regards,
Eduard.


I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition

I would guess the partition isn’t made bootable or has no loader

No loader, bootable I dunno ?

You need couple of loaders. The first one is in Master Boot Record (first
512 bytes of hdd), it’s
created by fdisk. The second one is in boot sector of partition (first 512
bytes of partition),
it’s created by dinit.


As far as I remember I put the switch for bootable…

something like… dinit -b -h -R /dev/hd1t78

Have you done something like… fdisk -8?

fdisk -8 is for 8 GB hard drive isn’t it ?

This PhoenixPICO BIOS arcom board don’t accept HD > 2 GB.

Normal boot: (HD0 master only)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1

It’s output of first loader (it’s sitting in mbr)

Press ESC for alternate OS…

It’s output of second loader (it’s sitting in boot sector of QNX partition)

Failure boot: (HD1 master only)

[ Display BIOS Info inside a square box ]

{ Nothing is display, computer hangs }
{ QNX Loader message never show up ?!? }

As Mario said, you have no QNX Loader > :wink: > I have no other idea at the
moment.



Dual HD boot: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
b>Unable to access “/dev/pci” (2) </b

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
Unable to mount a qnx file system as /fs/hd1-qnx4-qnxbase.qfs
on /fs/hd1-qnx4/boot/fs/qnxbase.fs (corrupted file system detected)

You have more than one .diskroot file which wanbts to mount as /
1 /dev/hd0t79
2 /dev/hd1t78

Which one do you wish to mount ? 1
{ 1 or 2 doesn’t matter both give the same results }

So, you have both partitions quite good > :wink: > but perhaps there is no loader
on hd1.

If both partition are good why it tells me it’s corrupted ?!

[8197] fs-pkg built: Sep 7 2000 16:00:23
FS-PKG: Open configuration [/etc/system/package/packages]
FS-PKG: Ready to handle requests
Enumeration error: Can’t locate PNP bios (no error)
Installing /dev/par port 378
file /.swapfile added as swap device
File /.swapfile successfully added as a swap device
Starting extra run commands
Starting NFS modules…(this may take a while)
Mounting home directory
Initializing random device
[…]
login:
password:


Dual HD boot partition 2: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 2
Error loading Operating System


Have you any OS installed in partition 2 on HD0 ?

No, it was just for the sake of experiment. =)


The file system is corrupted ?!
but works with a nice QNX Loader how to fix this ?

The file is said to be “corrupted”, I tried several time fdisk/dinit
it always gives the same error. Is the disk broken ?

What is more strange then ever is that I had no format problem with DOS
and the file system works fine with “another QNX Loader” from the hd0
drive…

Weird. Any suggestions !?

Look at the mbr of hd1 (use fdisk or dd command to copy first block to a
file). If you have
partition table, but have no startup code - just add loader by fdisk. If
you didn’t creat partition
table, but only partition (like you did it on floppy) - you have to remake
all disk, I think.

What’s the default filename for the boot loader and MBR loader ?

fdisk -B loader???

dinit -B filename??? -f bootfile???

I will try fdisk -8 and stuff again…

How do you copy MBR ?
How do you copy Boot QNX loader ?

Thanks for your help!

Sincerely,

Fred.

I did fdisk a created a QNY partition
then run dinit and ask for a bootable partition

I would guess the partition isn’t made bootable or has no loader

No loader, bootable I dunno ?

You need couple of loaders. The first one is in Master Boot Record (first
512 bytes of hdd), it’s
created by fdisk. The second one is in boot sector of partition (first 512
bytes of partition),
it’s created by dinit.


As far as I remember I put the switch for bootable…

something like… dinit -b -h -R /dev/hd1t78

Have you done something like… fdisk -8?

fdisk -8 is for 8 GB hard drive isn’t it ?

This PhoenixPICO BIOS arcom board don’t accept HD > 2 GB.

Normal boot: (HD0 master only)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1

It’s output of first loader (it’s sitting in mbr)

Press ESC for alternate OS…

It’s output of second loader (it’s sitting in boot sector of QNX partition)

Failure boot: (HD1 master only)

[ Display BIOS Info inside a square box ]

{ Nothing is display, computer hangs }
{ QNX Loader message never show up ?!? }

As Mario said, you have no QNX Loader > :wink: > I have no other idea at the
moment.



Dual HD boot: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
b>Unable to access “/dev/pci” (2) </b

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
Unable to mount a qnx file system as /fs/hd1-qnx4-qnxbase.qfs
on /fs/hd1-qnx4/boot/fs/qnxbase.fs (corrupted file system detected)

You have more than one .diskroot file which wanbts to mount as /
1 /dev/hd0t79
2 /dev/hd1t78

Which one do you wish to mount ? 1
{ 1 or 2 doesn’t matter both give the same results }

So, you have both partitions quite good > :wink: > but perhaps there is no loader
on hd1.

If both partition are good why it tells me it’s corrupted ?!

[8197] fs-pkg built: Sep 7 2000 16:00:23
FS-PKG: Open configuration [/etc/system/package/packages]
FS-PKG: Ready to handle requests
Enumeration error: Can’t locate PNP bios (no error)
Installing /dev/par port 378
file /.swapfile added as swap device
File /.swapfile successfully added as a swap device
Starting extra run commands
Starting NFS modules…(this may take a while)
Mounting home directory
Initializing random device
[…]
login:
password:


Dual HD boot partition 2: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 2
Error loading Operating System


Have you any OS installed in partition 2 on HD0 ?

No, it was just for the sake of experiment. =)


The file system is corrupted ?!
but works with a nice QNX Loader how to fix this ?

The file is said to be “corrupted”, I tried several time fdisk/dinit
it always gives the same error. Is the disk broken ?

What is more strange then ever is that I had no format problem with DOS
and the file system works fine with “another QNX Loader” from the hd0
drive…

Weird. Any suggestions !?

Look at the mbr of hd1 (use fdisk or dd command to copy first block to a
file). If you have
partition table, but have no startup code - just add loader by fdisk. If
you didn’t creat partition
table, but only partition (like you did it on floppy) - you have to remake
all disk, I think.

What’s the default filename for the boot loader and MBR loader ?

fdisk -B loader???

dinit -B filename??? -f bootfile???

I will try fdisk -8 and stuff again…

How do you copy MBR ?
How do you copy Boot QNX loader ?

Thanks for your help!

Sincerely,

Fred.

Hi Fred,

Fred <fprog@nowhere.users.sourceforge.net> wrote in article <a1kr0o$fvl$2@inn.qnx.com>…
<…>

fdisk -8 is for 8 GB hard drive isn’t it ?

This PhoenixPICO BIOS arcom board don’t accept HD > 2 GB.

After POST master boot executable code (MBR) is loaded to memory by BIOS and runs. This small
program (446 bytes) examines the partition tables and learns which partition is active. It then
seeks to that partition of the disk, loads the first sector of that partition (boot sector) to
memory and passes control to that code. To do these actions boot loader uses information in
partitions table (offset 0x1be to 0x1fd in MBR). Partition table consists of 4 entries, one entry
per partition (it limits the hdd to 4 primary partitions per drive). The information (start of
partition and size) about partitions are kept as head/sector/cyl and as absolute sector number. I
guess 8 GB loader uses absolute sector number in order to access to bootsector. It has nothing
common with disk size which you’ve connected (in other words it should work for small disk too).
Yes, old BIOSes do not support extension of int13H for disk access by absolute sector number. So,
my suggestion to use “fdisk -8” may be not quite good for you. Anyhow, “fdisk -f” should write
built-in loader. I guess you somehow did not write partition loader when was creating QNX
partition… (or wrote bad one).

Failure boot: (HD1 master only)

[ Display BIOS Info inside a square box ]

{ Nothing is display, computer hangs }
{ QNX Loader message never show up ?!? }

As Mario said, you have no QNX Loader > :wink: > I have no other idea at the
moment.



Dual HD boot: (HD0 master, HD1 slave)

[ Display BIOS Info inside a square box ]

QNX Loader
Boot Partition 1
Press ESC for alternate OS…

Neutrino technology inside!!!
Processor #1: 486 (AMD 486 F4M10S4) speed=33
Can’t locate PNP bios (no error)
pci-bios: No BIOS present - status ffffffff - errno 14!
pci_server: No dll loaded!
b>Unable to access “/dev/pci” (2) </b

Press the space bar to input boot options…
Detected EIDE. Scanning for devices
This can take up to 30 seconds…
Unable to mount a qnx file system as /fs/hd1-qnx4-qnxbase.qfs
on /fs/hd1-qnx4/boot/fs/qnxbase.fs (corrupted file system detected)

You have more than one .diskroot file which wanbts to mount as /
1 /dev/hd0t79
2 /dev/hd1t78

Which one do you wish to mount ? 1
{ 1 or 2 doesn’t matter both give the same results }

So, you have both partitions quite good > :wink: > but perhaps there is no loader
on hd1.

If both partition are good why it tells me it’s corrupted ?!

I guess it’s just because you have 2 .diskroot files. I guess it’s the next bug in diskboot, since
it attempts to mount qnxbase package before to ask where is really root filesystem.

What’s the default filename for the boot loader and MBR loader ?

Default MBR loader is built in fdisk. It should be good for you. DOSes fdisk also has MBR loader
built-in, type “fdisk /mbr” under DOS to write standard loader to MBR.

fdisk -B loader???

They are somewhere under /boot, sorry I’m on windows and don’t remember at moment…

dinit -B filename??? -f bootfile???

I will try fdisk -8 and stuff again…

BTW, if you have MBR on disk, “fdisk /mbr” in dos helps you. Maybe somebody can advise the similar
option for QNX’s fdisk.

How do you copy MBR ?

dd if=/dev/hd1 of=/mymbr.sec bs=512 count=1

It will copy MBR of HDD 1 into the file /mymbr.sec

How do you copy Boot QNX loader ?

dd if=/dev/hd1t79 of=/home/fred/hd1qnx.bs bs=512 count=1

It will copy bootsector of t79 (QNX partition) on drive HDD 1 into the file /home/fred/hd1qnx.bs

Or are you interesting of another way around? Use fdisk and dinit for the other direction :wink:

Good luck!
Eduard.