linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
To: Ankur Tank <Ankur.Tank@LntTechservices.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: btrfs doesn't format eMMC if previous filesystem is ext4
Date: Fri, 26 Dec 2014 15:05:45 -0500	[thread overview]
Message-ID: <20141226200529.GA11406@hungrycats.org> (raw)
In-Reply-To: <CFB3B8F56DDE9F45B45EBDEBED372A6644232D@POCITMSEXMB05.LntUniverse.com>

[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]

On Fri, Dec 26, 2014 at 03:24:59PM +0000, Ankur Tank wrote:
> I wanted to test btrfs on the eMMC of beaglebone black based custom board.
> Precondition: eMMC is formatted with ext4 filesystem
> Use case:
>         Format eMMC with mkfs.btrfs  -L  <label>  <dev>
> Result:
>         Mkfs.btrfs denies formatting eMMC because its existing filesystem
> 
> # mkfs.btrfs -L "1storage" /dev/mmcblk0p2
> /dev/mmcblk0p2 appears to contain an existing filesystem (ext4).
> Error: Use the -f option to force overwrite.
> 
> If I add "-f" its possible to format the eMMC.

It seems to be a feature.  mkfs.btrfs will test the device with libblkid
to see if there is a filesystem present to prevent administrator mistakes.
If libblkid can identify and device, it will prevent format without -f.

If you're doing an automated script, you need the -f.  libblkid isn't
particularly reliable and can false-positive on random data (e.g. the
HFS module can detect a filesystem that is not there).  If you're doing
tests that involve reformatting the filesystem in a loop, you need the -f.

> # mkfs.btrfs -f -L "1storage" /dev/mmcblk0p2
> Detected a SSD, turning off metadata duplication.  Mkfs with -m dup if you want to force metadata duplication.
> Btrfs v3.17
> See http://btrfs.wiki.kernel.org for more information.
> 
> Performing full device TRIM (1.72GiB) ...
> Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
> [273917.692896] btrfs: device label 1storage devid 1 transid 3 /dev/mmcblk0p2
> fs created label 1storage on /dev/mmcblk0p2
>         nodesize 16384 leafsize 16384 sectorsize 4096 size 1.72GiB
> 
> I had downloaded debian package from following link
> https://packages.debian.org/sid/armhf/btrfs-tools/download
> 
> Is it a bug ? or I am missing something ?

If your device is small or solid-state, btrfs will change the default
options (mixed-metadata, no duplicate metadata).

"extref" is a feature that enables large numbers of hardlinks to a
single file.  You can leave it enabled-it's unlikely your devices
will ever see a kernel old enough that it's not compatible.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-12-26 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-26 15:24 btrfs doesn't format eMMC if previous filesystem is ext4 Ankur Tank
2014-12-26 20:05 ` Zygo Blaxell [this message]
2014-12-29  2:50 ` Anand Jain
2014-12-29  7:15   ` Ankur Tank
2014-12-29  9:38     ` Martin Steigerwald
2014-12-29  9:55       ` Ankur Tank
2014-12-29 10:18         ` Martin Steigerwald
2014-12-30  6:53           ` Ankur Tank
2014-12-29  9:55     ` Anand Jain

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=20141226200529.GA11406@hungrycats.org \
    --to=ce3g8jdj@umail.furryterror.org \
    --cc=Ankur.Tank@LntTechservices.com \
    --cc=linux-btrfs@vger.kernel.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 NNTP newsgroup(s).