How does one mount an existing jffs2 partition so it is writeable?
Hi All,
How does one mount an existing jffs2 partition so it is writeable?
After a reboot I can mount my jffs2 and read from it, but not write to it I can erase it first and mount it then read and write to it , but then I lose my info on it which defeats the whole reason for having it.
Here is what I am doing.
[/]# MAKEDEV
[/]# mkdir gpig
[/]# mount /dev/mtdblock3 /gpig
[/]# cd gpig
[/gpig]# ls
kernel_192e_V0.0.03ps
[/gpig]# cp ../bin/MAKEALL .
cp: ../bin/MAKEALL: No such file or directory
[/gpig]#
[/gpig]# cp ../bin/MAKEDEV .
Write of 68 bytes at 0x00059a28 failed. returned 0, retlen 0
Not marking the space at 0x00059a28 as dirty because the flash driver returned retlen zero
cp: ./MAKEDEV: Input/output error
[/gpig]#
What step am I missing?
Thanks in advance
Conn
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
Quoted 4 lines · Conn Clark
How does one mount an existing jffs2 partition so it is writeable?
After a reboot I can mount my jffs2 and read from it, but not write to it I can erase it first and mount it then read and write to it , but then I lose my info on it which defeats the whole reason for having it.
1) Append "rw" to kernel command line.
2) mount / -o remount,rw
Jörn
Signature · 2 lines
Everything should be made as simple as possible, but not simpler. -- Albert Einstein
Quoted 7 lines · Jörn Engel
Quoted 4 lines · Conn Clark
How does one mount an existing jffs2 partition so it is writeable?
After a reboot I can mount my jffs2 and read from it, but not write to it I can erase it first and mount it then read and write to it , but then I lose my info on it which defeats the whole reason for having it.
Quoted 8 lines
1) Append "rw" to kernel command line.
2) mount / -o remount,rwJörn
--
Everything should be made as simple as possible, but not simpler. -- Albert Einstein
Didn't work, I get the same message. Did I do it right?
[/gpig]# cd ..
[/]# mount /gpig -o remount,rw
[/]# cd gpig
[/gpig]# cp ../bin/MAKEDEV .
Write of 68 bytes at 0x00059a28 failed. returned 0, retlen 0
Not marking the space at 0x00059a28 as dirty because the flash driver returned r etlen zero
cp: ./MAKEDEV: Input/output error
[/gpig]#
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
Do you need to unlock your flash before you can write to it? That's not done automatically by mtd or jffs2. There's a diff in the ARM patch system by me that might be applicable.
-ch
Quoted 3 lines · [email protected] said:
Do you need to unlock your flash before you can write to it? That's
not done automatically by mtd or jffs2. There's a diff in the ARM patch system by me that might be applicable.
I'm beginning to wonder if we should make JFFS2 unlock automatically if it finds at least some JFFS2 nodes. Or put in the 'is_flash_locked' method and make JFFS2 notice that it's locked _before_ trying to write to it, and print an appropriate message and mount in read-only mode so it doesn't even let you _try_ to write to it.
--
dwmw2
Quoted 12 lines · David Woodhouse
Quoted 5 lines · [email protected] said:
Do you need to unlock your flash before you can write to it? That's not done automatically by mtd or jffs2. There's a diff in the ARM patch system by me that might be applicable.
I'm beginning to wonder if we should make JFFS2 unlock automatically if it finds at least some JFFS2 nodes. Or put in the '
is_flash_locked' method and make JFFS2 notice that it's locked _before_ trying to write to it, and print an appropriate message and mount in read-only mode so it doesn't even let you _try_ to write to it.
I would much rather that JFFS2 not unlock blocks automatically. We tend to lock blocks for a reason (e.g., so that we don't accidentally erase the boot loader with incorrect mount options). I think it would be reasonable for JFFS2 to query whether flash is locked beforehand and to mount read-only. I think it would also be reasonable to provide a mount option directing it to unlock flash.
Jamey
Quoted 6 lines · [email protected] said:
I would much rather that JFFS2 not unlock blocks automatically. We
tend to lock blocks for a reason (e.g., so that we don't accidentally erase the boot loader with incorrect mount options). I think it would be reasonable for JFFS2 to query whether flash is locked beforehand and to mount read-only. I think it would also be reasonable to provide a mount option directing it to unlock flash.
Yeah -- you're probably right. That's the reason I refused to do the automatic unlock when it was originally suggested. We are fairly good about aborting a mount attempt if it really doesn't look like a JFFS2 partition, but if you have the partitioning wrong so that the range we try to mount includes some JFFS2 _and_ something important, that's still going to break.
--
dwmw2
Quoted 5 lines · David Woodhouse
Yeah -- you're probably right. That's the reason I refused to do the automatic unlock when it was originally suggested. We are fairly good about aborting a mount attempt if it really doesn't look like a JFFS2 partition, but if you have the partitioning wrong so that the range we try to mount includes some JFFS2 _and_ something important, that's still going to break.
And if we have an old jffs2 partition that was partially overwritten by cramfs. Without a prior erase, this will be identified as jffs2.
Pretty rare in production systems, though.
Jörn
Signature · 2 lines
Those who come seeking peace without a treaty are plotting. -- Sun Tzu
Quoted 1 line
I would much rather that JFFS2 not unlock blocks automatically. We
tend
Quoted 3 lines
to lock blocks for a reason (e.g., so that we don't accidentally erase
the boot loader with incorrect mount options).
You have a different flavor flash. My platform uses Intel C3 StrataFlash parts. The flash is completely locked after any power
cycle. If I don't unlock the jffs2 partition somehow someway, I can't
write to it.
I suppose we could add yet another mount option for this ("really_and_truly_rw"!).
Quoted 7 lines · Christopher Hoover
You have a different flavor flash. My platform uses Intel C3 StrataFlash parts. The flash is completely locked after any power
cycle. If I don't unlock the jffs2 partition somehow someway, I can't
write to it.I suppose we could add yet another mount option for this ("
really_and_truly_rw"!).
If this is a problem (feature/whatever) of one flash type, why not encapsulate it in the low level driver? It would keep the jffs2 code clean of what could be considered a bugfix.
Jörn
Signature · 3 lines
I can say that I spend most of my time fixing bugs even if I have lots of new features to implement in mind, but I give bugs more priority. -- Andrea Arcangeli, 2000
Quoted 3 lines
If this is a problem (feature/whatever) of one flash type, why not encapsulate it in the low level driver? It would keep the jffs2 code clean of what could be considered a bugfix.
That was my first thought. I submitted such a patch (-- it should be in the archives), but IIRC David didn't want it applied to CVS. He
suggested that I move this to the SA-1100 partition code. I did that,
but that has its own ugliness.
-ch
Quoted 4 lines · [email protected] said:
That was my first thought. I submitted such a patch (-- it should be in the archives), but IIRC David didn't want it applied to CVS. He
suggested that I move this to the SA-1100 partition code. I did
that, but that has its own ugliness.
I never claimed not to be fickle. If your patch did the unlock automatically _only_ for the C3 flash which locks itself every power cycle, try me again :)
--
dwmw2
Quoted 10 lines · Christopher Hoover
Do you need to unlock your flash before you can write to it? That's not done automatically by mtd or jffs2. There's a diff in the ARM patch system by me that might be applicable.
-ch
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
This is what I needed to know and is probably the culprit. However my unlock utility is broken. I can tell this because it doesn't even try to move through the sectors in the partition like the lock command does.
I think I have it under control now.
Thanks.
Conn
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
Quoted 17 lines · Conn Clark
Quoted 10 lines · Christopher Hoover
Do you need to unlock your flash before you can write to it? That's not done automatically by mtd or jffs2. There's a diff in the ARM patch system by me that might be applicable.
-ch
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/This is what I needed to know and is probably the culprit. However my unlock utility is broken. I can tell this because it doesn't even try to move through the sectors in the partition like the lock command does.
Quoted 5 lines
I think I have it under control now.
Thanks.
Conn
I meant to say move through the sectors like the erase command, however I
can see that the lock command works very similar to the unlock command. This makes me suspect that I have something wrong in the kernel code.
here is what I have.
I am running on a MPC850 PowerPC processor.
I am using a single intel TE28F320C3BA110 flash chip mapped as a 16 bit device. I am using kernel 2.4.19 from kernel.org with the shared zlib patch.
I had to change 2 lines in cfi_cmdset_0001.c from
extp->FeatureSupport = cfi32_to_cpu(extp->FeatureSupport);
extp->BlkStatusRegMask = cfi32_to_cpu(extp->BlkStatusRegMask);to
extp->FeatureSupport = le32_to_cpu(extp->FeatureSupport);
extp->BlkStatusRegMask = le16_to_cpu(extp->BlkStatusRegMask);in order to fix an endian issue.
I had to create a custom map driver as well.
Any ideas on what else I have to change to get the lock/unlock commands to work?
Thanks in advance,
Conn
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
At one point locking and unlocking flash with variable-sized blocks (such as Intel C3 flash) simply didn't work. I fixed it -- the correct code is in CVS and in current 2.4 (after some release I cannot remember), but the changes unfortunately aren't in 2.5.
Check drivers/mtd/chips/cfi_cmdset_0001.c in your sources. You should
see a changelog entry from me dated 02/05/2002; if you don't see it, you don't have the fix.
Quoted 6 lines · Christopher Hoover
At one point locking and unlocking flash with variable-sized blocks (such as Intel C3 flash) simply didn't work. I fixed it -- the correct code is in CVS and in current 2.4 (after some release I cannot remember), but the changes unfortunately aren't in 2.5.
Quoted 7 lines
Check
drivers/mtd/chips/cfi_cmdset_0001.cin your sources. You should
see a changelog entry from me dated 02/05/2002; if you don't see it, you don't have the fix.
I don't have it. Can I just drop it in or are there other files I need to get/update? I haven't used CVS before so I will need help doing that if thats the best way of getting all relevant files.
Thanks
Conn
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
Here's the patch against 2.5.18-rmk1. It applies cleanly to all kernels since.
http://www.murgatroid.com/badge4/release/ch-release-2002-07-14/src/kernel-patches/linux-2.5.18-rmk1-mtd-intel-varsize.patch
-ch
Quoted 55 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Conn Clark
Sent: Tuesday, August 20, 2002 11:42 AM
To: Christopher Hoover
Cc: MTD Mailing List
Subject: Re: How does one mount an existing jffs2 partition so it is writeable?Quoted 3 lines · Christopher Hoover
At one point locking and unlocking flash with variable-sized blocks (such as Intel C3 flash) simply didn't work. I fixed it --
the correct
Quoted 4 lines
code is in CVS and in current 2.4 (after some release I cannot remember), but the changes unfortunately aren't in 2.5.
Check
drivers/mtd/chips/cfi_cmdset_0001.cin your sources.You should
Quoted 1 line
see a changelog entry from me dated 02/05/2002; if you
don't see it, you
Quoted 5 lines
don't have the fix.
I don't have it. Can I just drop it in or are there other files I need to
get/update? I haven't used CVS before so I will need help doing that if thats
the best way of getting all relevant files.Thanks
Conn
Signature · 16 lines
***************************************************************** If you live at home long enough, your parents will move out. (Warning they may try to sell their house out from under you.) ***************************************************************** Conn Clark Engineering Stooge [email protected] Electronic Systems Technology Inc. www.esteem.com Stock Ticker Symbol ELST "[email protected]" Copyright 2000 By Electronic Systems Technology This email address may be used to communicate to Conn Clark provided it is not being used for advertisement purposes, unless prior written consent is given. This email address may not be sold under any circumstances. All other rights reserved.
Quoted 12 lines · Conn Clark
Quoted 8 lines · Jörn Engel
Quoted 4 lines · Conn Clark
How does one mount an existing jffs2 partition so it is writeable?
After a reboot I can mount my jffs2 and read from it, but not write to it I can erase it first and mount it then read and write to it , but then I lose my info on it which defeats the whole reason for having it.1) Append "rw" to kernel command line.
2) mount / -o remount,rwDidn't work, I get the same message. Did I do it right?
Quoted 9 lines
[/gpig]# cd ..
[/]# mount /gpig -o remount,rw
[/]# cd gpig
[/gpig]# cp ../bin/MAKEDEV .
Write of 68 bytes at0x00059a28failed. returned 0, retlen 0
Not marking the space at0x00059a28as dirty because the flash driver returned r etlen zero
cp: ./MAKEDEV: Input/output error
[/gpig]#
Maybe. If the locking hint from Christopher doesn't work either, we need more information:
- Number, size and type of flash chips
- output from mount
- kernel version plus applied patches
- ...
Without knowing whether /gpid is the mounted partition in question or not, my best answer is maybe. :)
Jörn
Signature · 4 lines
The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. -- Edsger W. Dijkstra