LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: chris.mason@oracle.com
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	btrfs-devel@oss.oracle.com
Subject: Re: BTRFS partition usage...
Date: Tue, 12 Feb 2008 00:11:04 -0800 (PST)	[thread overview]
Message-ID: <20080212.001104.172517283.davem@davemloft.net> (raw)
In-Reply-To: <20080211.232139.14959431.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Mon, 11 Feb 2008 23:21:39 -0800 (PST)

> Filesystems like ext2 put their superblock 1 block into the partition
> in order to avoid overwriting disk labels and other uglies.  UFS does
> this too, as do several others.  One of the few exceptions I've been
> able to find is XFS.
> 
> This is a real issue on sparc where the default sun disk labels
> created use an initial partition where block zero aliases the disk
> label.  It took me a few iterations before I figured out why every
> btrfs make would zero out my disk label :-/

Actually it seems this is only a problem with mkfs.btrfs, it clears
out the first 64 4K chunks of the disk for whatever reason.

The following patch cures the disk label spamming problem for me:

--- vanilla/btrfs-progs-0.12/mkfs.c	2008-02-06 08:37:45.000000000 -0800
+++ btrfs-progs-0.12/mkfs.c	2008-02-12 00:07:43.000000000 -0800
@@ -210,7 +210,8 @@ int main(int ac, char **av)
 		exit(1);
 	}
 	memset(buf, 0, sectorsize);
-	for(i = 0; i < 64; i++) {
+	lseek(fd, BTRFS_SUPER_INFO_OFFSET, SEEK_SET);
+	for(i = BTRFS_SUPER_INFO_OFFSET / sectorsize; i < 64; i++) {
 		ret = write(fd, buf, sectorsize);
 		if (ret != sectorsize) {
 			fprintf(stderr, "unable to zero fill device\n");

  reply	other threads:[~2008-02-12  8:10 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-06 17:00 [ANNOUNCE] Btrfs v0.12 released Chris Mason
2008-02-11  1:12 ` David Miller
2008-02-11 13:42   ` Chris Mason
2008-02-12  6:43     ` David Miller
2008-02-12 13:43       ` Chris Mason
2008-02-12  7:21 ` BTRFS partition usage David Miller
2008-02-12  8:11   ` David Miller [this message]
2008-02-12 13:49     ` Chris Mason
2008-02-12 14:00       ` Jan Engelhardt
2008-02-12 14:08         ` Chris Mason
2008-02-12 14:21           ` Jan Engelhardt
2008-02-12 14:35             ` Chris Mason
2008-02-12 15:04               ` Jan Engelhardt
2008-02-12 16:17                 ` Chris Mason
2008-02-12 23:38                 ` David Miller
2008-02-12 23:42                   ` Jan Engelhardt
2008-02-13  1:09                     ` David Miller
2008-02-13  1:22                     ` Rene Herman
2008-02-12 23:35               ` David Miller
2008-02-13  7:02                 ` Christoph Hellwig
2008-02-12 23:34             ` David Miller
2008-02-12 23:33           ` David Miller
2008-02-13  2:10             ` Jeff Garzik
2008-02-14  0:51               ` Szabolcs Szakacsits
2008-02-12 23:26         ` David Miller
2008-02-12 23:39           ` Jan Engelhardt
2008-02-13  1:08             ` David Miller
2008-02-13  1:25           ` Bryan Henderson
2008-02-12 23:28         ` David Miller
2008-02-13  0:45           ` Theodore Tso
2008-02-12 20:50       ` David Miller
2008-02-12  9:23 ` CRC32C big endian bugs David Miller
2008-02-12 21:55 ` BTRFS only works with PAGE_SIZE <= 4K David Miller
2008-02-12 22:03   ` Chris Mason

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=20080212.001104.172517283.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=btrfs-devel@oss.oracle.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: BTRFS partition usage...' \
    /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

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).