All of lore.kernel.org
 help / color / mirror / Atom feed
* Mounting UBIFS images with a min. I/O unit of 1 byte
@ 2015-03-30 18:13 Kline, Matthew
  2015-03-31  6:27 ` Artem Bityutskiy
  0 siblings, 1 reply; 3+ messages in thread
From: Kline, Matthew @ 2015-03-30 18:13 UTC (permalink / raw)
  To: linux-mtd

Hello all,

I am attempting to mount a UBIFS image to extract and inspect the files within.
Unfortunately, I'm running into a bunch of problems. For starters, there doesn't
seem to be a canonical way to do so - the process listed at
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_ubifs_extract
seems out of date given how my kernel (3.19.2) behaves and compared to processes
listed at more recent sources such as
http://elinux.org/UBIFS#Mounting_UBI_Image_on_PC_using_nandsim or
https://gist.github.com/naodesu/10620506. At any rate, I have had the most luck
with the third method, but mount fails, logging to dmesg,
"validate_sb: min. I/O unit mismatch: 8 in superblock, 2048 real".

After asking around on the IRC channel #mtd, I understand that the
problem is caused by the UBIFS image being byte-addressable
(with mkfs.ubifs being passed -m 1), while the NAND device nandsim is simulating
is addressable to 2048 bit (or byte?) blocks (hence the dmesg output).

So, if the image has a minimum I/O unit of 1 byte and most NAND memory
has a unit of >= 512 bytes
(as mentioned at http://linux-mtd.infradead.org/doc/ubi.html#L_min_io_unit),
is mounting it with nandsim out of the question? Is there any other approach
I can take?

Best wishes,

Matt Kline
Fluke Networks

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

* Re: Mounting UBIFS images with a min. I/O unit of 1 byte
  2015-03-30 18:13 Mounting UBIFS images with a min. I/O unit of 1 byte Kline, Matthew
@ 2015-03-31  6:27 ` Artem Bityutskiy
  2015-03-31 18:02   ` Kline, Matthew
  0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2015-03-31  6:27 UTC (permalink / raw)
  To: Kline, Matthew; +Cc: linux-mtd

Hi Matt,

On Mon, 2015-03-30 at 18:13 +0000, Kline, Matthew wrote:
> Hello all,
> 
> I am attempting to mount a UBIFS image to extract and inspect the files within.
> Unfortunately, I'm running into a bunch of problems. For starters, there doesn't
> seem to be a canonical way to do so - the process listed at
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_ubifs_extract
> seems out of date given how my kernel (3.19.2) behaves and compared to processes
> listed at more recent sources such as
> http://elinux.org/UBIFS#Mounting_UBI_Image_on_PC_using_nandsim or
> https://gist.github.com/naodesu/10620506. At any rate, I have had the most luck
> with the third method, but mount fails, logging to dmesg,
> "validate_sb: min. I/O unit mismatch: 8 in superblock, 2048 real".

Right, there is no canonical way, unfortunately, no one created it.

> After asking around on the IRC channel #mtd, I understand that the
> problem is caused by the UBIFS image being byte-addressable
> (with mkfs.ubifs being passed -m 1), while the NAND device nandsim is simulating
> is addressable to 2048 bit (or byte?) blocks (hence the dmesg output).

8 is what UBI/UBIFS uses in case of NOR flashes. So you seem to have an
image made for a NOR flash and you are trying to put it to a NAND flash
simulator.

> So, if the image has a minimum I/O unit of 1 byte and most NAND memory
> has a unit of >= 512 bytes
> (as mentioned at http://linux-mtd.infradead.org/doc/ubi.html#L_min_io_unit),
> is mounting it with nandsim out of the question? Is there any other approach
> I can take?

Try mtdram - should help. Make sure it is built, then modprobe mtdram.
There are parameters to control eraseblock size and flash size.

Generally - UBI/UBIFS images are specific to flash geometry. If you want
to mount the image, you need to have a flash of the same geometry:
eraseblock size and min. I/O unit size. Flash size should be same or
larger.

HTH.

P.S: feel free to amend the mtd web site too. Send patches against the
'mtd-www.git' project.

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

* RE: Mounting UBIFS images with a min. I/O unit of 1 byte
  2015-03-31  6:27 ` Artem Bityutskiy
@ 2015-03-31 18:02   ` Kline, Matthew
  0 siblings, 0 replies; 3+ messages in thread
From: Kline, Matthew @ 2015-03-31 18:02 UTC (permalink / raw)
  To: linux-mtd

> Try mtdram - should help. Make sure it is built, then modprobe mtdram.
> There are parameters to control eraseblock size and flash size.

mtdram did the trick! Thank you so much for the suggestion.
The images are indeed for NOR memory, but until you mentioned it,
I had not heard of mtdram - every set of instructions I could find
for mounting suggested nandsim.

> P.S: feel free to amend the mtd web site too. Send patches against the 'mtd-www.git' project.

As someone without too much mailing list experience,
is proper etiquette to attach the patches or include them as part
of the message body?

Many thanks,
Matt

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

end of thread, other threads:[~2015-03-31 18:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-30 18:13 Mounting UBIFS images with a min. I/O unit of 1 byte Kline, Matthew
2015-03-31  6:27 ` Artem Bityutskiy
2015-03-31 18:02   ` Kline, Matthew

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.