Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - Need help initializing filesystem.: (7 Items)
   
Need help initializing filesystem.  
I have looked over code for flashctl, etfsctl, and fs-etfs-nand and I do not know where to go from here.  I am new to 
this flash filesystem stuff.  I know in Linux a normal storage device shows up in /dev as dev-n  where dev is device 
specific and n is partition.  When I run fs-etfs-nand I get /fs/etfs and /dev/etfsn (n=1,2).  I know I am seeing the 
device as etfsctl returns;

# ./etfsctl -i
Device NAND2caa
   Blocks Clusters/Block Clustersize Totalsize
     2048             64        2048 268435456
Pools
   Clean Spare Filthy Inactive Xpool Cache
       0     0   1995   127680  2048    64
Counts
    Erase    Avg     Read    Cache    Write     Mine     Copy   Defrag  BadBlks
        0      0        0        0        0        0        0        0       53
Errors
   Ecc  Chksum   Device
     0       0        0

Which is correct.

To summarize the hardware, I have LPC3180 with MT29F2G08AAD NAND Flash.  The bootable image resides in flash from block 
0 through block 100.  I want to use all the blocks after 100 for a filesystem.

Can anyone give me directions as to where I need to look?  etfsctl seems to recognize the hardware, but does not have 
the ability to create custom partitions.  flashctl has the ability to create custom partitions, but does not recognize 
the hardware (is not getting correct information back from device).
RE: Need help initializing filesystem.  
Durwin,

Since you are using NAND flash, fs-etfs-nand is the right driver for you
to use.  Etfsctl is the proper command-line utility:  flashctl is the
command-line util for the devf-* series of drivers, which use a
different filesystem, and target NOR flash.

The ETFS filesystems only support two partitions: a raw partition, and a
formatted partition.  The raw partition is always called /dev/etfs1, and
the formatted partition is called /dev/etfs2.  By default the raw
partition is zero sized, and the formatted partition fills the entire
NAND part.

Since you have /fs/etfs, that means that /dev/etfs2 is properly
formatted, and mounted.  /fs/etfs is the filesystem mountpoint.

To set the size of the raw partition (/dev/etfs1), use the "-r" option
to fs-etfs-nand.  This option takes as an argument the number of
Kilobytes to reserve.  This number needs to be a multiple of the block
size of the NAND hardware (128kB in your case).  /dev/etfs1 will then be
accessible as a physically contiguous portion of NAND flash, to which a
boot image, or other files, can be written.  The raw partition does not
silently skip bad blocks, and does not perform wear-levelling (as it has
no idea what the format of the contained data is).

David 

> -----Original Message-----
> From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> Sent: June 11, 2009 12:04 PM
> To: general-filesystems
> Subject: Need help initializing filesystem.
> 
> I have looked over code for flashctl, etfsctl, and 
> fs-etfs-nand and I do not know where to go from here.  I am 
> new to this flash filesystem stuff.  I know in Linux a normal 
> storage device shows up in /dev as dev-n  where dev is device 
> specific and n is partition.  When I run fs-etfs-nand I get 
> /fs/etfs and /dev/etfsn (n=1,2).  I know I am seeing the 
> device as etfsctl returns;
> 
> # ./etfsctl -i
> Device NAND2caa
>    Blocks Clusters/Block Clustersize Totalsize
>      2048             64        2048 268435456
> Pools
>    Clean Spare Filthy Inactive Xpool Cache
>        0     0   1995   127680  2048    64
> Counts
>     Erase    Avg     Read    Cache    Write     Mine     Copy 
>   Defrag  BadBlks
>         0      0        0        0        0        0        0 
>        0       53
> Errors
>    Ecc  Chksum   Device
>      0       0        0
> 
> Which is correct.
> 
> To summarize the hardware, I have LPC3180 with MT29F2G08AAD 
> NAND Flash.  The bootable image resides in flash from block 0 
> through block 100.  I want to use all the blocks after 100 
> for a filesystem.
> 
> Can anyone give me directions as to where I need to look?  
> etfsctl seems to recognize the hardware, but does not have 
> the ability to create custom partitions.  flashctl has the 
> ability to create custom partitions, but does not recognize 
> the hardware (is not getting correct information back from device).
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post31502
> 
> 
Re: RE: Need help initializing filesystem.  
Thank you for your reply.

> Durwin,
> 
> Since you are using NAND flash, fs-etfs-nand is the right driver for you
> to use.  Etfsctl is the proper command-line utility:  flashctl is the
> command-line util for the devf-* series of drivers, which use a
> different filesystem, and target NOR flash.
> 
> The ETFS filesystems only support two partitions: a raw partition, and a
> formatted partition.  The raw partition is always called /dev/etfs1, and
> the formatted partition is called /dev/etfs2.  By default the raw
> partition is zero sized, and the formatted partition fills the entire
> NAND part.
> 
> Since you have /fs/etfs, that means that /dev/etfs2 is properly
> formatted, and mounted.  /fs/etfs is the filesystem mountpoint.

I have tried to 'cd' into /fs/etfs and received message 'device busy'.  I get same message trying to perform other tasks
 on it.

Normally I would try to mount /dev/etfs2 as the partition I want to a mount point.  But even doing this fails giving;

mount: Can't mount /mnt/usb (type qnx4) 
mount: Possible reason: No such device or address 

Do I need to format it?

> 
> To set the size of the raw partition (/dev/etfs1), use the "-r" option
> to fs-etfs-nand.  This option takes as an argument the number of
> Kilobytes to reserve.  This number needs to be a multiple of the block
> size of the NAND hardware (128kB in your case).  /dev/etfs1 will then be
> accessible as a physically contiguous portion of NAND flash, to which a
> boot image, or other files, can be written.  The raw partition does not
> silently skip bad blocks, and does not perform wear-levelling (as it has
> no idea what the format of the contained data is).

Do I specify the size of etfs1 (raw partition) to include the 0-100 blocks I need reserved?

> 
> David 
> 
> > -----Original Message-----
> > From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> > Sent: June 11, 2009 12:04 PM
> > To: general-filesystems
> > Subject: Need help initializing filesystem.
> > 
> > I have looked over code for flashctl, etfsctl, and 
> > fs-etfs-nand and I do not know where to go from here.  I am 
> > new to this flash filesystem stuff.  I know in Linux a normal 
> > storage device shows up in /dev as dev-n  where dev is device 
> > specific and n is partition.  When I run fs-etfs-nand I get 
> > /fs/etfs and /dev/etfsn (n=1,2).  I know I am seeing the 
> > device as etfsctl returns;
> > 
> > # ./etfsctl -i
> > Device NAND2caa
> >    Blocks Clusters/Block Clustersize Totalsize
> >      2048             64        2048 268435456
> > Pools
> >    Clean Spare Filthy Inactive Xpool Cache
> >        0     0   1995   127680  2048    64
> > Counts
> >     Erase    Avg     Read    Cache    Write     Mine     Copy 
> >   Defrag  BadBlks
> >         0      0        0        0        0        0        0 
> >        0       53
> > Errors
> >    Ecc  Chksum   Device
> >      0       0        0
> > 
> > Which is correct.
> > 
> > To summarize the hardware, I have LPC3180 with MT29F2G08AAD 
> > NAND Flash.  The bootable image resides in flash from block 0 
> > through block 100.  I want to use all the blocks after 100 
> > for a filesystem.
> > 
> > Can anyone give me directions as to where I need to look?  
> > etfsctl seems to recognize the hardware, but does not have 
> > the ability to create custom partitions.  flashctl has the 
> > ability to create custom partitions, but does not recognize 
> > the hardware (is not getting correct information back from device).
> > 
> > _______________________________________________
> >...
RE: RE: Need help initializing filesystem.  
 

> -----Original Message-----
> From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> Sent: June 11, 2009 1:29 PM
> To: general-filesystems
> Subject: Re: RE: Need help initializing filesystem.
> 
> Thank you for your reply.
> 
> > Durwin,
> > 
> > Since you are using NAND flash, fs-etfs-nand is the right 
> driver for 
> > you to use.  Etfsctl is the proper command-line utility:  
> flashctl is 
> > the command-line util for the devf-* series of drivers, which use a 
> > different filesystem, and target NOR flash.
> > 
> > The ETFS filesystems only support two partitions: a raw 
> partition, and 
> > a formatted partition.  The raw partition is always called 
> /dev/etfs1, 
> > and the formatted partition is called /dev/etfs2.  By 
> default the raw 
> > partition is zero sized, and the formatted partition fills 
> the entire 
> > NAND part.
> > 
> > Since you have /fs/etfs, that means that /dev/etfs2 is properly 
> > formatted, and mounted.  /fs/etfs is the filesystem mountpoint.
> 
> I have tried to 'cd' into /fs/etfs and received message 
> 'device busy'.  I get same message trying to perform other 
> tasks on it.

That means the filesystem is in the stopped state.  ETFS has the notion
of "stopped" filesystem (similar to pausing).  The filesystem will be in
this state if it's not formatted.  If this driver is pre-6.4.0, then
that makes sense, as ETFS will auto-create the /fs/etfs mountpoint
whether it's formatted or not.

You'll nave to do "etfsctl -d /dev/etfs2 -efc" to erase, format, and
then "continue" the stopped filesystem.  At that point, you'll be able
to access /fs/etfs.


> 
> Normally I would try to mount /dev/etfs2 as the partition I 
> want to a mount point.  But even doing this fails giving;
> 
> mount: Can't mount /mnt/usb (type qnx4)
> mount: Possible reason: No such device or address 
> 
> Do I need to format it?

Yes, just like above.

Also, if you want to mount it you'll have to do:

mount -t etfs /dev/etfs2 <mountpoint>

Otherwise you get that error about it not being an fs-qnx4 filesystem.

> 
> > 
> > To set the size of the raw partition (/dev/etfs1), use the 
> "-r" option 
> > to fs-etfs-nand.  This option takes as an argument the number of 
> > Kilobytes to reserve.  This number needs to be a multiple 
> of the block 
> > size of the NAND hardware (128kB in your case).  /dev/etfs1 
> will then 
> > be accessible as a physically contiguous portion of NAND flash, to 
> > which a boot image, or other files, can be written.  The 
> raw partition 
> > does not silently skip bad blocks, and does not perform 
> wear-levelling 
> > (as it has no idea what the format of the contained data is).
> 
> Do I specify the size of etfs1 (raw partition) to include the 
> 0-100 blocks I need reserved?

Because NAND can have bad blocks, I would specify more than the 100
blocks.

Eg. Blocksize = 128k
128k * 105 blocks = 13440kB

fs-etfs-nand -r 13440 -m /fs/etfs -D<opts>

If you want it auto-erased and formatted, also specify -e.


> 
> > 
> > David
> > 
> > > -----Original Message-----
> > > From: Durwin De La Rue [mailto:community-noreply@qnx.com]
> > > Sent: June 11, 2009 12:04 PM
> > > To: general-filesystems
> > > Subject: Need help initializing filesystem.
> > > 
> > > I have looked over code for flashctl, etfsctl, and 
> fs-etfs-nand and 
> > > I do not know where to go from here.  I am new to this flash 
> > > filesystem stuff.  I know in Linux a normal storage 
> device shows up 
> > > in /dev as dev-n  where dev is device...
View Full Message
Re: RE: RE: Need help initializing filesystem.  
This was sounding so positive.  I run;

fs-etfs-nand -r 12800 -m /fs/etfs

etfsctl -d /dev/etfs2 -efc

This is where I now have trouble.  It says;

Error status on option 'c' : Corrupted file system detected

If I do not use '-c', it returns status=0 and it takes a few seconds to do what it is doing.  But then if I '-c', it 
returns same error.  Unless I am over looking something, I guess I need to dive into the driver code.

>  
> 
> > -----Original Message-----
> > From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> > Sent: June 11, 2009 1:29 PM
> > To: general-filesystems
> > Subject: Re: RE: Need help initializing filesystem.
> > 
> > Thank you for your reply.
> > 
> > > Durwin,
> > > 
> > > Since you are using NAND flash, fs-etfs-nand is the right 
> > driver for 
> > > you to use.  Etfsctl is the proper command-line utility:  
> > flashctl is 
> > > the command-line util for the devf-* series of drivers, which use a 
> > > different filesystem, and target NOR flash.
> > > 
> > > The ETFS filesystems only support two partitions: a raw 
> > partition, and 
> > > a formatted partition.  The raw partition is always called 
> > /dev/etfs1, 
> > > and the formatted partition is called /dev/etfs2.  By 
> > default the raw 
> > > partition is zero sized, and the formatted partition fills 
> > the entire 
> > > NAND part.
> > > 
> > > Since you have /fs/etfs, that means that /dev/etfs2 is properly 
> > > formatted, and mounted.  /fs/etfs is the filesystem mountpoint.
> > 
> > I have tried to 'cd' into /fs/etfs and received message 
> > 'device busy'.  I get same message trying to perform other 
> > tasks on it.
> 
> That means the filesystem is in the stopped state.  ETFS has the notion
> of "stopped" filesystem (similar to pausing).  The filesystem will be in
> this state if it's not formatted.  If this driver is pre-6.4.0, then
> that makes sense, as ETFS will auto-create the /fs/etfs mountpoint
> whether it's formatted or not.
> 
> You'll nave to do "etfsctl -d /dev/etfs2 -efc" to erase, format, and
> then "continue" the stopped filesystem.  At that point, you'll be able
> to access /fs/etfs.
> 
> 
> > 
> > Normally I would try to mount /dev/etfs2 as the partition I 
> > want to a mount point.  But even doing this fails giving;
> > 
> > mount: Can't mount /mnt/usb (type qnx4)
> > mount: Possible reason: No such device or address 
> > 
> > Do I need to format it?
> 
> Yes, just like above.
> 
> Also, if you want to mount it you'll have to do:
> 
> mount -t etfs /dev/etfs2 <mountpoint>
> 
> Otherwise you get that error about it not being an fs-qnx4 filesystem.
> 
> > 
> > > 
> > > To set the size of the raw partition (/dev/etfs1), use the 
> > "-r" option 
> > > to fs-etfs-nand.  This option takes as an argument the number of 
> > > Kilobytes to reserve.  This number needs to be a multiple 
> > of the block 
> > > size of the NAND hardware (128kB in your case).  /dev/etfs1 
> > will then 
> > > be accessible as a physically contiguous portion of NAND flash, to 
> > > which a boot image, or other files, can be written.  The 
> > raw partition 
> > > does not silently skip bad blocks, and does not perform 
> > wear-levelling 
> > > (as it has no idea what the format of the contained data is).
> > 
> > Do I specify the size of etfs1 (raw partition) to include the 
> > 0-100 blocks I need reserved?
> 
> Because NAND can have bad...
View Full Message
RE: RE: RE: Need help initializing filesystem.  
Durwin,

I've made a small error.  The -ef is redudant.  -e means "erase all the
blocks".  -f mean "erase the blocks and format".  So please specify only
-f to etfsctl.

The -c is giving you the error because that's what triggers ETFS to
actually start scanning the filesystem and checking for consistency.
Please re-do the test without the -e on etfsctl, and please add -vvv to
the commandline of fs-etfs-nand.

David 

> -----Original Message-----
> From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> Sent: June 11, 2009 3:21 PM
> To: general-filesystems
> Subject: Re: RE: RE: Need help initializing filesystem.
> 
> This was sounding so positive.  I run;
> 
> fs-etfs-nand -r 12800 -m /fs/etfs
> 
> etfsctl -d /dev/etfs2 -efc
> 
> This is where I now have trouble.  It says;
> 
> Error status on option 'c' : Corrupted file system detected
> 
> If I do not use '-c', it returns status=0 and it takes a few 
> seconds to do what it is doing.  But then if I '-c', it 
> returns same error.  Unless I am over looking something, I 
> guess I need to dive into the driver code.
> 
> >  
> > 
> > > -----Original Message-----
> > > From: Durwin De La Rue [mailto:community-noreply@qnx.com]
> > > Sent: June 11, 2009 1:29 PM
> > > To: general-filesystems
> > > Subject: Re: RE: Need help initializing filesystem.
> > > 
> > > Thank you for your reply.
> > > 
> > > > Durwin,
> > > > 
> > > > Since you are using NAND flash, fs-etfs-nand is the right
> > > driver for
> > > > you to use.  Etfsctl is the proper command-line utility:  
> > > flashctl is
> > > > the command-line util for the devf-* series of drivers, 
> which use 
> > > > a different filesystem, and target NOR flash.
> > > > 
> > > > The ETFS filesystems only support two partitions: a raw
> > > partition, and
> > > > a formatted partition.  The raw partition is always called
> > > /dev/etfs1,
> > > > and the formatted partition is called /dev/etfs2.  By
> > > default the raw
> > > > partition is zero sized, and the formatted partition fills
> > > the entire
> > > > NAND part.
> > > > 
> > > > Since you have /fs/etfs, that means that /dev/etfs2 is properly 
> > > > formatted, and mounted.  /fs/etfs is the filesystem mountpoint.
> > > 
> > > I have tried to 'cd' into /fs/etfs and received message 'device 
> > > busy'.  I get same message trying to perform other tasks on it.
> > 
> > That means the filesystem is in the stopped state.  ETFS has the 
> > notion of "stopped" filesystem (similar to pausing).  The 
> filesystem 
> > will be in this state if it's not formatted.  If this driver is 
> > pre-6.4.0, then that makes sense, as ETFS will auto-create the 
> > /fs/etfs mountpoint whether it's formatted or not.
> > 
> > You'll nave to do "etfsctl -d /dev/etfs2 -efc" to erase, 
> format, and 
> > then "continue" the stopped filesystem.  At that point, 
> you'll be able 
> > to access /fs/etfs.
> > 
> > 
> > > 
> > > Normally I would try to mount /dev/etfs2 as the partition 
> I want to 
> > > a mount point.  But even doing this fails giving;
> > > 
> > > mount: Can't mount /mnt/usb (type qnx4)
> > > mount: Possible reason: No such device or address
> > > 
> > > Do I need to format it?
> > 
> > Yes, just like above.
> > 
> > Also, if you want to mount it you'll have to do:
> > 
> > mount -t etfs...
View Full Message
Re: RE: RE: RE: Need help initializing filesystem.  
I actually did try without -e (had looked at the usage text), but I repeated with -vvv and got not one extra bit of 
information.  Do I need to recompile it with an option to get debugging info?

# etfsctl -d /dev/etfs2 -fc -vvv
Error status on option 'c' : Corrupted file system detected

Process 61456 (D:\QNX632\workspaceActive\os-efsys_efsys\utils\e\etfsctl\nto\arm-le\etfsctl) exited status=1.


> Durwin,
> 
> I've made a small error.  The -ef is redudant.  -e means "erase all the
> blocks".  -f mean "erase the blocks and format".  So please specify only
> -f to etfsctl.
> 
> The -c is giving you the error because that's what triggers ETFS to
> actually start scanning the filesystem and checking for consistency.
> Please re-do the test without the -e on etfsctl, and please add -vvv to
> the commandline of fs-etfs-nand.
> 
> David 
> 
> > -----Original Message-----
> > From: Durwin De La Rue [mailto:community-noreply@qnx.com] 
> > Sent: June 11, 2009 3:21 PM
> > To: general-filesystems
> > Subject: Re: RE: RE: Need help initializing filesystem.
> > 
> > This was sounding so positive.  I run;
> > 
> > fs-etfs-nand -r 12800 -m /fs/etfs
> > 
> > etfsctl -d /dev/etfs2 -efc
> > 
> > This is where I now have trouble.  It says;
> > 
> > Error status on option 'c' : Corrupted file system detected
> > 
> > If I do not use '-c', it returns status=0 and it takes a few 
> > seconds to do what it is doing.  But then if I '-c', it 
> > returns same error.  Unless I am over looking something, I 
> > guess I need to dive into the driver code.
> > 
> > >  
> > > 
> > > > -----Original Message-----
> > > > From: Durwin De La Rue [mailto:community-noreply@qnx.com]
> > > > Sent: June 11, 2009 1:29 PM
> > > > To: general-filesystems
> > > > Subject: Re: RE: Need help initializing filesystem.
> > > > 
> > > > Thank you for your reply.
> > > > 
> > > > > Durwin,
> > > > > 
> > > > > Since you are using NAND flash, fs-etfs-nand is the right
> > > > driver for
> > > > > you to use.  Etfsctl is the proper command-line utility:  
> > > > flashctl is
> > > > > the command-line util for the devf-* series of drivers, 
> > which use 
> > > > > a different filesystem, and target NOR flash.
> > > > > 
> > > > > The ETFS filesystems only support two partitions: a raw
> > > > partition, and
> > > > > a formatted partition.  The raw partition is always called
> > > > /dev/etfs1,
> > > > > and the formatted partition is called /dev/etfs2.  By
> > > > default the raw
> > > > > partition is zero sized, and the formatted partition fills
> > > > the entire
> > > > > NAND part.
> > > > > 
> > > > > Since you have /fs/etfs, that means that /dev/etfs2 is properly 
> > > > > formatted, and mounted.  /fs/etfs is the filesystem mountpoint.
> > > > 
> > > > I have tried to 'cd' into /fs/etfs and received message 'device 
> > > > busy'.  I get same message trying to perform other tasks on it.
> > > 
> > > That means the filesystem is in the stopped state.  ETFS has the 
> > > notion of "stopped" filesystem (similar to pausing).  The 
> > filesystem 
> > > will be in this state if it's not formatted.  If this driver is 
> > > pre-6.4.0, then that makes sense, as ETFS will auto-create the 
> > > /fs/etfs mountpoint whether it's...
View Full Message