Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Corrupted File System detected when using mkqnx6fsimg: (5 Items)
   
Corrupted File System detected when using mkqnx6fsimg  
Hi Hasnat,

I'm having trouble getting this utility to create a qnx file system that I can mount.  I understand that the build 
script for the utility must specify the exact size of the partition it is going to be copied to, but as much as I've 
tried I get a corrupted file system error every time I try to nount it.

The steps I take are:

1.  Partition a USB drive use fdisk under qnx
2.  Use the attached build script and run mkqnx6fsimg (in linux).
3.  DD the resulting file to my USB stick.
4.  In Qnx start devb-umass and mount -t qnx6 /dev/hd1t179 /fs/qnx6
5.  ls /fs/qnx6

Result: Corupted file system detected.

The USB Stick partition specifics are:
Cyls: 975
Heads: 255
Sec/Trac: 63

Partition starts on Cyl 1 and ends on Cyl 200

Thanks
Kevin
Attachment: Text diskimg.bld 1.75 KB
Re: Corrupted File System detected when using mkqnx6fsimg  
Well, shoot, this is addressed to all, not just the talented Northern CA FAE.....

> Hi Hasnat,
> 
> I'm having trouble getting this utility to create a qnx file system that I can
>  mount.  I understand that the build script for the utility must specify the 
> exact size of the partition it is going to be copied to, but as much as I've 
> tried I get a corrupted file system error every time I try to nount it.
> 
> The steps I take are:
> 
> 1.  Partition a USB drive use fdisk under qnx
> 2.  Use the attached build script and run mkqnx6fsimg (in linux).
> 3.  DD the resulting file to my USB stick.
> 4.  In Qnx start devb-umass and mount -t qnx6 /dev/hd1t179 /fs/qnx6
> 5.  ls /fs/qnx6
> 
> Result: Corupted file system detected.
> 
> The USB Stick partition specifics are:
> Cyls: 975
> Heads: 255
> Sec/Trac: 63
> 
> Partition starts on Cyl 1 and ends on Cyl 200
> 
> Thanks
> Kevin


Re: Corrupted File System detected when using mkqnx6fsimg  
I have a solution:

1.  The file size wasn't matching the C*H*S*sector_size, even though I was using the right parameters in the blksize and
 num_blocks attributes.  An additional 15872 bytes were being added to the resulting image.  I modified the attributes 
so that the block size was reduced that amount and ti worked (reduced it by 32 blocks of blksize=512).

2.  Must not use devb-umass blk qnx6 sync=optional but rather use mount -t qnx6 -o sync=optional <device> <mount>

I now have an image created in Linux mounting to a qnx6.5 vm!  


Re: Corrupted File System detected when using mkqnx6fsimg  
Mea culpa, I think.

You wrote:
>1.  The file size wasn't matching the C*H*S*sector_size, even though I 
>was using the right parameters in the blksize and num_blocks attributes.
>An additional 15872 bytes were being added to the resulting image.  I 
>modified the attributes so that the block size was reduced that amount 
>and ti worked (reduced it by 32 blocks of blksize=512).

When I originally implemented mkqnx6fsimg, I didn't realize that an explicit "num_blocks" attribute would, at best, be 
mostly useless and usually and up badly confusing or even irritating the user - which is definitely nothing a good tool 
should do. The problem with num_blocks is that, as you have indirectly noticed, the net size of a QNX6 file system is 
greater than just the combined sum of its (data) blocks. It also contains some metadata (a "boot" and two "super" 
blocks) that will alone take up ~16k . Upon realizing how intricate it actually was to create an image of defined size 
using this attribute, I first tried to account for this by better documenting the relation between block- and sector 
count, but by now I've come to believe it'll probably be best to completely remove the "num_blocks" attribute to avoid 
any further confusion.

Instead, one should _always_ use the "num_sectors" attribute to define the file-system size. The relation between sector
 count and actually usable data space in the file system isn't much worse than for the block count, but num_sectors at 
allows you to tell exactly how many sectors the resulting image will take up. The tool will automatically account and 
adjust for "odd" sector counts, so you don't have to worry about sector counts that aren't exact multiples of the block 
size. Instead, just look at your target media's/partition's sector count and put that into the build file.

Best regards, and my sincere apologies for wasting your time with this useless feature:
Thomas
Re: Corrupted File System detected when using mkqnx6fsimg  
Interesting, thanks for the feedback on this.  

I just changed the way I do this to sectors and it worked without modification.  I know it was one of the things I tried
, not sure why it didn't work.

So, I guess I concur, we don't need the num_blocks functionality :)

Thanks Thomas,
Kevin

On Oct 1, 2014, at 12:39 AM, Thomas Haupt <community-noreply@qnx.com> wrote:

> Mea culpa, I think.
> 
> You wrote:
>> 1.  The file size wasn't matching the C*H*S*sector_size, even though I 
>> was using the right parameters in the blksize and num_blocks attributes.
>> An additional 15872 bytes were being added to the resulting image.  I 
>> modified the attributes so that the block size was reduced that amount 
>> and ti worked (reduced it by 32 blocks of blksize=512).
> 
> When I originally implemented mkqnx6fsimg, I didn't realize that an explicit "num_blocks" attribute would, at best, be
 mostly useless and usually and up badly confusing or even irritating the user - which is definitely nothing a good tool
 should do. The problem with num_blocks is that, as you have indirectly noticed, the net size of a QNX6 file system is 
greater than just the combined sum of its (data) blocks. It also contains some metadata (a "boot" and two "super" 
blocks) that will alone take up ~16k . Upon realizing how intricate it actually was to create an image of defined size 
using this attribute, I first tried to account for this by better documenting the relation between block- and sector 
count, but by now I've come to believe it'll probably be best to completely remove the "num_blocks" attribute to avoid 
any further confusion.
> 
> Instead, one should _always_ use the "num_sectors" attribute to define the file-system size. The relation between 
sector count and actually usable data space in the file system isn't much worse than for the block count, but 
num_sectors at allows you to tell exactly how many sectors the resulting image will take up. The tool will automatically
 account and adjust for "odd" sector counts, so you don't have to worry about sector counts that aren't exact multiples 
of the block size. Instead, just look at your target media's/partition's sector count and put that into the build file.
> 
> Best regards, and my sincere apologies for wasting your time with this useless feature:
> Thomas
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post111939
> To cancel your subscription to this discussion, please e-mail general-toolchain-unsubscribe@community.qnx.com