linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Btrfs prog
@ 2013-09-04 11:57 Giuseppe Fierro
  2013-09-04 13:32 ` Hugo Mills
  0 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Fierro @ 2013-09-04 11:57 UTC (permalink / raw)
  To: linux-btrfs

I'm using btrfs on ubuntu 13.04 with btrfs prog v0.20-rc1
This is my configuration using 2 disks in raid1 mode:

> gspe@jura:/mnt$ sudo btrfs f show
> Label: 'UbuntuDSK'  uuid: f4a3c832-f6ab-4b1d-9eb7-f9ba7d1cba01
> Total devices 2 FS bytes used 205.41GB
> devid    1 size 2.70TB used 214.03GB path /dev/sdb2
> devid    2 size 2.70TB used 214.01GB path /dev/sda2
> Btrfs v0.20-rc1


Some btrfs command behave strange:
If i want to check free space using df, i get:

> gspe@jura:/mnt$ sudo btrfs filesystem df /
> Data, RAID1: total=212.00GB, used=204.42GB
> Data: total=8.00MB, used=0.00
> System, RAID1: total=8.00MB, used=36.00KB
> System: total=4.00MB, used=0.00
> Metadata, RAID1: total=2.00GB, used=1010.04MB
> Metadata: total=8.00MB, used=0.00


If I would like to show the subvolume, i get

> gspe@jura:/mnt$ sudo btrfs subvolume list /
> gspe@jura:/mnt$


nothing is shown!!!

So what's happen to the btrfs prog?

Thanks
Giuseppe Fierro

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 11:57 Btrfs prog Giuseppe Fierro
@ 2013-09-04 13:32 ` Hugo Mills
  2013-09-04 13:51   ` Giuseppe Fierro
  2013-09-04 14:08   ` Chris Murphy
  0 siblings, 2 replies; 7+ messages in thread
From: Hugo Mills @ 2013-09-04 13:32 UTC (permalink / raw)
  To: Giuseppe Fierro; +Cc: linux-btrfs

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

On Wed, Sep 04, 2013 at 01:57:42PM +0200, Giuseppe Fierro wrote:
> I'm using btrfs on ubuntu 13.04 with btrfs prog v0.20-rc1
> This is my configuration using 2 disks in raid1 mode:
> 
> > gspe@jura:/mnt$ sudo btrfs f show
> > Label: 'UbuntuDSK'  uuid: f4a3c832-f6ab-4b1d-9eb7-f9ba7d1cba01
> > Total devices 2 FS bytes used 205.41GB
> > devid    1 size 2.70TB used 214.03GB path /dev/sdb2
> > devid    2 size 2.70TB used 214.01GB path /dev/sda2
> > Btrfs v0.20-rc1
> 
> 
> Some btrfs command behave strange:
> If i want to check free space using df, i get:
> 
> > gspe@jura:/mnt$ sudo btrfs filesystem df /
> > Data, RAID1: total=212.00GB, used=204.42GB
> > Data: total=8.00MB, used=0.00
> > System, RAID1: total=8.00MB, used=36.00KB
> > System: total=4.00MB, used=0.00
> > Metadata, RAID1: total=2.00GB, used=1010.04MB
> > Metadata: total=8.00MB, used=0.00

   What do you think is wrong with this output? It looks OK to me:

   From the btrfs fi show at the top, you have 214 GB allocated on
each device. The btrfs fi df shows you how that allocation is used:
212 GB (*2, because it's RAID-1) is allocated to data, with 204 GB
holding useful data. The remaining 2 GB (*2) is allocated to metadata,
and 1 GB of that is actually used.

> If I would like to show the subvolume, i get
> 
> > gspe@jura:/mnt$ sudo btrfs subvolume list /
> > gspe@jura:/mnt$
>
> nothing is shown!!!

   Try using the -a option. It got added a while ago, and has been a
complete pain in the neck ever since...

   Hugo.

-- 
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
   --- The English language has the mot juste for every occasion. ---    

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 13:32 ` Hugo Mills
@ 2013-09-04 13:51   ` Giuseppe Fierro
  2013-09-04 14:10     ` Chris Murphy
  2013-09-04 14:08   ` Chris Murphy
  1 sibling, 1 reply; 7+ messages in thread
From: Giuseppe Fierro @ 2013-09-04 13:51 UTC (permalink / raw)
  To: Hugo Mills, Giuseppe Fierro, linux-btrfs

Thanks,
as I can see I misunderstood the meaning of "btrfs filesystem df" I
was expecting that the 'df' has been to display free space remaining.

The -a option works

Giuseppe Fierro

On 4 September 2013 15:32, Hugo Mills <hugo@carfax.org.uk> wrote:
> On Wed, Sep 04, 2013 at 01:57:42PM +0200, Giuseppe Fierro wrote:
>> I'm using btrfs on ubuntu 13.04 with btrfs prog v0.20-rc1
>> This is my configuration using 2 disks in raid1 mode:
>>
>> > gspe@jura:/mnt$ sudo btrfs f show
>> > Label: 'UbuntuDSK'  uuid: f4a3c832-f6ab-4b1d-9eb7-f9ba7d1cba01
>> > Total devices 2 FS bytes used 205.41GB
>> > devid    1 size 2.70TB used 214.03GB path /dev/sdb2
>> > devid    2 size 2.70TB used 214.01GB path /dev/sda2
>> > Btrfs v0.20-rc1
>>
>>
>> Some btrfs command behave strange:
>> If i want to check free space using df, i get:
>>
>> > gspe@jura:/mnt$ sudo btrfs filesystem df /
>> > Data, RAID1: total=212.00GB, used=204.42GB
>> > Data: total=8.00MB, used=0.00
>> > System, RAID1: total=8.00MB, used=36.00KB
>> > System: total=4.00MB, used=0.00
>> > Metadata, RAID1: total=2.00GB, used=1010.04MB
>> > Metadata: total=8.00MB, used=0.00
>
>    What do you think is wrong with this output? It looks OK to me:
>
>    From the btrfs fi show at the top, you have 214 GB allocated on
> each device. The btrfs fi df shows you how that allocation is used:
> 212 GB (*2, because it's RAID-1) is allocated to data, with 204 GB
> holding useful data. The remaining 2 GB (*2) is allocated to metadata,
> and 1 GB of that is actually used.
>
>> If I would like to show the subvolume, i get
>>
>> > gspe@jura:/mnt$ sudo btrfs subvolume list /
>> > gspe@jura:/mnt$
>>
>> nothing is shown!!!
>
>    Try using the -a option. It got added a while ago, and has been a
> complete pain in the neck ever since...
>
>    Hugo.
>
> --
> === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
>   PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
>    --- The English language has the mot juste for every occasion. ---



-- 
This email and any attachments to it may be confidential and are
intended solely for the use of the individual to whom it is addressed.
Any views or opinions expressed are solely those of the author and do
not necessarily represent those of fierro.org.

If you are not the intended recipient of this email, you must neither
take any action based upon its contents, nor copy or show it to
anyone.

Please contact the sender if you believe you have received this email in error.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 13:32 ` Hugo Mills
  2013-09-04 13:51   ` Giuseppe Fierro
@ 2013-09-04 14:08   ` Chris Murphy
  2013-09-04 14:37     ` Wang Shilong
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Murphy @ 2013-09-04 14:08 UTC (permalink / raw)
  To: Hugo Mills; +Cc: Giuseppe Fierro, linux-btrfs


On Sep 4, 2013, at 3:32 PM, Hugo Mills <hugo@carfax.org.uk> wrote:

>> If I would like to show the subvolume, i get
>> 
>>> gspe@jura:/mnt$ sudo btrfs subvolume list /
>>> gspe@jura:/mnt$
>> 
>> nothing is shown!!!
> 
>   Try using the -a option. It got added a while ago, and has been a
> complete pain in the neck ever since…

What does -a do?

I recall with older versions of btrfs-progs that if a subvolume was mounted, btrfs subvol list would only list subvolumes under the one that was mounted, not all subvolumes on the volume. I just tried this with btrfs-progs-0.20.rc1.20130501git7854c8b-4.fc20.x86_64 without -a option, but with a subvolume mounted and the command lists all subvolumes.

OK now I'm seeing the behavior is sometimes wrong.

[root@f19v ~]# btrfs subvolume create /mnt/cookies
Create subvolume '/mnt/cookies'
[root@f19v ~]# btrfs subvolume create /mnt/chips
Create subvolume '/mnt/chips'
[root@f19v ~]# btrfs subvolume create /mnt/nuts
Create subvolume '/mnt/nuts'
[root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew
Create subvolume '/mnt/nuts/cashew'
[root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew
ERROR: '/mnt/nuts/cashew' exists
[root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew/small
Create subvolume '/mnt/nuts/cashew/small'
[root@f19v ~]# umount /mnt
[root@f19v ~]# mount -o subvol=nuts/cashew /dev/sdb /mnt
[root@f19v ~]# btrfs subvolume list /mnt
ID 256 gen 5 top level 5 path cookies
ID 258 gen 10 top level 5 path chips
ID 259 gen 12 top level 5 path nuts
ID 260 gen 13 top level 5 path nuts/cashew
ID 261 gen 13 top level 260 path small


The last one should be /nuts/cashew/small. Or the one before it should be cashew instead of nuts/cashew.


Chris Murphy



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 13:51   ` Giuseppe Fierro
@ 2013-09-04 14:10     ` Chris Murphy
  2013-09-04 14:26       ` Wang Shilong
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Murphy @ 2013-09-04 14:10 UTC (permalink / raw)
  To: Giuseppe Fierro; +Cc: Hugo Mills, linux-btrfs


On Sep 4, 2013, at 3:51 PM, Giuseppe Fierro <giuseppe@fierro.org> wrote:

> Thanks,
> as I can see I misunderstood the meaning of "btrfs filesystem df" I
> was expecting that the 'df' has been to display free space remaining.

Check the archives, this is a long running issue that no one has particularly great answers for because what free space remains depends on future (unknown) usage of the file system. But I still think it's a worse problem to not report anything at all in btrfs fi df, considering the historical point of df is to show space available. And it's also not good that the regular df shows e.g. for raid1, twice the free space as the amount of data that can be saved to the volume.

Chris Murphy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 14:10     ` Chris Murphy
@ 2013-09-04 14:26       ` Wang Shilong
  0 siblings, 0 replies; 7+ messages in thread
From: Wang Shilong @ 2013-09-04 14:26 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Giuseppe Fierro, Hugo Mills, linux-btrfs


在 2013-9-4,下午10:10,Chris Murphy <lists@colorremedies.com> 写道:

> 
> On Sep 4, 2013, at 3:51 PM, Giuseppe Fierro <giuseppe@fierro.org> wrote:
> 
>> Thanks,
>> as I can see I misunderstood the meaning of "btrfs filesystem df" I
>> was expecting that the 'df' has been to display free space remaining.
> 
> Check the archives, this is a long running issue that no one has particularly great answers for because what free space remains depends on future (unknown) usage of the file system. But I still think it's a worse problem to not report anything at all in btrfs fi df, considering the historical point of df is to show space available. And it's also not good that the regular df shows e.g. for raid1, twice the free space as the amount of data that can be saved to the volume.
> 
> Chris Murphy--
> 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] 7+ messages in thread

* Re: Btrfs prog
  2013-09-04 14:08   ` Chris Murphy
@ 2013-09-04 14:37     ` Wang Shilong
  0 siblings, 0 replies; 7+ messages in thread
From: Wang Shilong @ 2013-09-04 14:37 UTC (permalink / raw)
  To: Chris Murphy; +Cc: Hugo Mills, Giuseppe Fierro, linux-btrfs

Hello Chris,
> 
> On Sep 4, 2013, at 3:32 PM, Hugo Mills <hugo@carfax.org.uk> wrote:
> 
>>> If I would like to show the subvolume, i get
>>> 
>>>> gspe@jura:/mnt$ sudo btrfs subvolume list /
>>>> gspe@jura:/mnt$
>>> 
>>> nothing is shown!!!
>> 
>>  Try using the -a option. It got added a while ago, and has been a
>> complete pain in the neck ever since…
> 
> What does -a do?
> 
> I recall with older versions of btrfs-progs that if a subvolume was mounted, btrfs subvol list would only list subvolumes under the one that was mounted, not all subvolumes on the volume. I just tried this with btrfs-progs-0.20.rc1.20130501git7854c8b-4.fc20.x86_64 without -a option, but with a subvolume mounted and the command lists all subvolumes.
> 
> OK now I'm seeing the behavior is sometimes wrong.
> 
> [root@f19v ~]# btrfs subvolume create /mnt/cookies
> Create subvolume '/mnt/cookies'
> [root@f19v ~]# btrfs subvolume create /mnt/chips
> Create subvolume '/mnt/chips'
> [root@f19v ~]# btrfs subvolume create /mnt/nuts
> Create subvolume '/mnt/nuts'
> [root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew
> Create subvolume '/mnt/nuts/cashew'
> [root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew
> ERROR: '/mnt/nuts/cashew' exists
> [root@f19v ~]# btrfs subvolume create /mnt/nuts/cashew/small
> Create subvolume '/mnt/nuts/cashew/small'
> [root@f19v ~]# umount /mnt
> [root@f19v ~]# mount -o subvol=nuts/cashew /dev/sdb /mnt
> [root@f19v ~]# btrfs subvolume list /mnt
> ID 256 gen 5 top level 5 path cookies
> ID 258 gen 10 top level 5 path chips
> ID 259 gen 12 top level 5 path nuts
> ID 260 gen 13 top level 5 path nuts/cashew
> ID 261 gen 13 top level 260 path small

I get the following output:
	cookies
	chips
	nuts
	nuts/cashew
	nuts/cashew/small

Why "small" occurs in your test box?

Thanks,
wang

> 
> 
> The last one should be /nuts/cashew/small. Or the one before it should be cashew instead of nuts/cashew.
> 
> 
> Chris Murphy
> 
> 
> --
> 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] 7+ messages in thread

end of thread, other threads:[~2013-09-04 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04 11:57 Btrfs prog Giuseppe Fierro
2013-09-04 13:32 ` Hugo Mills
2013-09-04 13:51   ` Giuseppe Fierro
2013-09-04 14:10     ` Chris Murphy
2013-09-04 14:26       ` Wang Shilong
2013-09-04 14:08   ` Chris Murphy
2013-09-04 14:37     ` Wang Shilong

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