public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Creating an ext3 partition on an mtd device
@ 2009-08-26 19:44 Mark Ryden
  2009-08-26 21:26 ` Justin Waters
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Ryden @ 2009-08-26 19:44 UTC (permalink / raw)
  To: linux-mtd

Hello,

I want to create an ext2 partition on an mtd device.

The is the output of cat /proc/mtd
dev:    size   erasesize  name

 mtd0: 00100000 00040000 "UBoot"
 mtd1: 00400000 00040000 "UImage"
 mtd2: 7fb00000 00040000 "Root"
 mtd3: 00800000 00010000 "spi0.0"


 I tried to create a partition with fdisk /dev/mtdblock2
 The device is /dev/mtdblock2p1
 but: mkfs.ext3 /dev/mtdblock2p1  fails

 What should I do ? Is it right in this case to use fdisk at all ?

Regards,
Mark Ryden

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

* Re: Creating an ext3 partition on an mtd device
  2009-08-26 19:44 Creating an ext3 partition on an mtd device Mark Ryden
@ 2009-08-26 21:26 ` Justin Waters
  2009-08-27  5:59   ` Mark Ryden
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Waters @ 2009-08-26 21:26 UTC (permalink / raw)
  To: Mark Ryden; +Cc: linux-mtd@lists.infradead.org

Mark,

On Wed, 2009-08-26 at 15:44 -0400, Mark Ryden wrote:
> Hello,
> 
> I want to create an ext2 partition on an mtd device.

No, you don't.

See: http://www.linux-mtd.infradead.org/faq/general.html#L_ext2_mtd

and

http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl

>  I tried to create a partition with fdisk /dev/mtdblock2
>  The device is /dev/mtdblock2p1
>  but: mkfs.ext3 /dev/mtdblock2p1  fails
> 
>  What should I do ? Is it right in this case to use fdisk at all ?

Unless you have some hard requirement for EXT2, you are much better off
using a flash file system, like ubifs or jffs2.  Check out
http://www.linux-mtd.infradead.org for more info.

> Regards,
> Mark Ryden

- Justin Waters

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

* Re: Creating an ext3 partition on an mtd device
  2009-08-26 21:26 ` Justin Waters
@ 2009-08-27  5:59   ` Mark Ryden
  2009-08-27  6:29     ` Artem Bityutskiy
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Ryden @ 2009-08-27  5:59 UTC (permalink / raw)
  To: Justin Waters; +Cc: linux-mtd@lists.infradead.org

Hello, Justin,
Thanks for your answer.

Then why do I have in "Essential Linux Device Drivers" this , in
"Block Device Emulation" section of chapter 17, "Memory Technology
Devices" , this:

Block Device Emulation
The MTD subsystem provides a block driver called mtdblock that
emulates a hard disk over flash memory. You can put any filesystem,
say EXT2, over the emulated flash disk. Mtdblock hides complicated
flash access procedures (such as preceding a write with an erase of
the corresponding sector) from the filesystem. Device nodes created by
mtdblock are named /dev/mtdblock/X, where X is the partition number.
To create an EXT2 filesystem on the pda_fs partition of the handheld,
as shown in Figure 17.2, do the following:
bash> mkfs.ext2 /dev/mtdblock/2                 Create an EXT2 filesystem
                                                 on the second partition

bash> mount /dev/mtdblock/2 /mnt                Mount the partition


Regards,
Mark


On Thu, Aug 27, 2009 at 12:26 AM, Justin
Waters<justin.waters@timesys.com> wrote:
> Mark,
>
> On Wed, 2009-08-26 at 15:44 -0400, Mark Ryden wrote:
>> Hello,
>>
>> I want to create an ext2 partition on an mtd device.
>
> No, you don't.
>
> See: http://www.linux-mtd.infradead.org/faq/general.html#L_ext2_mtd
>
> and
>
> http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl
>
>>  I tried to create a partition with fdisk /dev/mtdblock2
>>  The device is /dev/mtdblock2p1
>>  but: mkfs.ext3 /dev/mtdblock2p1  fails
>>
>>  What should I do ? Is it right in this case to use fdisk at all ?
>
> Unless you have some hard requirement for EXT2, you are much better off
> using a flash file system, like ubifs or jffs2.  Check out
> http://www.linux-mtd.infradead.org for more info.
>
>> Regards,
>> Mark Ryden
>
> - Justin Waters
>
>

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

* Re: Creating an ext3 partition on an mtd device
  2009-08-27  5:59   ` Mark Ryden
@ 2009-08-27  6:29     ` Artem Bityutskiy
  2009-08-27  8:24       ` Jamie Lokier
  0 siblings, 1 reply; 5+ messages in thread
From: Artem Bityutskiy @ 2009-08-27  6:29 UTC (permalink / raw)
  To: Mark Ryden; +Cc: Justin Waters, linux-mtd@lists.infradead.org

On Thu, 2009-08-27 at 08:59 +0300, Mark Ryden wrote:
> Hello, Justin,
> Thanks for your answer.
> 
> Then why do I have in "Essential Linux Device Drivers" this , in
> "Block Device Emulation" section of chapter 17, "Memory Technology
> Devices" , this:
> 
> Block Device Emulation
> The MTD subsystem provides a block driver called mtdblock that
> emulates a hard disk over flash memory. You can put any filesystem,
> say EXT2, over the emulated flash disk. Mtdblock hides complicated
> flash access procedures (such as preceding a write with an erase of
> the corresponding sector) from the filesystem. Device nodes created by
> mtdblock are named /dev/mtdblock/X, where X is the partition number.
> To create an EXT2 filesystem on the pda_fs partition of the handheld,
> as shown in Figure 17.2, do the following:
> bash> mkfs.ext2 /dev/mtdblock/2                 Create an EXT2 filesystem
>                                                  on the second partition
> 
> bash> mount /dev/mtdblock/2 /mnt                Mount the partition

mtdblock does not do any bad block handling, so you cannot use it with
NAND. And it does not do any wear-leveling, and it has zero tolerance to
power cuts.

I think the text above assumes that you have NOR, you do not care about
WL and power-cuts.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: Creating an ext3 partition on an mtd device
  2009-08-27  6:29     ` Artem Bityutskiy
@ 2009-08-27  8:24       ` Jamie Lokier
  0 siblings, 0 replies; 5+ messages in thread
From: Jamie Lokier @ 2009-08-27  8:24 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Mark Ryden, Justin Waters, linux-mtd@lists.infradead.org

Artem Bityutskiy wrote:
> mtdblock does not do any bad block handling, so you cannot use it with
> NAND. And it does not do any wear-leveling, and it has zero tolerance to
> power cuts.
> 
> I think the text above assumes that you have NOR, you do not care about
> WL and power-cuts.

That's right.  Basically you should only use mtdblock for filesystems
that are mounted read-only, and only written rarely such as
exceptional system updates.  (Not if system updates are often).

Don't even mount the filesystem writable, even if you're not writing
to it most of the time, because just mounting writable wears the flash
and is not safe against power cuts.

-- Jamie

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

end of thread, other threads:[~2009-08-27  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 19:44 Creating an ext3 partition on an mtd device Mark Ryden
2009-08-26 21:26 ` Justin Waters
2009-08-27  5:59   ` Mark Ryden
2009-08-27  6:29     ` Artem Bityutskiy
2009-08-27  8:24       ` Jamie Lokier

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