From: Richard Weinberger <richard@nod.at>
To: Steve deRosier <derosier@gmail.com>, hujianyang <hujianyang@huawei.com>
Cc: linux-mtd <linux-mtd@lists.infradead.org>,
Sheng Yong <shengyong1@huawei.com>,
Artem Bityutskiy <dedekind1@gmail.com>
Subject: Re: [RFC] UBIFS recovery
Date: Fri, 06 Feb 2015 00:36:05 +0100 [thread overview]
Message-ID: <54D3FE65.5030008@nod.at> (raw)
In-Reply-To: <CALupW3CQ3YCvdx_tNeDGVo9cVTcmACyqsMRpr8+P2_4jwGgZMQ@mail.gmail.com>
Am 05.02.2015 um 16:08 schrieb Steve deRosier:
> On Thu, Feb 5, 2015 at 1:47 AM, hujianyang <hujianyang@huawei.com> wrote:
>> There are two ways for UBIFS recovery. One is repairing UBIFS image
>> in userspace via UBI interfaces, the other is repairing the corrupted
>> data during mount by default or via a special mount option.
>>
>> The userspace tool is the most effective way to repair a partition.
>> It could have enough time and resource to whole scan the target and
>> cleanup the corrupted while the file-system offline. But it's hard
>> to program: many structures and functions in kernel need to be copied
>> into this utility, current ubi-utils focus mostly on UBI device, not
>> UBIFS, and the subsequent updating of file-system should consider the
>> userspace tool. It's too complicated.
>>
>
> I hear (and agree with) several valid arguments for a tool in
> userspace. And I'd like to throw my support towards an in-driver
> solution. Flash filesystems are different than on-disk filesystems, in
> particular in their usecase: they're generally both critical and
> exclusive to embedded systems. As such, the entire filesystem might be
> on the corrupted UBIFS, so even if the filesystem is recoverable, if
> we can't mount it and get at the userspace tool, then we're toast.
No, embedded is not per se an excuse for doing bad/stupid things.
Embedded is *not* special.
There are folks out there that want a "force" mount option for UBIFS
to mount it in any case no matter in how bad shape it is.
But this will make the situation much worse as you'll get silent data
corruption/loss.
It is as stupid as running a "fsck -y /dev/sdXY" at every boot on a
regular disk filesystem.
UBIFS can only fully automatically recover *iff* it can guarantee that it
will be consistent after recovery and does not lose data.
If not is has to fail at mount time.
What does it help if UBIFS successfully mounts but /sbin/init is damaged or
the permissions of /etc/shadow are corrupted?
On the other hand, if UBIFS can do a better job at automatically and safe
recovery, lets improve it.
But what we really need is a fsck.ubifs and a debugfs.ubifs.
In-kernel recovery cannot replace a fsck as in-kernel will always be non-interactive.
> Often the kernel itself is stored in a separate read-only partition as
> a blob directly on the flash, and thus the kernel itself would be
> fine. The better UBI & UBIFS can recover to a usable state in-kernel,
> the better off we are I think.
Using an initramfs you can have an fsck.ubifs without a mounted root.
Thanks,
//richard
next prev parent reply other threads:[~2015-02-05 23:36 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-05 9:47 [RFC] UBIFS recovery hujianyang
2015-02-05 13:09 ` shengyong
2015-02-06 17:21 ` Artem Bityutskiy
2015-02-05 15:08 ` Steve deRosier
2015-02-05 23:36 ` Richard Weinberger [this message]
2015-02-09 12:08 ` Richard Weinberger
2015-02-06 17:26 ` Artem Bityutskiy
2015-02-06 17:33 ` Richard Weinberger
2015-02-06 17:40 ` Artem Bityutskiy
2015-02-06 17:43 ` Richard Weinberger
2015-02-09 3:00 ` hujianyang
2015-02-09 7:56 ` Richard Weinberger
2015-02-09 8:26 ` Artem Bityutskiy
2015-02-09 11:04 ` Richard Weinberger
2015-02-09 11:36 ` Artem Bityutskiy
2015-02-09 11:48 ` Richard Weinberger
2015-02-09 2:48 ` hujianyang
2015-02-09 3:09 ` hujianyang
2015-02-06 17:02 ` Artem Bityutskiy
2015-02-09 2:34 ` hujianyang
2015-02-09 7:51 ` Artem Bityutskiy
2015-02-09 7:57 ` Richard Weinberger
2015-02-09 10:38 ` hujianyang
2015-02-09 11:05 ` Richard Weinberger
2015-02-09 11:23 ` hujianyang
2015-02-09 11:18 ` Artem Bityutskiy
2015-02-09 12:02 ` hujianyang
2015-02-09 12:12 ` Ricard Wanderlof
2015-02-09 12:38 ` hujianyang
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=54D3FE65.5030008@nod.at \
--to=richard@nod.at \
--cc=dedekind1@gmail.com \
--cc=derosier@gmail.com \
--cc=hujianyang@huawei.com \
--cc=linux-mtd@lists.infradead.org \
--cc=shengyong1@huawei.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