public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <biessmann@corscience.de>
To: Dimax <dimax.main@gmail.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: UBIFS failure on SheevaPlug Basic
Date: Fri, 09 Nov 2012 13:32:26 +0100	[thread overview]
Message-ID: <509CF7DA.8060505@corscience.de> (raw)
In-Reply-To: <CAF9kqNFLvf+Kzesk9XZOvy61v6LzqUA+cnmxtPLK7kPfTLpKSw@mail.gmail.com>

Dear Dimax,

On 09.11.2012 12:41, Dimax wrote:
> HI Andreas,
> Thanks for your help. I'm not so advanced in Linux knowledge and will
> ask for deeper explanations. 

all of us started some time ...

> Or more exactly I understand what you
> mean but do not know how to do it.
> Please see below
> 
> On Fri, Nov 9, 2012 at 1:20 PM, Andreas Bießmann
> <biessmann@corscience.de> wrote:
>> Dear Dimax,
>>
>> On 09.11.2012 10:35, Dimax wrote:
>>> 1. Problem Description
>>> ---------------------------------
>>
>> <snip>
>>
>>> Error reading superblock on volume 'ubi:rootfs'!
>>> UBIFS not mounted, use ubifs mount to mount volume first!
>>> UBIFS not mounted, use ubifs mount to mount volume first!
>>> Wrong Image Format for bootm command
>>> ERROR: can't get kernel image!
>>>
>>
>> we discussed that already:
>> http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/145526
>> And a possible solution exists here:
>> http://patchwork.ozlabs.org/patch/195174/
>>
> 
> This is what I'm trying to do. I'm working now on building an u-boot
> image with suggested patch.

Ok

>>> 1.3 Recovery
>>>
>>> 2. Fixing
>>> ======
>>> 2. Make rootfs partition read only
>>
>> No, just use a /boot ro. All you need is kernel and initrd which should
>> be located in /boot. You can use a raw mtd for that too to avoid that
>> ubifs fails (as I understood is your fear).
> 
> Please explain how to get initrd in /boot ?

cp <initrd provided by debian distro> /boot
BTW: debian will install the initrd into /boot

> And what is a row mtd ?

I mean a RAW mtd section. You can access the mtd with tools from
mtd-utils to write raw data on it (without an file system). These data
can you get out of the mtd from u-boot, again without interaction with
an fs.

>> Another alternative is to have two logical ubifs in a physical ubi
>> section. One of them is ro, the other rw mounted.
>>
> How can I arrange it?

You can leave your mtdparts setting in u-boot as is and just create two
different ubifs filesystems in it. Lets call the first one <boot> and
the second one <fs>. So you will end up with these commands (not
checked, please read man page before using them):

% ubiformat -y -q /dev/mtd1
% ubiattach -p /dev/mtd1
% ubimkvol /dev/ubi0 -N boot -s 10MiB
% ubimkvol /dev/ubi0 -N fs -m
% mount -t ubifs ubi0:fs /target
% mkdir /target/boot
% mount -t ubifs ubi0:boot /target/boot
% debootstrap ...

Then configure your /etc/fstab and ensure the /boot is mounted ro
always. Just mount rw for an kernel update and then remount ro right
after the update.

>>> 3. Fix u-boot settings
>>> And here I'm not sure how to do all this.
>>
>> Just provide a correct cmdline so that the kernel knows about your
>> special nand organization. u-boot also want to know that to load the
>> kernel from appropriate position. Read about the mtdpart parameter in
>> u-boot, that should be sufficient for your needs.
>>
> OK
> Will do it
> 
>>> 2.3. u-boot
>>> I assume I should start with changing partitioning in u-boot:
>>> Currently I have
>>> mtdparts mtdparts=orion_nand:0xa0000@0x0(u-boot),0x400000@0x100000(uImage),0x1fb00000@0x500000(rootfs)
>> ---------------------------------^----------------------------^
>>
>> you will waste some space here! BTW did you think about your block size?
>>
> Where exactly?

Well, there is a gap of 0x60000 between u-boot and uImage section.

> I actually do not understand why should I have uImage partition as
> uImage is located now under /boot in rootfs partition as far as I
> understand. But this is what I took from other discussion thread.

Well, as mentioned above you can have a RAW mtd which could hold for
example the uImage.

>>> How to split rootfs into two partitions?
>>
>> You could handle it on a directory basis, just mount /boot from another fs.
>>
> 
> How can I do it?

Just mount /boot as another fs, as described above.

Best regards

Andreas Bießmann

  reply	other threads:[~2012-11-09 12:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09  9:35 UBIFS failure on SheevaPlug Basic Dimax
2012-11-09 11:20 ` Andreas Bießmann
2012-11-09 11:41   ` Dimax
2012-11-09 12:32     ` Andreas Bießmann [this message]
2012-11-12  5:33       ` Dimax

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=509CF7DA.8060505@corscience.de \
    --to=biessmann@corscience.de \
    --cc=dimax.main@gmail.com \
    --cc=linux-mtd@lists.infradead.org \
    /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