public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind@infradead.org>
To: Cal Page <pagcal@runbox.com>
Cc: linux-mtd@lists.infradead.org
Subject: Re: ubiattach fails with bad VID header offset 2048, expected 512 ???
Date: Thu, 11 Dec 2008 21:28:23 +0200	[thread overview]
Message-ID: <1229023703.13686.398.camel@sauron> (raw)
In-Reply-To: <4941188A.30303@runbox.com>

On Thu, 2008-12-11 at 08:41 -0500, Cal Page wrote:
> ubiattach fails with bad VID header offset 2048, expected 512 ???
> 
> The is the first thing out of the box. It reads block 0 to get the 
> ubi_ec_hdr then parses it.

I guess you generated an image with wrong sub-page size?

> UBI DBG (pid 2785): ctrl_cdev_ioctl: attach MTD device
> UBI: attaching mtd12 to ubi0
> UBI DBG (pid 2785): io_init: min_io_size      2048
> UBI DBG (pid 2785): io_init: hdrs_min_io_size 512
> UBI DBG (pid 2785): io_init: ec_hdr_alsize    512
> UBI DBG (pid 2785): io_init: vid_hdr_alsize   512
> UBI DBG (pid 2785): io_init: vid_hdr_offset   512
> UBI DBG (pid 2785): io_init: vid_hdr_aloffset 512
> UBI DBG (pid 2785): io_init: vid_hdr_shift    0
> UBI DBG (pid 2785): io_init: leb_start        2048
> UBI: physical eraseblock size:   131072 bytes (128 KiB)
> UBI: logical eraseblock size:    129024 bytes
> UBI: smallest flash I/O unit:    2048
> UBI: sub-page size:              512
> UBI: VID header offset:          512 (aligned 512)
> UBI: data offset:                2048

You have 512 bytes sub-pages, so UBI expects the volume ID header to be
at offset 512.

Probably these sections should give you some understanding how and at
which offsets the headers are stored:

http://www.linux-mtd.infradead.org/doc/ubi.html#L_overhead
http://www.linux-mtd.infradead.org/faq/ubi.html#L_ubi_mkimg
http://www.linux-mtd.infradead.org/faq/ubi.html#L_find_min_io_size

Anyway, if you want to force UBI to use other position for the VID
header, there are UBI module options for this. Take a look at what
'modinfo ubi' tells.

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

      reply	other threads:[~2008-12-11 19:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-11 13:41 ubiattach fails with bad VID header offset 2048, expected 512 ??? Cal Page
2008-12-11 19:28 ` Artem Bityutskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229023703.13686.398.camel@sauron \
    --to=dedekind@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pagcal@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox