Linux-Fsdevel Archive mirror
 help / color / mirror / Atom feed
From: Pintu Agarwal <pintu.ping@gmail.com>
To: linux-mtd <linux-mtd@lists.infradead.org>,
	linux-fsdevel@kvack.org,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"Ezequiel Garcia" <ezequiel@collabora.com>,
	"Bjørn Mork" <bjorn@mork.no>
Subject: Re: How to detect if ubi volume is empty
Date: Mon, 20 May 2024 15:52:49 +0530	[thread overview]
Message-ID: <CAOuPNLjccNaLVAMWZ4p9U5zFe7FMwJa=3StPMTFDRngo2yRb-w@mail.gmail.com> (raw)
In-Reply-To: <CAOuPNLhN2pxa5KPpxiCBZMEGTgqaNddB6DZeB17tanp2gQgX1w@mail.gmail.com>

Hi,

In Linux Kernel 5.15 is there a way to detect in runtime, if UBI
volume (squashfs based, ubiblock, dynamic) is empty or not ?

Based on this we need to make some decisions at runtime.

Currently, we are using a crude way to detect volume empty by reading
the first 1K block using the "dd" command and checking if the contents
are all FF.

Is this good enough, or is there some other better way ?

Thanks.
Pintu

       reply	other threads:[~2024-05-20 10:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOuPNLhN2pxa5KPpxiCBZMEGTgqaNddB6DZeB17tanp2gQgX1w@mail.gmail.com>
2024-05-20 10:22 ` Pintu Agarwal [this message]
2024-05-21 11:08   ` How to detect if ubi volume is empty Zhihao Cheng

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='CAOuPNLjccNaLVAMWZ4p9U5zFe7FMwJa=3StPMTFDRngo2yRb-w@mail.gmail.com' \
    --to=pintu.ping@gmail.com \
    --cc=bjorn@mork.no \
    --cc=ezequiel@collabora.com \
    --cc=linux-fsdevel@kvack.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).