Skip to contentSkip to conversation

reach of jffs2 within image vs. partition

DISCUSSION John Burch 4 participants 7 messages Apr 2, 2003 Memory technology devices (MTD)

lore
Share & tools
lore

John Burch

author
#0 lore raw

Will JFFS2 ever read/write an area of flash memory that is within the same mtd partition but outside of the jffs2 image (as defined -p switch of mkfs.jffs2)? In other words, if the jffs2 image spans 0x0 - 0x120000 and it lies within an mtd partition that spans 0x0 - 0x140000, will the last 128k, spanning from 0x120000 - 0x140000, ever be accessed in any way by jffs2? Would that 128k area be as safe/non-volatile there as in a separate partition?

Thanks,
John

#1 lore raw
Quoted 7 lines · John Burch

Will JFFS2 ever read/write an area of flash memory that is within the same mtd partition but outside of the jffs2 image (as defined -p switch of mkfs.jffs2)? In other words, if the jffs2 image spans 0x0 - 0x120000 and it lies within an mtd partition that spans 0x0 - 0x140000, will the last 128k, spanning from 0x120000 - 0x140000, ever be accessed in any way by jffs2? Would that 128k area be as safe/non-volatile there as in a separate partition?

No. JFFS2 will use the entire partition regardless of the amount of space taken by the original image.

Signature · 1 line
dwmw2
#6 lore raw
In reply to John Burch
Quoted 7 lines · John Burch

Will JFFS2 ever read/write an area of flash memory that is within the same mtd partition but outside of the jffs2 image (as defined -p switch of mkfs.jffs2)? In other words, if the jffs2 image spans 0x0 - 0x120000 and it lies within an mtd partition that spans 0x0 - 0x140000, will the last 128k, spanning from 0x120000 - 0x140000, ever be accessed in any way by jffs2? Would that 128k area be as safe/non-volatile there as in a separate partition?

JFSS2 is mounted on a partition and accesses the hole partition. If you want to reserve an aera in your flash chip for other purposes, put this area in a seperate partition.

Signature · 5 lines
Thomas
________________________________________________________________________
linutronix - competence in embedded & realtime linux
http://www.linutronix.de
mail: [email protected]
author
#2 lore raw
In reply to David Woodhouse
Quoted 18 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of David Woodhouse
Sent: Wednesday, April 02, 2003 8:11 AM
To: John Burch
Cc: [email protected]
Subject: Re: reach of jffs2 within image vs. partition

Quoted 1 line · John Burch

Will JFFS2 ever read/write an area of flash memory that is

within the

Quoted 2 lines

same mtd partition but outside of the jffs2 image (as defined -p switch of mkfs.jffs2)? In other words, if the jffs2 image

spans 0x0 -

Quoted 8 lines
Quoted 2 lines

0x120000 and it lies within an mtd partition that spans 0x0 - 0x140000, will the last 128k, spanning from 0x120000 -

0x140000, ever

Quoted 2 lines

be accessed in any way by jffs2? Would that 128k area be as safe/non-volatile there as in a separate partition?

No. JFFS2 will use the entire partition regardless of the amount of space taken by the original image.

Thanks.

Is there any advantage or disadvantage to creating the jffs2 image file with the exact same size (via padding) as the partition, as opposed to creating the jffs2 image with some size that's less than the partition size?

Quoted 9 lines
Signature · 7 lines
-- 
dwmw2


______________________________________________________
Linux MTD discussion mailing list 
http://lists.infradead.org/mailman/listinfo/li> nux-mtd/
#3 lore raw
Quoted 4 lines · John Burch

Is there any advantage or disadvantage to creating the jffs2 image file with the exact same size (via padding) as the partition, as opposed to creating the jffs2 image with some size that's less than the partition size?

Not generally, no.

If you use the 'cleanmarker' option then it'll prevent the kernel from erasing the remaining blocks on the first mount, and with some bootloaders you can't define a partition while installing an image which is smaller than the total intended size of that partition -- so you had to pad with 0xFF to avoid writing crap to the end of it.

Signature · 1 line
dwmw2
#4 lore raw
Quoted 6 lines · David Woodhouse
Quoted 4 lines · John Burch

Is there any advantage or disadvantage to creating the jffs2 image file with the exact same size (via padding) as the partition, as opposed to creating the jffs2 image with some size that's less than the partition size?

Quoted 7 lines

Not generally, no.

If you use the 'cleanmarker' option then it'll prevent the kernel from erasing the remaining blocks on the first mount, and with some bootloaders you can't define a partition while installing an image which is smaller than the total intended size of that partition -- so you had to pad with 0xFF to avoid writing crap to the end of it.

In my experience, better always use images of the same size as the partition.

You don't *have* to, but then some will figure out how to not erase the partition, write the image to it, remount the partition and find some old data in the filesystem that was supposed to be erased.

Give people the option to shoot themselves in the foot and eventually someone will do it - and blame you. ;)

Jörn

Signature · 3 lines
When you close your hand, you own nothing. When you open it up, you
own the whole world.
-- Li Mu Bai in Tiger & Dragon
#5 lore raw
Quoted 9 lines · Jörn Engel

In my experience, better always use images of the same size as the partition.

You don't *have* to, but then some will figure out how to not erase the partition, write the image to it, remount the partition and find some old data in the filesystem that was supposed to be erased.

Give people the option to shoot themselves in the foot and eventually someone will do it - and blame you. ;)

Oh yeah, that too -- good point :)

Signature · 1 line
dwmw2