public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* How does one mount an existing jffs2 partition so it is writeable?
@ 2002-08-19 17:34 Conn Clark
  2002-08-19 23:42 ` Jörn Engel
  0 siblings, 1 reply; 13+ messages in thread
From: Conn Clark @ 2002-08-19 17:34 UTC (permalink / raw)
  To: MTD Mailing List

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
-- 

*****************************************************************
  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				clark@esteem.com
Electronic Systems Technology Inc.		www.esteem.com

Stock Ticker Symbol				ELST

"clark@esteem.com" 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-19 17:34 Conn Clark
@ 2002-08-19 23:42 ` Jörn Engel
  0 siblings, 0 replies; 13+ messages in thread
From: Jörn Engel @ 2002-08-19 23:42 UTC (permalink / raw)
  To: Conn Clark; +Cc: linux-mtd

On Mon, 19 August 2002 10:34:23 -0700, Conn Clark wrote:
> 	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

-- 
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20  0:25 Christopher Hoover
@ 2002-08-20 10:21 ` David Woodhouse
  2002-08-20 12:12   ` Jamey Hicks
  0 siblings, 1 reply; 13+ messages in thread
From: David Woodhouse @ 2002-08-20 10:21 UTC (permalink / raw)
  To: Christopher Hoover
  Cc: 'Conn Clark', 'Jörn Engel',
	'MTD Mailing List'

ch@murgatroid.com 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 10:21 ` David Woodhouse
@ 2002-08-20 12:12   ` Jamey Hicks
  2002-08-20 12:19     ` David Woodhouse
  2002-08-20 16:34     ` Christopher Hoover
  0 siblings, 2 replies; 13+ messages in thread
From: Jamey Hicks @ 2002-08-20 12:12 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Christopher Hoover, 'Conn Clark',
	'Jörn Engel', 'MTD Mailing List'

David Woodhouse wrote:

>ch@murgatroid.com 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 12:12   ` Jamey Hicks
@ 2002-08-20 12:19     ` David Woodhouse
  2002-08-20 13:12       ` Jörn Engel
  2002-08-20 16:34     ` Christopher Hoover
  1 sibling, 1 reply; 13+ messages in thread
From: David Woodhouse @ 2002-08-20 12:19 UTC (permalink / raw)
  To: Jamey Hicks
  Cc: Christopher Hoover, 'Conn Clark',
	'Jörn Engel', 'MTD Mailing List'

jamey.hicks@hp.com 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 12:19     ` David Woodhouse
@ 2002-08-20 13:12       ` Jörn Engel
  0 siblings, 0 replies; 13+ messages in thread
From: Jörn Engel @ 2002-08-20 13:12 UTC (permalink / raw)
  To: David Woodhouse
  Cc: Jamey Hicks, Christopher Hoover, 'Conn Clark',
	'MTD Mailing List'

On Tue, 20 August 2002 13:19:14 +0100, David Woodhouse wrote:
> 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

-- 
Those who come seeking peace without a treaty are plotting.
-- Sun Tzu

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 12:12   ` Jamey Hicks
  2002-08-20 12:19     ` David Woodhouse
@ 2002-08-20 16:34     ` Christopher Hoover
  2002-08-20 19:24       ` Jörn Engel
  1 sibling, 1 reply; 13+ messages in thread
From: Christopher Hoover @ 2002-08-20 16:34 UTC (permalink / raw)
  To: 'Jamey Hicks', 'David Woodhouse'
  Cc: 'Conn Clark', 'Jörn Engel',
	'MTD Mailing List'

> 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).

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"!).

-ch
ch@murgatroid.com
ch@hpl.hp.com

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is   writeable?
  2002-08-20 18:18 Christopher Hoover
@ 2002-08-20 18:42 ` Conn Clark
  2002-08-20 21:50   ` Christopher Hoover
  0 siblings, 1 reply; 13+ messages in thread
From: Conn Clark @ 2002-08-20 18:42 UTC (permalink / raw)
  To: Christopher Hoover; +Cc: MTD Mailing List

Christopher Hoover wrote:
> 
> 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.
> 
> -ch
> ch@murgatroid.com
> ch@hpl.hp.com

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
-- 

*****************************************************************
  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				clark@esteem.com
Electronic Systems Technology Inc.		www.esteem.com

Stock Ticker Symbol				ELST

"clark@esteem.com" 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 16:34     ` Christopher Hoover
@ 2002-08-20 19:24       ` Jörn Engel
  2002-08-20 21:45         ` Christopher Hoover
  0 siblings, 1 reply; 13+ messages in thread
From: Jörn Engel @ 2002-08-20 19:24 UTC (permalink / raw)
  To: Christopher Hoover
  Cc: 'Jamey Hicks', 'David Woodhouse',
	'Conn Clark', 'MTD Mailing List'

On Tue, 20 August 2002 09:34:12 -0700, Christopher Hoover wrote:
> 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

-- 
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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 19:24       ` Jörn Engel
@ 2002-08-20 21:45         ` Christopher Hoover
  2002-08-20 21:46           ` David Woodhouse
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Hoover @ 2002-08-20 21:45 UTC (permalink / raw)
  To: 'Jörn Engel'
  Cc: 'Jamey Hicks', 'David Woodhouse',
	'Conn Clark', 'MTD Mailing List'

> 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is writeable?
  2002-08-20 21:45         ` Christopher Hoover
@ 2002-08-20 21:46           ` David Woodhouse
  0 siblings, 0 replies; 13+ messages in thread
From: David Woodhouse @ 2002-08-20 21:46 UTC (permalink / raw)
  To: Christopher Hoover
  Cc: 'Jörn Engel', 'Jamey Hicks',
	'Conn Clark', 'MTD Mailing List'

ch@murgatroid.com 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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: How does one mount an existing jffs2 partition so it is   writeable?
  2002-08-20 18:42 ` Conn Clark
@ 2002-08-20 21:50   ` Christopher Hoover
  0 siblings, 0 replies; 13+ messages in thread
From: Christopher Hoover @ 2002-08-20 21:50 UTC (permalink / raw)
  To: 'Conn Clark'; +Cc: 'MTD Mailing List'

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/kerne
l-patches/linux-2.5.18-rmk1-mtd-intel-varsize.patch

-ch


> -----Original Message-----
> From: root@esteem.com [mailto:root@esteem.com] 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?
> 
> 
> Christopher Hoover wrote:
> > 
> > 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.
> > 
> > -ch
> > ch@murgatroid.com
> > ch@hpl.hp.com
> 
> 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
> -- 
> 
> *****************************************************************
>   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				clark@esteem.com
> Electronic Systems Technology Inc.		www.esteem.com
> 
> Stock Ticker Symbol				ELST
> 
> "clark@esteem.com" 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.
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: How does one mount an existing jffs2 partition so it is   writeable?
       [not found] <000001c2489f$bf76d070$7c00000a@SNAGGLE>
@ 2002-08-21  0:15 ` Conn Clark
  0 siblings, 0 replies; 13+ messages in thread
From: Conn Clark @ 2002-08-21  0:15 UTC (permalink / raw)
  To: Christopher Hoover; +Cc: MTD Mailing List

Christopher Hoover wrote:
> 
> I assumed you were running 2.5.   Try to apply it and see how clean it
> applies.
> 

It applied with out a catch and everything seems to work like its supposed
to now.

Thank you very very much.

	Conn

-- 

*****************************************************************
  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				clark@esteem.com
Electronic Systems Technology Inc.		www.esteem.com

Stock Ticker Symbol				ELST

"clark@esteem.com" 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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-08-21  0:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <000001c2489f$bf76d070$7c00000a@SNAGGLE>
2002-08-21  0:15 ` How does one mount an existing jffs2 partition so it is writeable? Conn Clark
2002-08-20 18:18 Christopher Hoover
2002-08-20 18:42 ` Conn Clark
2002-08-20 21:50   ` Christopher Hoover
  -- strict thread matches above, loose matches on Subject: below --
2002-08-20  0:25 Christopher Hoover
2002-08-20 10:21 ` David Woodhouse
2002-08-20 12:12   ` Jamey Hicks
2002-08-20 12:19     ` David Woodhouse
2002-08-20 13:12       ` Jörn Engel
2002-08-20 16:34     ` Christopher Hoover
2002-08-20 19:24       ` Jörn Engel
2002-08-20 21:45         ` Christopher Hoover
2002-08-20 21:46           ` David Woodhouse
2002-08-19 17:34 Conn Clark
2002-08-19 23:42 ` Jörn Engel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox