Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - fdisk shows incorrect geometry when booting QNX4.25 off USB stick: (9 Items)
   
fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
I am trying to create a QNX4.25  install off a bootable 4GB USB for an x86 PC. I am using the 2009 release. I have the 
latest (2010) USB stack. Have also tried with earlier stack.

I boot to a shell and start the IDE drive through "disktrap start"

Running "fdisk" at this point shows totally incorrect HD geometry. I proceed to create a partion, copy the loader and 
make the partion bootable anyway. Then dinit the partiton and copy on a fairly standard boot image. When attempting to 
then boot off the disk the primary boot loader is not seen and be HD becomes unbootable

Are there any know issues using fdisk in this way ??

I can successfully create a QNX4.25 install on the same system off floppy. After booting off floppy "fdisk" shows 
correct geometry. 
Can also successfully create a QNX6.3 install off USB
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
Hi Mark,

First of all please make sure that you use the latest fdisk. What driver 
is starting after disktrap? What type of disk do you use?

Here are several tips for this case:

1. Don't use disktrap, but start driver manually. Use the latest 
Fsys.atapi for EIDE disks.
2. Zero the partition table and then restart the disk driver. Use fdisk -z 
for this.
3. Set correct geometry via the disk driver options.

Don't use all these tips at once, but start from the first.

-- 
Respectfully,
Oleg

> I am trying to create a QNX4.25  install off a bootable 4GB USB for an
> x86 PC. I am using the 2009 release. I have the latest (2010) USB
> stack. Have also tried with earlier stack.
> 
> I boot to a shell and start the IDE drive through "disktrap start"
> 
> Running "fdisk" at this point shows totally incorrect HD geometry. I
> proceed to create a partion, copy the loader and make the partion
> bootable anyway. Then dinit the partiton and copy on a fairly standard
> boot image. When attempting to then boot off the disk the primary boot
> loader is not seen and be HD becomes unbootable
> 
> Are there any know issues using fdisk in this way ??
> 
> I can successfully create a QNX4.25 install on the same system off
> floppy. After booting off floppy "fdisk" shows correct geometry. Can
> also successfully create a QNX6.3 install off USB
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post66043
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
Thanks for that Oleg, was very helpful.

Updating to the latest "Fsys.atapi" and manual start solved startup problems on a number of different systems (we have a
 mixture of solid state and HD IDE drives).

Through the BIOS I forced LBA (where I could)  for the HD, rather than using an "Auto" setting

Deleted the partitons "fdisk <drv> delete -a"

Found that if I used fdisk to add QNX boot partiton at 100% of the drive, loading the boot image failed. Partioned to 99
% and load was successful (not sure why)

Fdisk shows more reasonable drive geometry, but more importantly now seems to write the partioning info and primary boot
 loader using correct addressing on the HD.
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
Hi Mark,

Try to start the Fsys.atapi with "fsys -i" options and after this use 
fdisk.

-- 
Respectfully,
Oleg

> Thanks for that Oleg, was very helpful.
> 
> Updating to the latest "Fsys.atapi" and manual start solved startup
> problems on a number of different systems (we have a mixture of solid
> state and HD IDE drives).
> 
> Through the BIOS I forced LBA (where I could)  for the HD, rather than
> using an "Auto" setting
> 
> Deleted the partitons "fdisk <drv> delete -a"
> 
> Found that if I used fdisk to add QNX boot partiton at 100% of the
> drive, loading the boot image failed. Partioned to 99% and load was
> successful (not sure why)
> 
> Fdisk shows more reasonable drive geometry, but more importantly now
> seems to write the partioning info and primary boot loader using
> correct addressing on the HD.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post66269
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
I've bumped into the same problem and am retrying with today's Fsys.atapi release.

I have an 80GB disk with a zeroed-out MBR, and I've constructed a bootable floppy and bootable USB stick that are nearly
 identical. The only difference is that the floppy's boot image includes Fsys.floppy, and the USB stick has io-usb and 
Fsys.umass instead.

When I boot from floppy, fdisk shows correct disk geometry, i.e. 255 heads 63 sectors.

When I boot from USB, fdisk shows incorrect geometry, i.e. 64 heads 32 sectors.

Specifying "fsys -i" to Fsys.atapi seems to make no difference.

Manually specifying disk geometry to Fsys.atapi is not a viable option because I don't know the disk size in advance. If
 it's less than about 4GB, then the BIOS will likely *not* have chosen 255 heads 63 sectors.

Any suggestions?

I've also noticed something weird...

# fdisk /dev/hd0 info
(in summary: 76319 cylinders, 64 heads, 32 sectors)
# fdisk /dev/hd0 add t77 1024
# fdisk /dev/hd0 info
0: (77) beg(h=1,s=1,c=0) end(h=63,s=224,c=255) off=32, size=2097120

What's with the wacky end geometry? Is this just a display bug?
Sector 224 should be impossible; that field is only 6 bits long.
(Maybe that's it; "0xe0 0xff" should be interpreted as s=32 c=1023, not s=224 c=255 ... right?)
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
I've been working with a rather old version of dinit (dated 1997) but the newer CD images contain a version dated 2007. 
This appears to support a "-8" parameter, to install an extended int 13 loader.

The "old" int 13 interface requires CHS addresses, so a geometry mismatch will break it.

The "extended" int 13 interface operates on LBA addresses, so geometry shouldn't matter. Of course, this isn't supported
 on very old PCs. But if it works on any system that can boot from USB, then this might very well solve my problem!

However, specifying the "-8" parameter seems to cause dinit to exit without doing anything. That is, it doesn't display 
a message, but it also doesn't initialize the filesystem.

# dinit -8 -q -h /dev/hd0t77

What am I doing wrong?
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
It seems that the "-8" option isn't needed. Simply using the new version of dinit seems to solve the problem. Maybe it's
 automatically installing an extended int13 loader. My test system now boots properly even though the partition table 
and BIOS disagree on disk geometry.

Also, there's still the "fdisk info" CHS output oddity. Again, I believe that this is strictly cosmetic, but it would 
still be nice to see this fixed. I'm using the 2009 July 14 release.
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
Hi Graham,

What do you mean by "CHS output oddity"?

-- 
Respectfully,
Oleg

> It seems that the "-8" option isn't needed. Simply using the new
> version of dinit seems to solve the problem. Maybe it's automatically
> installing an extended int13 loader. My test system now boots properly
> even though the partition table and BIOS disagree on disk geometry.
> 
> Also, there's still the "fdisk info" CHS output oddity. Again, I
> believe that this is strictly cosmetic, but it would still be nice to
> see this fixed. I'm using the 2009 July 14 release.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post85740
Re: fdisk shows incorrect geometry when booting QNX4.25 off USB stick  
Hi Graham,

Attaching updated fdisk. Please, test it.

-- 
Respectfully,
Oleg

> It seems that the "-8" option isn't needed. Simply using the new
> version of dinit seems to solve the problem. Maybe it's automatically
> installing an extended int13 loader. My test system now boots properly
> even though the partition table and BIOS disagree on disk geometry.
> 
> Also, there's still the "fdisk info" CHS output oddity. Again, I
> believe that this is strictly cosmetic, but it would still be nice to
> see this fixed. I'm using the 2009 July 14 release.
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post85740
Attachment: Text fdisk.20110519.tar.gz 46.68 KB