* unexpected raid1 behavior?
@ 2009-11-27 20:41 Jean-Philippe Robichaud
2009-11-27 21:04 ` Hugo Mills
0 siblings, 1 reply; 6+ messages in thread
From: Jean-Philippe Robichaud @ 2009-11-27 20:41 UTC (permalink / raw)
To: linux-btrfs
Hi, I'm starting to play with btrfs on my new computer. I'm running Gentoo and
have compiled the 2.6.31 kernel, enabling btrfs.
Now I have 2 partitions (on 2 different sata disks) that are free for me to
play with, each about 375 gb in size. I wanted to create a "raid1" volume
using these two partitions, so I did:
# mkfs.btrfs -d raid1 /dev/sda5 /dev/sdb5
# mount /dev/sda5 /btrfs
and everything seems fine.
Now what I find strange is that everything looks like a raid0 was created, not
a raid1:
$ df -h /btrfs/
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 684G 72G 612G 11% /btrfs
What am I doing (or understanding) wrong?
Thanks!
Jp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unexpected raid1 behavior?
2009-11-27 20:41 unexpected raid1 behavior? Jean-Philippe Robichaud
@ 2009-11-27 21:04 ` Hugo Mills
2009-11-27 22:36 ` Jean-Philippe Robichaud
0 siblings, 1 reply; 6+ messages in thread
From: Hugo Mills @ 2009-11-27 21:04 UTC (permalink / raw)
To: Jean-Philippe Robichaud; +Cc: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]
yOn Fri, Nov 27, 2009 at 03:41:17PM -0500, Jean-Philippe Robichaud wrote:
> Now I have 2 partitions (on 2 different sata disks) that are free for me to
> play with, each about 375 gb in size. I wanted to create a "raid1" volume
> using these two partitions, so I did:
>
> # mkfs.btrfs -d raid1 /dev/sda5 /dev/sdb5
> # mount /dev/sda5 /btrfs
>
> and everything seems fine.
>
> Now what I find strange is that everything looks like a raid0 was created, not
> a raid1:
>
> $ df -h /btrfs/
> Filesystem Size Used Avail Use% Mounted on
> /dev/sda5 684G 72G 612G 11% /btrfs
>
> What am I doing (or understanding) wrong?
It's effectively showing you the number of unallocated blocks, so
(with a RAID-1, single-redundancy filesystem), files will appear to
take twice as much of your free space as you think they should: write
a 2GiB file to that filesystem, and free space will drop by 4GiB.
I think that the reasoning behind this is that if you're using
per-object mirroring/striping, it's impossible to give a precise count
of the free space remaining on the volume in any meaningful way: write
a 1GiB striped file, and you'll take 1GiB of space; write the same
file mirrored, and you'll take 2GiB of space.
Hugo.
--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- There are three mistaiks in this sentance. ---
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: unexpected raid1 behavior?
2009-11-27 21:04 ` Hugo Mills
@ 2009-11-27 22:36 ` Jean-Philippe Robichaud
2009-11-29 12:42 ` Sander
0 siblings, 1 reply; 6+ messages in thread
From: Jean-Philippe Robichaud @ 2009-11-27 22:36 UTC (permalink / raw)
To: linux-btrfs
On Friday 27 November 2009 16:04:42 Hugo Mills wrote:
> yOn Fri, Nov 27, 2009 at 03:41:17PM -0500, Jean-Philippe Robichaud wrote:
> > Now I have 2 partitions (on 2 different sata disks) that are free for me
> > to play with, each about 375 gb in size. I wanted to create a "raid1"
> > volume using these two partitions, so I did:
> >
> > # mkfs.btrfs -d raid1 /dev/sda5 /dev/sdb5
> > # mount /dev/sda5 /btrfs
> >
> > and everything seems fine.
> >
> > Now what I find strange is that everything looks like a raid0 was
> > created, not a raid1:
> >
> > $ df -h /btrfs/
> > Filesystem Size Used Avail Use% Mounted on
> > /dev/sda5 684G 72G 612G 11% /btrfs
> >
> > What am I doing (or understanding) wrong?
>
> It's effectively showing you the number of unallocated blocks, so
> (with a RAID-1, single-redundancy filesystem), files will appear to
> take twice as much of your free space as you think they should: write
> a 2GiB file to that filesystem, and free space will drop by 4GiB.
>
> I think that the reasoning behind this is that if you're using
> per-object mirroring/striping, it's impossible to give a precise count
> of the free space remaining on the volume in any meaningful way: write
> a 1GiB striped file, and you'll take 1GiB of space; write the same
> file mirrored, and you'll take 2GiB of space.
>
> Hugo.
>
Thanks for your input Hugo, but somehow it looks like something different is
happening:
du toto
1088 toto
$ df .
/dev/sda5 716579256 75455900 641123356 11% /btrfs
$ cp toto toto2
$ btrfsctl -c .
$ df .
/dev/sda5 716579256 75456992 641122264 11% /btrfs
So 1092 block were 'consumed', we're far from the +2000 I would have
expected...
Is there a place in /sys or /proc where I could perhaps get 'stats' about the
btrfs volume?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unexpected raid1 behavior?
2009-11-27 22:36 ` Jean-Philippe Robichaud
@ 2009-11-29 12:42 ` Sander
2009-11-29 21:28 ` Jean-Philippe Robichaud
0 siblings, 1 reply; 6+ messages in thread
From: Sander @ 2009-11-29 12:42 UTC (permalink / raw)
To: Jean-Philippe Robichaud; +Cc: linux-btrfs
Hello Jean-Philippe,
Jean-Philippe Robichaud wrote (ao):
> Is there a place in /sys or /proc where I could perhaps get 'stats'
> about the btrfs volume?
I think btrfs-show should help you there.
With kind regards, Sander
--
Humilis IT Services and Solutions
http://www.humilis.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: unexpected raid1 behavior?
2009-11-29 12:42 ` Sander
@ 2009-11-29 21:28 ` Jean-Philippe Robichaud
2009-11-30 16:20 ` jean-philippe robichaud
0 siblings, 1 reply; 6+ messages in thread
From: Jean-Philippe Robichaud @ 2009-11-29 21:28 UTC (permalink / raw)
To: linux-btrfs
On Sunday 29 November 2009 07:42:56 Sander wrote:
> Hello Jean-Philippe,
>
> Jean-Philippe Robichaud wrote (ao):
> > Is there a place in /sys or /proc where I could perhaps get 'stats'
> > about the btrfs volume?
>
> I think btrfs-show should help you there.
>
> With kind regards, Sander
>
Sure: here it goes:
# sudo btrfs-show
failed to read /dev/sr0
Label: none uuid: fb9270b4-8779-489f-a599-eaab299d4633
Total devices 2 FS bytes used 78.98GB
devid 1 size 341.69GB used 146.03GB path /dev/sda5
devid 2 size 341.69GB used 146.01GB path /dev/sdb5
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: unexpected raid1 behavior?
2009-11-29 21:28 ` Jean-Philippe Robichaud
@ 2009-11-30 16:20 ` jean-philippe robichaud
0 siblings, 0 replies; 6+ messages in thread
From: jean-philippe robichaud @ 2009-11-30 16:20 UTC (permalink / raw)
To: linux-btrfs
On Sun, Nov 29, 2009 at 4:28 PM, Jean-Philippe Robichaud
<jean.philippe.robichaud@gmail.com> wrote:
>
> On Sunday 29 November 2009 07:42:56 Sander wrote:
> > Hello Jean-Philippe,
> >
> > Jean-Philippe Robichaud wrote (ao):
> > > Is there a place in /sys or /proc where I could perhaps get 'stat=
s'
> > > about the btrfs volume?
> >
> > I think btrfs-show should help you there.
> >
> > =A0 =A0 =A0 With kind regards, Sander
> >
> Sure: here it goes:
>
> # sudo btrfs-show
> failed to read /dev/sr0
>
> Label: none =A0uuid: fb9270b4-8779-489f-a599-eaab299d4633
> =A0 =A0 =A0 =A0Total devices 2 FS bytes used 78.98GB
> =A0 =A0 =A0 =A0devid =A0 =A01 size 341.69GB used 146.03GB path /dev/s=
da5
> =A0 =A0 =A0 =A0devid =A0 =A02 size 341.69GB used 146.01GB path /dev/s=
db5
>
I'm not sure I actually understand how to read this.The size of each
device make sense (341GB) as it is the size of both partitions. Now
the FS-bytes-used also make sense as it is about the size of data that
I've copied, but the per-device used space seems strange to me and the
output of "df -h" is also hard to interpret:
=46ilesystem Size Used Avail Use% Mounted on
/dev/sda5 684G 79G 605G 12% /btrfs
I would have understood if the "Used" field would have been 160GB or
if "Avail" would have dropped to 520GB.
I guess that I'll come to a point where Used will be 340GB and Avail
will also be 340GB but I'll be getting No Space Left On Device errors?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-30 16:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-27 20:41 unexpected raid1 behavior? Jean-Philippe Robichaud
2009-11-27 21:04 ` Hugo Mills
2009-11-27 22:36 ` Jean-Philippe Robichaud
2009-11-29 12:42 ` Sander
2009-11-29 21:28 ` Jean-Philippe Robichaud
2009-11-30 16:20 ` jean-philippe robichaud
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox